Skip to main content
GameDev.net gamedev.net
🔒 Locked

&#$*@%$# Profanity Filtering

Started by Telamon Aug 2, 2006 at 10:25 AM 30 replies 7k views
Original Post
Telamon
Telamon
Our online kids game has recently started to pick up a good number of users and yesterday we got our first email from a mother complaining about some profanity used in the in-game chat. I feel like this is a milestone of some sort, but now we need to do something about it. An obvious first pass would store a dictionary of dirty words in a hashtable and strikeout matching words in the chat text (possibly a word at a time, or possibly using a "sliding window") However, this makes it easy to get around the filter by adding spurious letters ect. Recognizing that there is no way to analyze chat strings for meaning, what is the best approach to solving this problem?
dave
dave
The best profinaty excluders i have seen appear to use the lookup table method, only they use entries in the table that are twists on the common words, like:

phuck
$hit

etc

Dave
Ra
Ra
The best thing you can do is probably run some regular expressions over the chat to clean up profanity and common letter substitutions, "[s5\$]h[i1!]t" for example.

If you plan on implementing any form of censor be sure to keep it client-side and optional, of course.
Ra
CTar
CTar
You might be able to check the levenshtein distance from a word entered and the words in your table. Of course you would also have the try to combine small words, so people can't type "s h i t", "shi t", etc. You also need to make sure normal words won't get filtered (maybe you should also have an always allowed table for words which is to close to "forbidden" words, hit should for instance be in that one so it won't be mistaken for shit by the algorithm).
BrianL
BrianL
I'd go with the simple table route as well. As soon as you throw in foreign languages + evolving slang + ability to type words in creative ways is a massive problem to take on.

An additional possibility is to give people a way to 'suggest' new words to add to the filter. You could then review the list and add words as you see fit (assuming you can put out patches, etc). In addition to filtering blatant profanity, this would give put the burden of making the filter more comprehensive on the users. It would also give frustrated players an outlet for them to combat the problem.
Paradigm Shifter
Paradigm Shifter
Make sure that you allow Scunthorpe (town in the UK), unlike some email filters.
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
Yvanhoe
Yvanhoe
don't fgreot taht meessd up wrods are radelbae as long as the first and last letters are correct and all the letters are present :-)

Fukcing, btich and such are easily understandable and can be tricky to catch
Ultimape
Ultimape
Quote:
Original post by Yvanhoe
don't fgreot taht meessd up wrods are radelbae as long as the first and last letters are correct and all the letters are present :-)

Fukcing, btich and such are easily understandable and can be tricky to catch


"taht is idened vrey intnritseeg, but uopn fheturr ietiignsatovn by me, it was dcisreeovd taht tihs olny wkors wehn the wdros uesd are eeecxtpd by the rdeear, or snoud salmiir to the oiioanrgl wrods dtpsiee ctaaechrr rrrgnneiaag. As you'll ntcioe you wree ublnae to ilmtdmaieey rgcznioee smoe of the wdros I uesd in my rlpey bsucaee tehy wree upctnxeeed, aglhtuoh I am qtuie pstvsiioe it is not bsacuee you wluod not rczngioee tehm nlrloamy." - http://www.albinoblacksheep.com/text/order.php


Yvanhoe
Yvanhoe
Quote:
Original post by Ultimape
"taht is idened vrey intnritseeg, but uopn fheturr ietiignsatovn by me, it was dcisreeovd taht tihs olny wkors wehn the wdros uesd are eeecxtpd by the rdeear.


Agreed. This is not a golden rule but as the precedent posts were just pointing out the ways to circumvent sub$titutions. Levenshtein distance may help, but I wanted to point out that letters scrambling can be used in this goal too.

Some have pointed that it may be easier to use a white list, the problem is, many of the young folks you want to protect often have very random grammr skilz.

Maybe an automatic spellchecker could make this possible ?

But remember : a true and efficient system of censorship to "protect" children is very hard, if not impossible, to make. Its true clients are parents who need to think that a software will be able to protect their kids without them behind their back.

If you are really interested in protecting children from abusive behaviors, make a simple filter for profanity as a facade and put efforts in the detection of predator behaviors. These often use correct grammar, few profanity, contact lots of different children, and ask them specific questions, including their location in real life. Plus, they probably will spend more time on the chat than on the game. This is the real danger, don't get to worked on profanity. Kids will eventually learn from their schoolmates what a dick or an anal probe is. Thing is, they better learn this from other kids than from single lonely pedophile old men.

Yvanhoe
Yvanhoe
Quote:
Original post by Anonymous Poster
Aren't Internet Predators just an urban legend? A mass hysteria?


Well I started making a few searches to prove my point, as I think I know this is a valid concern. And from what I see on US websites, this IS a mass hysteria! I mean, in my opinion, maybe a hundred children a year are "predated" via internet, which is enough to raise concern when you run a kid-targeted website, but US media claim that 20% of children are offered sexual propositions via internet. Further debunking lower this stat to 3% which still seems a hell lot for me.

So I would say, yes there is a mass-hysteria but no, this is not a urban legend. Just an issue which has been over-hyped by medias. Definitely an issue of concern if I was to run a kid-targeted website.
LorenzoGatti
LorenzoGatti
I don't think allowing users to add censored words is safe; griefers would submit common words.
You could manually inspect lists of candidate bad words to blacklist or whitelist, coming from
a) user submissions
b) automatic searching chat transcripts for words that are similar to existing censored words.

