-
Notifications
You must be signed in to change notification settings - Fork 4
BadWordsNext
Wiki mirror edited this page Apr 7, 2024
·
84 revisions
Main library class implementing profanity filtering and detection
• new BadWordsNext(opts?
)
Create an instance of BadWordsNext class
Name | Type |
---|---|
opts? |
Options |
• exclusionsRegexps: RegExp
[]
Prepared regexps for exclusions
▸ add(data
): void
Add dictionary data for bad words filtering and detection
Name | Type | Description |
---|---|---|
data |
Data |
Dictionary data |
void
▸ check(word
): boolean
Check whether the particular word is bad or not
Name | Type |
---|---|
word |
string |
boolean
▸ filter(str
, onCatch?
): string
Filter bad words in the input string and replace them with a placeholder
Name | Type |
---|---|
str |
string |
onCatch? |
(badword : string ) => void
|
string