MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / isUsefulWord

Function isUsefulWord

cy/cy.ts:169–178  ·  view source on GitHub ↗
(word: string)

Source from the content-addressed store, hash-verified

167}
168
169function isUsefulWord(word: string): boolean {
170 if (!word) return false;
171 const normalized = word.toLowerCase();
172 if (STOP_WORDS.has(normalized)) return false;
173 if (/^\d+$/.test(normalized)) return false;
174 if (/^[a-z]{1,2}$/i.test(normalized)) return false;
175 if (/^[o0]+$/i.test(normalized)) return false;
176 if (/^[._+\-]+$/.test(normalized)) return false;
177 return true;
178}
179
180function addWord(counts: Map<string, number>, word: string, weight = 1): void {
181 const normalized = word.trim().toLowerCase();

Callers 1

addWordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected