MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / getTermCoverage

Function getTermCoverage

src/core/embeddings.ts:372–379  ·  view source on GitHub ↗
(queryTerms: Set<string>, docTerms: Set<string>)

Source from the content-addressed store, hash-verified

370}
371
372function getTermCoverage(queryTerms: Set<string>, docTerms: Set<string>): number {
373 if (queryTerms.size === 0) return 0;
374 let matched = 0;
375 for (const term of queryTerms) {
376 if (docTerms.has(term)) matched++;
377 }
378 return matched / queryTerms.size;
379}
380
381function getMatchedSymbols(symbols: string[], queryTerms: Set<string>): string[] {
382 if (queryTerms.size === 0) return [];

Callers 1

computeKeywordScoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected