How could I filter textfields that contain profanity?
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.
I’ll try that out and let you know. Thanks, dean.
Works on all preliminary tests.
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. also, add
.toLowerCase() to the test so your list can be all lowercase.
Wow that’s incredible how fast it is, perfect
would you mind sharing the list you found?
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?
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.