How to apply profanity filter
As an example I take the following list of words
testdata = WordData[All, "Verb"] // Select[#, StringContainsQ[#, "fu"] &] &
{"befuddle", "be full", "bifurcate", "blow a fuse", "centrifugate", "centrifuge", "circumfuse", "coiffure", "confuse", "confute", "defuse", "desulfurize", "diffuse", "effuse", "fuck", "fuck off", "fuck up", "fuddle", "fudge", "fudge together", "fuel", "fulfill", "fulfill", "full", "fullback", "fulminate", "fumble", "fume", "fumigate", "function", "fund", "fund-raise", "fund raise", "fundraise", "funk", "funnel", "furbish", "furbish up", "furcate", "furl", "furlough", "furnish", "furrow", "further", "fuse", "fusillade", "fuss", "fustigate", "get a noseful", "give full measure", "infuriate", "infuscate", "infuse", "make full", "make fun", "malfunction", "misfunction", "obfuscate", "perfume", "perfuse", "poke fun", "refuel", "refund", "refurbish", "refurnish", "refuse", "refute", "snafu", "suffuse", "sulfur", "sulfurette", "transfuse", "travel purposefully", "trifurcate", "ultracentrifuge", "unfurl"}
and use the build-in classifier function "Profanity"
to obfuscate bad language (you could just filter out words too)
Clear@profanityFilter
profanityFilter[word_] := StringReplace[word, {_ :>
RandomChoice[{"&", "#", "!", "%", "@", "$", "^", "%", "*"}]}]
/; Classify[ "Profanity", word]
profanityFilter[word_] := word
Now you can apply the filter to individual words or map it to a list of words to make your language squeaky clean:)
profanityFilter /@ testdata
{"befuddle", "be full", "bifurcate", "blow a fuse", "centrifugate", "centrifuge", "circumfuse", "coiffure", "confuse", "confute", "defuse", "desulfurize", "diffuse", "effuse", "%*!^", "&%#^&^%!", "%!!%!%!", "fuddle", "fudge", "fudge together", "fuel", "fulfil", "fulfill", "full", "fullback", "fulminate", "fumble", "fume", "fumigate", "function", "fund", "fund-raise", "fund raise", "fundraise", "funk", "funnel", "furbish", "furbish up", "furcate", "furl", "furlough", "furnish", "furrow", "further", "fuse", "fusillade", "fuss", "fustigate", "get a noseful", "give full measure", "infuriate", "infuscate", "infuse", "make full", "make fun", "malfunction", "misfunction", "obfuscate", "perfume", "perfuse", "poke fun", "refuel", "refund", "refurbish", "refurnish", "refuse", "refute", "snafu", "suffuse", "sulfur", "sulfurette", "transfuse", "travel purposefully", "trifurcate", "ultracentrifuge", "unfurl"}
From here:
newWordData = Complement[WordData[], Import["https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/en", "List"]];