Wordfilter issue

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

tpenn
Posts: 95
Joined: 03 Aug 2010, 18:48

Wordfilter issue

Postby tpenn » 17 Feb 2011, 20:43

I'm having an issue with the word filter. I'm on RC-1b, with the filter set to Blacklist.

I received a massive list of words to filter from my publisher and am seeing some issues. An example will be the easiest way to illustrate. I'll use some of the...less offensive words for this.

The words I've been asked to filter include these: fart, farted, farts, farting, and farthead.

I add them to the wordsFile.txt, following the pattern established in the provided sample file. Thus, I end up with regular expressions looking like (?i:fart), (?i:farted), etc. to do case insensitive searches for these words.

Testing it out, I get some strange results.

Sending "fart" outputs ****. Good so far.
"farted" outputs ****ed. Looks like it took that first match and quit.
"farts" outputs *****. I had expected ****s based on the last one, but was surprised.
"farting" outputs *******. Again, it found the best match.
"farthead" outputs ****head. And now back to only matching "fart".

It's the inconsistency that surprises me. Now, I know I can make the expression for "fart" only look for a whole word and solve some of my issues. But unless I'm missing something, this felt like a bug, so I thought I had better make a report.
tpenn
Posts: 95
Joined: 03 Aug 2010, 18:48

Postby tpenn » 22 Feb 2011, 15:10

Any comment?
bryanadams

Re: Wordfilter issue

Postby bryanadams » 05 Jun 2012, 11:01

Hi,
i have same problem
my wordfiles.text below
(?i:mother)

but when i write motherboard it's changes ******board, i want to apply onlt a word "mother" for example "mother going to schooll" it can be "**** going to schooll"
but motherboard must not ****board ,
Help pls
thanks
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Wordfilter issue

Postby Lapo » 06 Jun 2012, 07:59

The WordFilter in SFS2X is based on regular expressions so you can be quite advanced with the string matching.
I would recommend to check some basic websites in order to learn about regular expressions and experiment a bit with them.

Take a look here for example:
http://www.regular-expressions.info/reference.html
http://www.zytrax.com/tech/web/regex.htm
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 148 guests