MCPcopy Create free account
hub / github.com/Coneja-Chibi/CarrotKernel / normalizeKeywordClient

Function normalizeKeywordClient

chunk-visualizer.js:59–71  ·  view source on GitHub ↗
(word)

Source from the content-addressed store, hash-verified

57}
58
59function normalizeKeywordClient(word) {
60 if (!word) return '';
61 let normalized = word.toLowerCase();
62 const replacements = [
63 /(?:ing|ingly)$/, /(?:edly)$/, /(?:tion|tions)$/, /(?:ment|ments)$/,
64 /(?:ness|nesses)$/, /(?:ally)$/, /(?:ies)$/, /(?:ers|er)$/,
65 /(?:less)$/, /(?:ful)$/, /(?:ous)$/, /(?:ly)$/, /(?:ed)$/, /(?:es)$/, /(?:s)$/
66 ];
67 for (const regex of replacements) {
68 normalized = normalized.replace(regex, '');
69 }
70 return normalized;
71}
72
73function initializeChunkKeywordMetadata(chunk) {
74 if (!chunk) return;

Callers 6

renderChunkCardFunction · 0.85
getWeightFunction · 0.85
createWeightBadgeFunction · 0.85
bindActualEventsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected