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

Method fuzzyMatch

search/search.ts:662–672  ·  view source on GitHub ↗
(text: string, query: string)

Source from the content-addressed store, hash-verified

660 }
661
662 private fuzzyMatch(text: string, query: string): boolean {
663 if (text.includes(query)) return true;
664 const queryParts = query.split(' ').filter(part => part.length > 0);
665 const textParts = text.split(' ');
666
667 if (queryParts.length === 1 && /[a-z]+\s*\d+/i.test(query)) {
668 if (text.replace(/\s+/g, '').includes(query.replace(/\s+/g, ''))) return true;
669 }
670
671 return queryParts.every(queryPart => textParts.some(textPart => textPart.includes(queryPart)));
672 }
673
674 private isAdContent(message: Api.Message): boolean {
675 const text = (message.text || message.message || "").toLowerCase();

Callers 1

isMessageMatchingMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected