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

Function step1a

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

* Step 1a: Handle plural forms and -ed/-ing endings

(word: string)

Source from the content-addressed store, hash-verified

75 * Step 1a: Handle plural forms and -ed/-ing endings
76 */
77function step1a(word: string): string {
78 if (word.endsWith("sses")) {
79 return word.slice(0, -2);
80 }
81 if (word.endsWith("ies")) {
82 return word.slice(0, -2);
83 }
84 if (word.endsWith("ss")) {
85 return word;
86 }
87 if (word.endsWith("s")) {
88 return word.slice(0, -1);
89 }
90 return word;
91}
92
93/**
94 * Step 1b: Handle -eed, -ed, -ing endings

Callers 1

stemFunction · 0.85

Calls 1

endsWithMethod · 0.45

Tested by

no test coverage detected