Skip to content

Instantly share code, notes, and snippets.

@josephrocca
Last active August 13, 2018 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephrocca/5a71e62591b444d683cfebcca44e9f54 to your computer and use it in GitHub Desktop.
Save josephrocca/5a71e62591b444d683cfebcca44e9f54 to your computer and use it in GitHub Desktop.
npm bad-word-relaxed false positives
// ==== NOTES ====
// Seems to have quite a few false matches. Might be worth updating the npm repo to tell
// people that `bad-words` seems to have fixed up its initial problems. It doesn't make
// any false matches in the google-10k list.
// ==== CODE ====
const Filter = require('bad-words-relaxed');
const profanity = new Filter();
const fetch = require('node-fetch');
(async function() {
let words = await fetch("https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english-no-swears.txt").then(r => r.text()).then(text => text.split("\n"))
for(let w of words) {
if( profanity.isProfane(w) ) console.log(w);
}
})()
// ==== OUTPUT ====
// analysis
// space
// popular
// saturday
// population
// assessment
// classes
// advertisement
// participants
// participation
// principal
// participate
// circumstances
// pakistan
// analyst
// municipal
// participating
// popularity
// spaces
// cluster
// dicke
// glasses
// illustrated
// analog
// assess
// shore
// passes
// titten
// reputation
// populations
// sunglasses
// analyses
// offshore
// assessments
// dicks
// participant
// assessed
// packing
// analyze
// myspace
// illustration
// canal
// analytical
// screw
// illustrations
// anticipated
// analysts
// advertisements
// spice
// aerospace
// assessing
// computational
// participated
// basement
// gays
// analyzed
// clusters
// computation
// namespace
// municipality
// endorsement
// cocktail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment