CityLeeks swearword detector
npm install cl-swearword-detectorRussian swearword detection and filtering library for CityLeeks.


npm install --save cl-swearword-detector
Returns true if the given string contains profanity.
var detector = require('cl-swearword-detector');
detector.profane("я люблю тебя, Гавана"); // false
detector.profane("я люблю тебя, сука"); // true
Replaces profanity with *.
var clean = detector.censor("я люблю тебя, сука"); // я люблю тебя, **
Loads a dictionary of words to be used as filter.
detector.loadBadWords("../dicts/swearwords.json");
A dictionary is just a array.
[
"word1",
"word2",
"word3"
]