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 9:14

>>36

Give me one application where it would be practical to hardcode every possible bad word and censor bypass.  Get over it; just because you can write "Hello World" in five different languages doesn't mean you know anything about REAL programming.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-20 9:15

>>41
Chat,Forums,Instant messaging

_________________________
orbis terrarum delenda est

Name: Anonymous 2009-01-20 9:18

>>42

Yes, hire someone to hardcore trillions of combinations.  If you weren't a tripfag I'd think I was being trolled hard.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-20 9:20

>>43
Thats the point of regular expressions it allows to define combinations which would in their expanded form take terabytes of space. Its concise syntax to express every combination which fits the expression terms.

_________________________
orbis terrarum delenda est

Name: Anonymous 2009-01-20 9:20

>>41
Oh hai, would you be interested in a GreaseMonkey script to make all of FrozenVirgin's posts invisible? It definatelly would make your stay at /prog/ more enjoyable.

http://dis.4chan.org/read/prog/1231209853/10

Name: Anonymous 2009-01-20 9:24

>>43
YABTH.

Name: Anonymous 2009-01-20 9:25

>>45
I can only promote this script. Without FaggotVoid's posts I don't have to rage everytime I browse /prog/.

Name: Anonymous 2009-01-20 15:11

>>34
Fuck.
Fuuuuuck.
FFFFFFFuck.
Fck.
Fk.
Fuk.
Fuc.
F*ck.
Fu*k.
Fu_ck.
F_uck.
Phuck.
Phuk.
Phuc. (lol azn naem)
F|_|ck.
F|__|ck.
F|_|k.
F|_|c.
Fu©k.

And so on and so forth. Okay, now give us a regex expression that works for all of these. Also, all other bad words.

Name: Anonymous 2009-01-20 15:15

>>48
You better run that fsck.

Name: Anonymous 2009-01-20 15:34

>>49
Yes, thank you. I don't normally consider it because I think it's retarded, but that would be an additional form.

Also, "fuck" has a rare distinction of not being a part of normal conversation. Ever. Even with spaces. Most other bad words are not so lucky.

Name: Anonymous 2009-01-20 21:54

OP here.
Thanks for the help. I made a working word filter which takes in a string and prints it out with the bad words changed to #'s. Any idea on how to use an aspect in aspectj to intercept the system.out.println's in the other classes so I can use the filter on them?

Name: Anonymous 2009-01-20 22:31

Don't forget all the fun you can have with right-to-left override and zero width spaces if you allow Unicode.

Name: Anonymous 2009-01-20 23:25

OP again.
Well I got it all figured out and it works great (the word filter + aspect). Thanks again for all the help.

Name: Anonymous 2009-01-21 2:06

I do believe FrozenVoid has been backed into a corner by his own stupidity. I would say "score 1 for /prog/", but as long as FrozenVoid posts as a name/tripfag, /prog/ is a big 0.

Name: Anonymous 2009-01-21 3:58

>>54
ONLY GAYS SEE HIS POSTS!

Name: Anonymous 2009-01-21 4:29

HOW IS IT EVEN REMOTELY POSSIBLE,
IN THIS DAY AND AGE
THAT PEOPLE ARE STILL SEEING FROZEN'S POSTS?
HOW IS THIS POSSIBLE?

Name: Anonymous 2009-01-21 4:43

>>57
whose posts? all i see is "Name: Anonymous"...
well, except for that idiot >>56. his posts show up as "Name: Spammer" with no text in them.

Name: Anonymous 2009-01-21 4:45

>>58
fuck. wrong blee.

Name: Anonymous 2009-01-21 4:47

>>8
This reminds me of the time when /b/ invaded this heavily censored Barbie-chat that used whitelists. Even digits and single letters were censored.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 5:00

>>48
the regexp is:
/\bf{1,7}\|{0,1}_{0,2}\|{0,1}[u\*]{0,5}_{0,1}[kc\*©]{0,1}[kc]\b|\bphu[kc]{0,1}[kc]\b/gi



_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: Anonymous 2009-01-21 5:03

>>61
I LOL'ED SO HARD

Name: Anonymous 2009-01-21 5:18

>>45,47,54
Why?
He seems to know what he's talking about.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 5:19

>>62
If you want to filter text,you'll have to use such regexps.
I admit it looks complex at first glance but its only using num_of_chars{min,max} which is trivial to understand.

_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 5:29

>>48 same as >>61 but with groups(less readable but more logical):

/\b(f|ph){1,7}(\|_{1,2}\|{0,5}|[u\*_]{0,5})[kc\*©]{0,2}\b/gi


_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 5:38

>>65 That should be :
/\b(f{1,7}|ph{1,7})(\|_{1,2}\|{0,5}|[u\*_]{0,5})[kc\*©]{0,2}\b/gi

_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 5:41

>>66 Optimized:
 {0,5} can be ommited(the 1337 u is only with one final \|)

/\b(f{1,7}|ph{1,7})(\|_{1,2}\||[u\*_]{0,5})[kc\*©]{0,2}\b/gi
_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 5:44

>>67
Further optimized(assuming final consonant is always present):
/\b(f{1,7}|ph{1,7})(\|_{1,2}\||[u\*_]{0,5})[kc\*©]{1,2}\b/gi

_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 6:05

Also,i find it ironic that alot of you hate censorship but use the script which hides my posts.

_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: Anonymous 2009-01-21 6:13

No replies, huh?

Name: Anonymous 2009-01-21 6:46

I find it funny that your regex does not match any from the simple sample he provided you (which would be one billionth of what you would actually have to test for).

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 6:50

>>71
This is a JavaScript regexp,perhaps you are using another language?

_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 6:53

In the case you are not using JavaScript,type into address bar:
javascript:alert((/\b(f{1,7}|ph{1,7})(\|_{1,2}\||[u\*_]{0,5})[kc\*©]{1,2}\b/gi).test('abc.f_uck.tst')) ;void 0
should return true(regexp matches).

_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: Anonymous 2009-01-21 7:02

>>73
javascript:alert((/\b(f{1,7}|ph{1,7})(\|_{1,2}\||[u\*_]{0,5})[kc\*©]{1,2}\b/gi).test('fuuukcc')) ;void 0

javascript:alert((/\b(f{1,7}|ph{1,7})(\|_{1,2}\||[u\*_]{0,5})[kc\*©]{1,2}\b/gi).test('fsck')) ;void 0

You lose.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 7:09

>>74
These words are not present at >>48
which is replied by >>61

_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: Anonymous 2009-01-21 7:11

>>75
Go back to Slashdot

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-21 7:14

>>74
I can invent any words which will not trigger regexp designed for >>48 like "ifhawifuheasiufh" but this doesn't make it invalid.
It works exactly as designed.

_________________________
orbis terrarum delenda est
 http://xs135.xs.to/xs135/09042/av922.jpg

Name: Anonymous 2009-01-21 8:42

>>77
Go back to Slashdot

Name: Anonymous 2009-01-21 12:05

☣ Please try to ignore troll posts! ☣

http://userscripts.org/scripts/show/40415

Name: Anonymous 2009-01-21 15:14

>>79
☣ Please try to troll ignore posts! ☣

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