1.1.1 • Published 6 years ago
bad-word-ar v1.1.1
bad-word-ar
A more relaxed javascript filter for badwords.
Installation
npm install bad-word-arUsage
var Filter = require('bad-word-ar'),
filter = new Filter('ar');
console.log(filter.clean("الله يلعنك"));
//الله *****check
var Filter = require('bad-word-ar'),
filter = new Filter('ar');
console.log(filter.check("يلعن ابوك"));
//true
console.log(filter.check("مرحبا بك"));
//falsecheck
var Filter = require('bad-word-ar'),
filter = new Filter('ar');
console.log(filter.count("الله يلعنك"));
//1
console.log(filter.check("مرحبا بك"));
//0Filter
Filter constructor.
Parameters
listarray Instantiate filter with custom list
isProfaneLike
Determine if a single word is profane or looks profane.
Parameters
wordstring String to evaluate for profanity.
replaceWord
Replace a word with placeHolder characters;
Parameters
stringstring String to replace.
clean
Evaluate a string for profanity and return an edited version.
Parameters
stringstring Sentence to filter.
count
Count a string for profanity and return the count.
Parameters
stringstring Sentence to filter.
check
Check a string for profanity and return an Boolean value.
Parameters
stringstring Sentence to filter.