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

Function splitTerms

src/tools/semantic-identifiers.ts:75–82  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

73}
74
75function splitTerms(text: string): string[] {
76 return text
77 .replace(/([a-z])([A-Z])/g, "$1 $2")
78 .replace(/([A-Z])([A-Z][a-z])/g, "$1 $2")
79 .toLowerCase()
80 .split(/[^a-z0-9_]+/)
81 .filter((token) => token.length > 1);
82}
83
84function cosine(a: number[], b: number[]): number {
85 let dot = 0;

Callers 2

getKeywordCoverageFunction · 0.85
semanticIdentifierSearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected