profane
A profanity detector.
Usage
var Profane = require("profane");
var p = new Profane();
var wordCounts = p.getWordCounts("hell no dude");
console.log(wordCounts);
var categoryCounts = p.getCategoryCounts("hell no dude");
console.log(categoryCounts);
p.addWord("nasty", ["inappropriate", "gross"]);
wordCounts = p.getWordCounts("you are nasty");
console.log(wordCounts);
if (p.wordHasCategory("nasty", "gross")) {
console.log("This will be printed");
}
p.removeWord("nasty");
if (p.hasWord("nasty")) {
console.log("This won't be printed");
}
p.clearWords();
if (p.hasWord("hell")) {
console.log("This won't be printed");
}
p.addWord("hell", ["religious"]);
p.addCategoriesForWord("hell", ["inappropriate"]);
p.removeCategoriesForWord("hell", ["religious"]);
p.setCategoriesForWord("hell", ["inappropriate", "religious"]);
p.setUseWholeWordMatch(true);
var wordCounts = p.getWordCounts("shell no dude hellhell hello");
console.log(wordCounts);
var wordCounts = p.getWordCounts("shell no dude hellhell hello HELL");
console.log(wordCounts);