unswearify
v1.0.3
Published
An AIless swear detection module
Downloads
18
Maintainers
Readme
unswearify
Installation
npm install unswearify
Usage
const unswearify = require('unswearify');
unswearify.loadProfanities('tr_TR'); // Loading profanity data
unswearify.loadProfanitiesFromFile('/path/to/profanity/array.json'); // Loading profanity data
unswearify.addProfanity("badword") // Add badword to the list
//////////////////
unswearify.isProfanity('badword', 0.9); // Check if word is listed as badword and set custom threshold (optional default is 0.7)
// true
unswearify.getScore('badword'); // Returns calculated similarity of the word
// between 0 to 1
unswearify.findProfanities('This is a badword!'); // Returns array of profanities in a sentence
// [ { word: 'f*ck', score: 0.7416666666666667 } ]