Profanity filter


#1

How could I filter textfields that contain profanity?


#2

Hi !
I guess you have looked for profanity detector libraries ?
Or you’re more generally talking ?


#3

I’ve only done searches for profanity filters. I’ll look up libraries.
(I host a site where kids create screen names. Some like to set theirs to something inappropriate.)


#4

I’m interested what you find, it’s on the radar for me, more for flagging on server then client denial however.


#5

does this help? https://try.haxe.org/#DfF87


#6

I’ll try that out and let you know. Thanks, dean.


#7

Works on all preliminary tests. :+1:


#8

I tried it with 5000 words, put my test words at the end of the array and it executed in 0.06 secs. You just need a list of bad words now. :flushed: also, add .toLowerCase() to the test so your list can be all lowercase.


#9

Wow that’s incredible how fast it is, perfect :slight_smile:
would you mind sharing the list you found?


#10

here’s the list: https://github.com/RobertJGabriel/Google-profanity-words/blob/master/list.txt

One think to note, it isn’t perfect. With a word like ‘ass’ in the list, it won’t allow words like ‘class’, ‘Cassy’, etc. See this: https://en.wikipedia.org/wiki/Scunthorpe_problem

Maybe regexp can make it better, and/or make an allowed list to check first?


#11

Yep, this is exactly what I was wanting. Works quickly and I like that it finds profanity that might be embedded into a word. Thank you.