Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > good swear word filter?

Reply
Thread Tools

good swear word filter?

 
 
Lord Merlin
Guest
Posts: n/a
 
      07-05-2004
Can someone please help me with a good swearword filter, or assist me with
my current one?


This is the code I have currently, but it doesn't always work. I can do the
same test, with the same word 4/5/6/7 times in a row, and sometimes it
works, sometimes not.


================================================== ==========
arrcheck(0) = "god"
arrcheck(1) = "jesus"
arrcheck(2) = "fart"
..................
...................
arrcheck(72) = "arse"
arrcheck(73) = "crap"


strsubject = " " & GetFormData("strsubject") & " "
incident = " " & GetFormData("incident") & " "
solution = " " & GetFormData("solution") & " "


'--------SWEAR FILTER-----------------
For Each tWord in arrCheck
tWord=UCASE(tWord)
strsubject = Replace(strsubject," " & tWord & " "," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "."," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "!"," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "?"," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "-"," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & ","," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "_"," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "/"," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "&"," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "@"," *** ",1,-1,1)
strsubject = Replace(strsubject," " & tWord & "@"," *** ",1,-1,1)
Next
For Each tWord in arrCheck
tWord=UCASE(tWord)
incident = Replace(incident," " & tWord & " "," *** ",1,-1,1)
incident = Replace(incident," " & tWord & "."," *** ",1,-1,1)
incident = Replace(incident," " & tWord & "!"," *** ",1,-1,1)
incident = Replace(incident," " & tWord & "?"," *** ",1,-1,1)
incident = Replace(incident," " & tWord & "-"," *** ",1,-1,1)
incident = Replace(incident," " & tWord & ","," *** ",1,-1,1)
incident = Replace(incident," " & tWord & "_"," *** ",1,-1,1)
incident = Replace(incident," " & tWord & "/"," *** ",1,-1,1)
incident = Replace(incident," " & tWord & "&"," *** ",1,-1,1)
incident = Replace(incident," " & tWord & "@"," *** ",1,-1,1)
Next
For Each tWord in arrCheck
tWord=UCASE(tWord)
solution = Replace(solution," " & tWord & " "," *** ",1,-1,1)
solution = Replace(solution," " & tWord & "."," *** ",1,-1,1)
solution = Replace(solution," " & tWord & "!"," *** ",1,-1,1)
solution = Replace(solution," " & tWord & "?"," *** ",1,-1,1)
solution = Replace(solution," " & tWord & "-"," *** ",1,-1,1)
solution = Replace(solution," " & tWord & ","," *** ",1,-1,1)
solution = Replace(solution," " & tWord & "_"," *** ",1,-1,1)
solution = Replace(solution," " & tWord & "/"," *** ",1,-1,1)
solution = Replace(solution," " & tWord & "&"," *** ",1,-1,1)
solution = Replace(solution," " & tWord & "@"," *** ",1,-1,1)
Next

'/--------SWEAR FILTER-----------------

strsubject = Trim(strsubject )
incident = Trim(incident )
solution = Trim(solution )



================================================== ==========

your help in this matter will be greatly appreciated
--


Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).


 
Reply With Quote
 
 
 
 
Jeff Cochran
Guest
Posts: n/a
 
      07-06-2004
On Mon, 5 Jul 2004 22:22:56 +0200, "Lord Merlin"
<(E-Mail Removed)_SPAM> wrote:

>Can someone please help me with a good swearword filter, or assist me with
>my current one?
>
>
>This is the code I have currently, but it doesn't always work. I can do the
>same test, with the same word 4/5/6/7 times in a row, and sometimes it
>works, sometimes not.


Perhaps if we had an idea of what "sometimes works" actually meant in
terms of input, output, expected results, received results, error
messages and so on...

Jeff


>================================================= ===========
> arrcheck(0) = "god"
> arrcheck(1) = "jesus"
> arrcheck(2) = "fart"
>.................
>..................
> arrcheck(72) = "arse"
> arrcheck(73) = "crap"
>
>
> strsubject = " " & GetFormData("strsubject") & " "
> incident = " " & GetFormData("incident") & " "
> solution = " " & GetFormData("solution") & " "
>
>
> '--------SWEAR FILTER-----------------
> For Each tWord in arrCheck
> tWord=UCASE(tWord)
> strsubject = Replace(strsubject," " & tWord & " "," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "."," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "!"," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "?"," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "-"," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & ","," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "_"," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "/"," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "&"," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "@"," *** ",1,-1,1)
> strsubject = Replace(strsubject," " & tWord & "@"," *** ",1,-1,1)
> Next
> For Each tWord in arrCheck
> tWord=UCASE(tWord)
> incident = Replace(incident," " & tWord & " "," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & "."," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & "!"," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & "?"," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & "-"," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & ","," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & "_"," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & "/"," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & "&"," *** ",1,-1,1)
> incident = Replace(incident," " & tWord & "@"," *** ",1,-1,1)
> Next
> For Each tWord in arrCheck
> tWord=UCASE(tWord)
> solution = Replace(solution," " & tWord & " "," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & "."," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & "!"," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & "?"," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & "-"," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & ","," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & "_"," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & "/"," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & "&"," *** ",1,-1,1)
> solution = Replace(solution," " & tWord & "@"," *** ",1,-1,1)
> Next
>
> '/--------SWEAR FILTER-----------------
>
> strsubject = Trim(strsubject )
> incident = Trim(incident )
> solution = Trim(solution )
>
>
>
>================================================= ===========
>
>your help in this matter will be greatly appreciated


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you swear in a ghost? richard Computer Support 1 04-15-2010 10:32 PM
Make Moeny Fast_I swear this is no joke_Read inside! L@cky Computer Support 1 04-27-2009 06:14 AM
Bud swear jar pcbutts1 Computer Support 1 12-15-2007 06:09 AM
Advise for filtering out swear words..... Darren Clark ASP .Net 2 09-07-2004 02:48 AM
How do I identify word<html><html>other word? Laura Perl 1 06-04-2004 11:32 PM



Advertisments