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

Function addWord

cy/cy.ts:180–184  ·  view source on GitHub ↗
(counts: Map<string, number>, word: string, weight = 1)

Source from the content-addressed store, hash-verified

178}
179
180function addWord(counts: Map<string, number>, word: string, weight = 1): void {
181 const normalized = word.trim().toLowerCase();
182 if (!isUsefulWord(normalized)) return;
183 counts.set(normalized, (counts.get(normalized) || 0) + weight);
184}
185
186function pruneOverlappingWords(entries: Array<[string, number]>): Array<[string, number]> {
187 return entries.filter(([word, count]) => {

Callers 1

collectWordsFunction · 0.85

Calls 3

isUsefulWordFunction · 0.85
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected