MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / surfaceByStem

Function surfaceByStem

src/context/approach-diff.ts:22–29  ·  view source on GitHub ↗

Map stem → first surface form, preserving first-seen order.

(text: string)

Source from the content-addressed store, hash-verified

20
21/** Map stem → first surface form, preserving first-seen order. */
22function surfaceByStem(text: string): Map<string, string> {
23 const m = new Map<string, string>();
24 for (const w of tokenize(text)) {
25 const s = stem(w);
26 if (!m.has(s)) m.set(s, w);
27 }
28 return m;
29}
30
31/** Vocabulary diff of `other` against `ref`, compared by stem, displayed as surface words. PURE. */
32export function termDiff(refText: string, otherText: string, cap = 8): TermDiff {

Callers 1

termDiffFunction · 0.85

Calls 4

tokenizeFunction · 0.85
stemFunction · 0.85
hasMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected