Raised This Month: $ Target: $400
 0% 

Replace blacklisted word unless it's a part of whitelisted word - string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 03-08-2014 , 15:53   Replace blacklisted word unless it's a part of whitelisted word - string
Reply With Quote #1

Alright so there's the unapproved Advanced Swear Filter, which apparently should have this feature. It doesn't work properly, so copying its' filtering algorithm is out of question.

What I'm trying to do is filter out curse words from a string, as long as they're not whitelisted.

An example:
I blacklisted shit and whitelisted the word 'doshite' (sorry, couldn't think of anything better)

If the user says "If you want to say why in Japanese, you say doshite.", nothing happens.
If they say "Fuck off dipshit", it turns into "Fuck off dip****".

How would you go about this? I have the blacklisted words stored in Array: blacklist and whitelisted words in Array: whitelist.

I'd also like to completely evade the breaking into single words method, as I'll remove the whitespaces before filtering the string anyway.

Last edited by Backstabnoob; 03-08-2014 at 15:55.
Backstabnoob is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode