node-sensitive-word-filtering
Advanced tools
+25
-1
| declare class Trie { | ||
| /** | ||
| * Inserts a word into the Trie. | ||
| * @param word The word to insert. | ||
| */ | ||
| insert(word: string): void; | ||
| /** | ||
| * Checks if the Trie contains the specified word. | ||
| * @param word The word to check. | ||
| * @returns True if the word exists, otherwise false. | ||
| */ | ||
| contains(word: string): boolean; | ||
| /** | ||
| * Deletes a word from the Trie. | ||
| * @param word The word to delete. | ||
| */ | ||
| delete(word: string): void; | ||
| filter(text: string, ignoreSpaces?: boolean): string; | ||
| /** | ||
| * Filters the input text and replaces sensitive words with asterisks. | ||
| * @param options The filter options. | ||
| * @param options.text The input text to filter. | ||
| * @param options.ignoreSpaces Optional. Whether to ignore spaces between characters when matching. Defaults to false. | ||
| * @param options.ignoreCase Optional. Whether to ignore case when matching. Defaults to false. | ||
| * @returns The filtered text. | ||
| */ | ||
| filter(options: { text: string; ignoreSpaces?: boolean; ignoreCase?: boolean }): string; | ||
| } | ||
| export = Trie; |
+1
-1
| { | ||
| "name": "node-sensitive-word-filtering", | ||
| "version": "1.0.3", | ||
| "version": "1.0.4", | ||
| "description": "A Node.js library for filtering sensitive words using a prefix tree (Trie).", | ||
@@ -5,0 +5,0 @@ "main": "sensitive-word-trie.js", |
5419
18.16%124
20.39%