473,473 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

good swear word filter?

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).
Jul 19 '05 #1
1 2274
On Mon, 5 Jul 2004 22:22:56 +0200, "Lord Merlin"
<SP*************@bonzai.org.za_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


Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Case Nelson | last post by:
Hi there I've just been playing around with some python code and I've got a fun little optimization problem I could use some help with. Basically, the program needs to take in a random list of no...
3
by: Charles Hartman | last post by:
I'm working on text-handling programs that want plain-text files as input. It's fine to tell users to feed the programs with plain-text only, but not all users know what this means, even after you...
59
by: seberino | last post by:
I've heard 2 people complain that word 'global' is confusing. Perhaps 'modulescope' or 'module' would be better? Am I the first peope to have thought of this and suggested it? Is this a...
11
by: name | last post by:
Here is a first attempt at a line/word wrapping utility. Seems to work okay, but lacks some checking stuff, etc. --------------------------------------------------------- #include <stdio.h>...
2
by: Darren Clark | last post by:
I am currently developing a site that will have a members sectin where data can be posted... Nothing huge there.. My question is, what are some methods that i can use that will stop swear words...
3
by: bay_dar | last post by:
Hi my dirty word filter function has a problem, it is over restrictive. For instance the word "analysis" is ok, but the word "anal" is not. Any advice? code below: Public Function...
30
by: ljungers | last post by:
Anyone have an idea how I can filter a report that I'm outputting to Word. Using the following 2 Command to print and output to word. The strWhere is a list of selected items/rows to print, and...
4
by: Andreas Beyer | last post by:
Hi, I found the following quite cryptic code, which basically reads the first column of some_file into a set. In Python I am used to seeing much more verbose/explicit code. However, the example...
4
by: xhe | last post by:
I need to create a website and I want to filter out filthy words or swear words. To my surprise, it is difficult to find such a list from google. So if you have that list, can you please share...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.