Profanity filter

How could I filter textfields that contain profanity?

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

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.)

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

does this help?

1 Like

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

Works on all preliminary tests. :+1:

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.

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

here’s the list:

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:

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

1 Like

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.