byebyeswear

1.3.7 • Public • Published

CityLeeks-Swearword-Detector

Russian swearword detection and filtering library for CityLeeks.

Build Status Coverage Status

Installation

npm install --save cl-swearword-detector

Usage

detector.profane(text)

Returns true if the given string contains profanity.

var detector = require('cl-swearword-detector');
detector.profane("я люблю тебя, Гавана"); // false
detector.profane("я люблю тебя, сука"); // true

detector.censor(text)

Replaces profanity with *.

var clean = detector.censor("я люблю тебя, сука"); // я люблю тебя, ****

detector.loadBadWords(path)

Loads a dictionary of words to be used as filter.

detector.loadBadWords("../dicts/swearwords.json");

A dictionary is just a array.

[
	"word1",
	"word2",
	"word3"
]

Package Sidebar

Install

npm i byebyeswear

Weekly Downloads

3

Version

1.3.7

License

The MIT License (MIT)

Unpacked Size

59.7 kB

Total Files

5

Last publish

Collaborators

  • codefoxy-npm