Omae Wa Mou Shindeiru
Extrarius
Extrarius
One thing that might help would be a very simple client-side trick: When somebody types a banned word, don't filter it on their side. This way, you see whatever you type, and unless you're talking with a friend via another medium (voice chat, etc), you're not likely to even know you're being filtered so people won't try to get around the filter (and won't know without help or multiple accounts whether they were successfull).
Then, instead of removing the word for other people, simply replace with with a random unlikely-to-ever-be-inappropriate word. For added humor, select words like "fluffy", "shiny", "pretty", "clown", "flower" etc

As for the method to use, I would use a three-table approach: First is a table of character transformations that turns "$" into "S", "@" into "a" etc; Second is a table that performs letter-group replacements in an attempt to account for typos, misspellings, etc; Third is a list of banned words.

Using the first two tables, you can generate a list of possibilities for each word, and you can then check the dictionary to see if the word is present or not.

You might want to employ phonetic algorithms, such as Double Metaphone, as another dictionary to detect misspellings that allow the same or similar pronunciation.

A more fullproof method would be to simply have a 'white list' instead of a 'blacklist' - a filter based on allowing only specific words. If you can find a fairly complete wordlist, you can combine it with a name list based on census data and then the only thing missing is fictional names / places / etc that you can add manually as desired.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Steadtler
Steadtler
Here is my suggestion:

Start with a "hard" list. Every word on that list is censored. If a word is "close" to a word on the hardlist, log it off somewhere and look at the log once in a week to add new words to the list.

Dont go too nazi on the filter; people (especially kids) will always find a way to go around it anyway.
johnhattan
johnhattan
Went to a conference on chat issues, starring some industry heavy hitters who had online games (specifically ESPN and Disney). Their conclusion was that there are only two things that are foolproof for keeping chat clean for kids. . .

1. Moderators to approve everything
2. Canned chat (i.e. You have a combobox with canned phrases rather than an edit field).

Disney actually used canned chat to their advantage. In their online games, one of the rewards was to give users more canned phrases as a reward.
(my byline from the Gamedev Collection series, which I co-edited) John Hattan has been working steadily in the casual game-space since the TRS-80 days and professionally since 1990. After seeing his small-format games turned down for what turned out to be Tandy's last PC release, he took them independent, eventually releasing them as several discount game-packs through a couple of publishers. The packs are actually
Telamon
Telamon
I'm going to do the straight word list approach. I have been looking around for a dirty word list to use as a black list, but it's been surprisingly difficult to find one on the internet (I have one now with maybe 500 words). A word list meant for filtering (i.e. with common misspellings and leetspeak) would be nice.

Actually I think I will have a separate filter for leetspeak, which when triggered will send your character to the n00b server.
Ultimape
Ultimape
http://www.georgecarlin.com/dirty/2443.html

George carlin's 2443 dirty words!

might be useful ;)
JBourrie
JBourrie
Note: This post does not answer your question, but it does give you something to think about.


A game that I worked on (E rated) had a profanity filter that was a huge .txt file full of the "words you cannot say"... "dirtywords.txt". Open up this file and you'll learn every possible way to 1337speek the word "fuck".

Tiger Woods Golf, Grand Theft Auto: San Andreas and Elder Scrolls: Oblivion have all been reprimanded for data that was "hidden" on the disc that was not submitted to the ESRB.

The ESA have now said there is something like an $11,000 fine per-unit-sold if any hidden "graphic" content is found again. It's probably a good idea to encrypt these dirty words files to make sure no kid puts it in their PC and finds it, then shows it to mommy.

Thats all. Now back to our regularly scheduled censoring. :)
johnhattan
johnhattan
Quote:
Original post by JBourrie
Note: This post does not answer your question, but it does give you something to think about.


A game that I worked on (E rated) had a profanity filter that was a huge .txt file full of the "words you cannot say"... "dirtywords.txt". Open up this file and you'll learn every possible way to 1337speek the word "fuck".
You wouldn't still have that file, would you? That'd save some work.

(my byline from the Gamedev Collection series, which I co-edited) John Hattan has been working steadily in the casual game-space since the TRS-80 days and professionally since 1990. After seeing his small-format games turned down for what turned out to be Tandy's last PC release, he took them independent, eventually releasing them as several discount game-packs through a couple of publishers. The packs are actually
Zorak
Zorak
If the parent think it is inappropiate, tell her to take the kid of the game. Fact is that the censors do nothing but upset people. Either that, or you could just have a button that disables chat all together, with a password protection that the mother sets.

The words is really a small problem and quite useless to put any energy into to trying to stop. There are far worse problems to attend to with the chatfunctions of games.

I've played a over-average number of mmorpgs since 1997 and the "problem" with dirty words seem rather trivial when you compare it to the acctual content of the chats. I can't even count the number of discussions that have been inappropiate or the rising number of people that I have heard about that have been fooled into webcam chats where their tops or whatnot have been off. The last couple of years that problem have been rising alot, if i listen to what people in different guilds etc say.

So instead of worrying over what words are being used, parents should be more worried about whats acctually being said inbetween the words.

And on top of that, all filters i have seen in all games i have played have been extremly annoying, not because you cannot type bad words, but because they filter the wrong words, mess up chats or lines simply disappear.
Domine non secundum peccata nostra facias nobis

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.