Possible Duplicate:
“bad words” filter
In my web application i have a section which gets input from the user and posting it on the main page.
i would like to prevent post in dirty language.
Is there any research about it or a library in php that detects most of the curses and dirty expressions in English.
shortly speaking i would like to test the input in that manner;
if the input in the set of the unwanted patterns
dob't publish it
else
publish it on the main wall
Honestly? There’s no reliable way to programatically censor a post. If someone from Scunthorpe was to post about their recent trip to the town of Effin and how much they love to listen to the music of Jarvis Cocker whilst giving their Shitzu a groom then that’s probably going to trigger any swear filter you implement. What’s more, if you leave a word off your list it will get through.
You could use some sort of filter to flag posts for review by a human moderator, but depending on an entirely automated process isn’t going to work.