good swear word filter?

L

Lord Merlin

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).
 
J

Jeff Cochran

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top