(queryTerms: Set<string>, input: string)
| 114 | } |
| 115 | |
| 116 | function getKeywordCoverage(queryTerms: Set<string>, input: string): number { |
| 117 | if (queryTerms.size === 0) return 0; |
| 118 | const docTerms = new Set(splitTerms(input)); |
| 119 | let matched = 0; |
| 120 | for (const term of queryTerms) { |
| 121 | if (docTerms.has(term)) matched++; |
| 122 | } |
| 123 | return matched / queryTerms.size; |
| 124 | } |
| 125 | |
| 126 | function isDefinitionLine(line: string, symbolName: string): boolean { |
| 127 | const escaped = escapeRegex(symbolName); |
no test coverage detected