Jump to content
  • Advertisement
Sign in to follow this  
Nice Coder

Swear filter

This topic is 4858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, i'm writing a replacement for X3 (for my own channells, in other servers, ect.) ok, as one of the extra things i want it to do, it should do swear checking. For eg. "F****" or "F**K" or "F6CK" or "FCK" shuold all trigger the filter. The problem i'm having, is how to set it up? Does anybody have any ideas on how i should do it? From, Nice coder

Share this post


Link to post
Share on other sites
Advertisement
Yes.

Also, if it was just tacked onto another word.

Pretty much, any case where another user could take offence. (through bad language. like F!CK, ect.)

From,
Nice coder

Share this post


Link to post
Share on other sites
Regular expressions are a good place to start. Then you'll have to build substitution tables. Good luck.

Share this post


Link to post
Share on other sites
fsck is an unix tool. Now, you're annoying users by preventing them from saying useful stuff.

If you don't mind annoying users, a very simple solution is to mark all words as swear words.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fruny
Regular expressions are a good place to start. Then you'll have to build substitution tables. Good luck.


Unfortunatly my regex (vbscript 5.0) decided that any message that included the letter K is a swear word. This is from a single entry 'F*K'.

From,
Nice coder

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
fsck is an unix tool. Now, you're annoying users by preventing them from saying useful stuff.

If you don't mind annoying users, a very simple solution is to mark all words as swear words.


!

Thats a little extreame.

From,
Nice coder

Share this post


Link to post
Share on other sites
I suggest you read up on 'fuzzy matching'.

But as ToohrVyk pointed out, the hard part will be the tweaking. Set up your filter too sensitive and you annoy people by having normal language trigger your filter.
However a too restricitve setup will allow people to trick your filter by simple substitutions.

Just an afterthought: you can probably never make this perfect. Imagine someone talking about his new-born kittens, should the word 'pussy' be considered swearing or not? Am I being offensive talking about the prick of a needle? What about guys named Peter?

Share this post


Link to post
Share on other sites
Quote:
Original post by Nice Coder
Quote:
Original post by Fruny
Regular expressions are a good place to start. Then you'll have to build substitution tables. Good luck.


Unfortunatly my regex (vbscript 5.0) decided that any message that included the letter K is a swear word. This is from a single entry 'F*K'.

From,
Nice coder


That's because your regular expression is wrong. F*K means, match 0 or more occurances of F, followed by K.

I think F[^K]*K might be what you're looking for.

Quote:
Original post by DaBono
Just an afterthought: you can probably never make this perfect. Imagine someone talking about his new-born kittens, should the word 'pussy' be considered swearing or not? Am I being offensive talking about the prick of a needle? What about guys named Peter?


To be fair though, those aren't really extreme swearwords. A swear filter is really just to catch the worst of it. Even with the best swear filter in the world, there's nothing to stop users coming up with euphemisms.

Share this post


Link to post
Share on other sites
I feel what you're trying to do is going to give you more trouble than results.

I've been in chat rooms with filters and it allways seems pointless. Instead of a good old F**K U i'de see extremely colorful remarks about each other's mothers including some vegetables and farm animals. I'de see people use several ways of avoiding the filters, by including spaces between the letters, dashes, color codes, text format codes(bold, italic, underline, ...), other letters, reversing the swear word, using the so famous l33t sp34k, you name it.

Although you could probably figure out all of these yourself and add them to the filter, the fact his that after checking for all those words, eventually a few innocent words would end up being included in the filter and really annoy everyone.

I wouldn't like to be in your place, good luck though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!