MCPcopy Create free account
hub / github.com/codemix/graph / step1c

Function step1c

packages/text-search/src/stemmer.ts:141–149  ·  view source on GitHub ↗

* Step 1c: Handle -y endings

(word: string)

Source from the content-addressed store, hash-verified

139 * Step 1c: Handle -y endings
140 */
141function step1c(word: string): string {
142 if (word.endsWith("y")) {
143 const stem = word.slice(0, -1);
144 if (containsVowel(stem)) {
145 return stem + "i";
146 }
147 }
148 return word;
149}
150
151/**
152 * Step 2: Handle various suffixes with measure > 0

Callers 1

stemFunction · 0.85

Calls 2

containsVowelFunction · 0.85
endsWithMethod · 0.45

Tested by

no test coverage detected