profanity-checker-fr
Version:
French Profanity Filter is a lightweight and easy-to-use Node.js module to detect and filter offensive words (profanity, insults) in French sentences. Ideal for chat applications, comment moderation, and any service that requires clean user-generated cont
40 lines • 1.67 kB
TypeScript
/**
* Configuration class for managing the profanity checker.
* Contains settings like bad words, censored character, and whitelisted words.
*/
export declare class ProfanityConfig {
protected static badWordsSet: Set<string>;
protected static censoreSet: string;
protected static whiteListWordsSet: Set<string>;
/**
* This method allows you to change the default censor character.
* You can use any string for replacement, e.g., '$' or '!'.
* @param replacement - The string to use as the replacement for censored words.
*/
static changeCensoredWords(replacement: string): void;
/**
* Adds bad words to the badWordsSet.
* Accepts either a single string or an array of strings.
* @param words - The word(s) to add to the bad words set.
*/
static addBadWords(words: string | string[]): void;
/**
* Deletes bad words from the badWordsSet.
* Aceepts either a single string or an array of strings.
* @param words - The word(s) to delete from the bad words set.
*/
static deleteBadWords(words: string | string[]): void;
/**
* Adds words to the whitelist. Whitelisted words will not be censored.
* Accepts either a single string or an array of strings.
* @param words - The word(s) to add to the whitelist.
*/
static addWhiteList(words: string | string[]): void;
/**
* Deletes words from the whitelist.
* Accepts either a single string or an array of strings.
* @param words - The word(s) to delete from the whitelist.
*/
static deleteWhiteList(words: string | string[]): void;
}
//# sourceMappingURL=profanityConfig.d.ts.map