node-profanity-filter
Version:
A Node.js profanity filter with support for exact matching, obfuscated word detection, and customizable replacement.
15 lines (14 loc) • 316 B
TypeScript
type StringOrArray = string | string[];
export type Match = {
word: string;
start: number;
end: number;
};
export declare class AhoCorasick {
private root;
constructor(words?: StringOrArray);
add(input: StringOrArray): void;
private build;
search(text: string): Match[];
}
export {};