Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Bad word censor in Java/AspectJ

Name: Anonymous 2009-01-20 5:41

Hey /prog/ can you help me out with this?

I am trying to make a filter for bad words using java/aspectj. Whenever a method has a System.out.println which includes a bad word I want it to be replaced with an equal amount of #s. For example System.out.println("You are a damn shiteater") should print out "You are a #### ####eater". All bad words are stored as strings on a list which I can access with getBadWords(). It shouldn't be case-sensitive either. I am really stuck with this one so I hope you can help.

Name: Anonymous 2009-01-20 6:09

All word censors are bad. Period. There is no room for debate. I will show you why.

Without being overly restrictive, you can't stop the bad words from showing up. And even if you are overly restrictive and run punishing routines, most users will try to find a way to break it.

Let me provide a couple examples:

The shit on the window is ass. Okay, so you can replace those quite easily. But what about "thes hit on the window"? Remove spaces? Okay, that only reduces a fair subset of English.

What about "the_sh_it_on_the_window"? Remove all non-letter characters? Hoo boy, you're on a rocket ship to stardom now. We'll ignore that it affects a bunch of completely innocent text for a second.

You have a routine that's case-insensitive, removes all spaces, removes all non-letters, what could possibly go wrong? People will start using things like sh*t, sh#t, whatever. So you'll still have to have a dictionary the size of ... oh, I don't know, the Library of Congress? AND THEN even if you had that, they could still use newlines.

It's not worth it and you're an idiot for thinking it is. It doesn't provide a barrier by any means for those that wish to really communicate their feelings through vulgarities, but it WILL intercept innocent conversation.

That will piss your users off more than anything else, because they don't see it as being a difficult programming problem when they get owned by it. All they see is, "What I said was perfectly innocent, what the hell is wrong with this software?"

It's simple, Timmy. The idiot that coded it thought that he could turn something as fluid as language into something as mechanical as code.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List