Adapted from Shutterstocks list of Dirty, Naughty, Obscene, and Otherwise Bad Words.
npm install grunt-naughty-wordsAdapted from Shutterstocks list of Dirty, Naughty, Obscene, and Otherwise Bad Words.
This library provides a grunt task for creating an array of profane words, and a regex to test against, as well as the capability to compile your own obscene word list.
npm install grunt-naughty-words ---save-dev
grunt.loadNpmTasks('grunt-naughty-words');
In JavaScript land, include dist/javascript/profanity.js, which will expose a regex on the namespaced scope (or globally if namespace not provided):
App.profanityRegex.test(potentiallyProfaneWord);
You may also build a single one-off file, or one with all languages is provided in the dist directory.
# compile naughty words for English, Italian and German
grunt bad_words:all
Output is found in dist/badwords.js.
| Name | Code |
| ---------------- | ---- |
| Chinese | zh |
| Czech | cs |
| Danish | da |
| Dutch | nl |
| English | en |
| Esperanto | eo |
| Finnish | fi |
| French | fr |
| German | de |
| Hungarian | hu |
| Italian | it |
| Japanese | ja |
| Klingon | tlh |
| Korean | ko |
| Norwegian | no |
| Persian | fa |
| Polish | pl |
| Portuguese | pt |
| Russian | ru |
| Spanish | es |
| Swedish | sv |
| Thai | th |
| Turkish | tr |
Wordlist: © 2012–2015 Shutterstock, Inc.

This work is licensed under a Creative Commons Attribution 4.0 International License.