1.1.1 • Published 4 years ago

bad-word-ar v1.1.1

Weekly downloads
7
License
ISC
Repository
github
Last release
4 years ago

bad-word-ar

A more relaxed javascript filter for badwords.

Installation

npm install bad-word-ar

Usage

var Filter = require('bad-word-ar'),
  filter = new Filter('ar');

console.log(filter.clean("الله يلعنك")); 
//الله *****

check

var Filter = require('bad-word-ar'),
  filter = new Filter('ar');

console.log(filter.check("يلعن ابوك")); 
//true

console.log(filter.check("مرحبا بك")); 
//false

check

var Filter = require('bad-word-ar'),
  filter = new Filter('ar');

console.log(filter.count("الله يلعنك")); 
//1

console.log(filter.check("مرحبا بك")); 
//0

Filter

Filter constructor.

Parameters

  • list array Instantiate filter with custom list

isProfaneLike

Determine if a single word is profane or looks profane.

Parameters

  • word string String to evaluate for profanity.
replaceWord

Replace a word with placeHolder characters;

Parameters

  • string string String to replace.
clean

Evaluate a string for profanity and return an edited version.

Parameters

  • string string Sentence to filter.
count

Count a string for profanity and return the count.

Parameters

  • string string Sentence to filter.
check

Check a string for profanity and return an Boolean value.

Parameters

  • string string Sentence to filter.