0.0.9 • Published 9 months ago

wtf-wordfilter v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

What The Filter

A lightweight profanity detection tool.

How it works:

  • Detects profanity and slurs in standard text, and hidden through the use of "l33tspeak" and character separation.
    • badword
    • b4dw0rd
    • .b.4.d.w.0.r.d.

How to use it:

  • Install the package by typing the following command into the terminal:
npm i wtf-wordfilter
  • Import the package by adding the following line to the top of your file:
const { detectProfanity } = require("wtf-wordfilter");
  • Use the filter by adding the string you want to test as a parameter:
// Returns true if string contains profanity, otherwise false.
const result = detectProfanity("badword");

console.log(result) // true
  • That's it!

Caveats:

No filter is perfect. Adding more bad words to the filter will trigger it to catch more clean words. The pre-added words being filtered against are ones that are most likely to cause harm to a site. This maintains a good balance between the removal of bad words while keeping the majority of clean words.

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago