1.0.3 • Published 1 year ago

unswearify v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

unswearify

Image Image

NPM

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 } ]
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago