17 lines
635 B
Go
17 lines
635 B
Go
package knowledge
|
|
|
|
// ResolveScanPatrolKeywords picks the most relevant search phrases for the Search API.
|
|
// Research map and graph nodes are inputs; UI display order is not preserved.
|
|
func ResolveScanPatrolKeywords(explicit, saved []string, input PatrolTagInput, nodes []Node) []string {
|
|
nodes = NodesForPatrolKeywordDerivation(nodes)
|
|
return SelectBestSearchKeywords(explicit, saved, input, nodes, MaxScanPatrolKeywords)
|
|
}
|
|
|
|
func capPatrolKeywordList(keywords []string, limit int) []string {
|
|
keywords = NormalizePatrolKeywordList(keywords)
|
|
if limit <= 0 || len(keywords) <= limit {
|
|
return keywords
|
|
}
|
|
return keywords[:limit]
|
|
}
|