Last active
August 13, 2018 12:48
-
-
Save josephrocca/5a71e62591b444d683cfebcca44e9f54 to your computer and use it in GitHub Desktop.
npm bad-word-relaxed false positives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==== 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