I agree with you completely, and the messages can be moderated, but the
client wanted something basic to filter out any obscene words.
Statements such as the one you mention I would leave to the moderator to
remove, if neccersary providing an explanation as to why.
Anyway, thanks for your response.
Will
-----Original Message-----
From: Mark Warrick [mailto:[EMAIL PROTECTED]]
Sent: 06 June 2001 14:07
To: CF-Talk
Subject: RE: profanity checker(again)
I would need your database of word to test my theory here, but I think what
I would do is figure out what the actual length of the word being checked
vs. the profane section of the word. So in other words, if you know that
the word to be evaluated is "Saturday", then that would be more characters
than "turd" and in this case you would skip the evaluation of the word.
Of course, humans always find ways to trick systems like this. So the best
practice if you feel that there will be undesireable text on your message
board is to simply moderate the messages.
Beyond that, you'd need to have a pretty hardcore language program to really
do this right. Not only would you need to evaluate each word in a sentence,
but you would also have to evaluate the context of each sentence.
For example, the statement, "All white people are bad should be killed."
wouldn't be caught by your script, but wouldn't you consider that to be
profane?
---mark
------------------------------------
Mark Warrick - Fusioneers.com
Email: [EMAIL PROTECTED]
Phone: 714-547-5386
http://www.fusioneers.com
http://www.warrick.net
====================================
> -----Original Message-----
> From: Will Swain [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 06, 2001 5:56 AM
> To: CF-Talk
> Subject: profanity checker(again)
>
>
> Hi all,
>
> I emailed the list regarding this a few weeks ago, but an interesting
> problem has now come up.
>
> I have some code that pulls a list of profanities from a db table, then
> checks them against a form feild submitted by a user. Any words that match
> are asterisked out. All well and good. But, when someone entered Saturday,
> the code returned Sa****ay!! Yers, turd is in the database! What I want to
> know is this. How would I look at changing this so that whilst
> turd would be
> picked up and returned as ****, saturday is not??
>
> Any ideas? Code is below.
>
> TIA
>
> Will
>
> <cfset bodytext = Form.thread_body>
>
> <cfset titletext = Form.thread_title>
>
> <!--- Pull out all the bad words from the database --->
>
> <cfquery name="getprofanities" datasource="#APPLICATION.chatdsn#">
> SELECT ID, badword, rate1
> FROM tbl_profanity
> </cfquery>
>
> <!--- Loop over the profanity list and compare with words in the
> bodytext --->
>
> <cfloop query="getprofanities">
>
> <cfset bodytext = ReplaceNoCase(bodytext,
> "#getprofanities.badword#",
> "#getprofanities.rate1#", "ALL")>
>
> <cfset titletext = ReplaceNoCase(titletext,
> "#getprofanities.badword#",
> "#getprofanities.rate1#", "ALL")>
>
> </cfloop>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists