good swear word filter?

Discussion in 'ASP General' started by Lord Merlin, Jul 5, 2004.

  1. Lord Merlin

    Lord Merlin Guest

    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).
     
    Lord Merlin, Jul 5, 2004
    #1
    1. Advertising

  2. Lord Merlin

    Jeff Cochran Guest

    On Mon, 5 Jul 2004 22:22:56 +0200, "Lord Merlin"
    <_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
     
    Jeff Cochran, Jul 6, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laura
    Replies:
    1
    Views:
    549
    Gunnar Hjalmarsson
    Jun 5, 2004
  2. Stephen Witter

    opening a word doc in word not browser

    Stephen Witter, May 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    504
    Stephen Witter
    May 18, 2004
  3. Darren Clark

    Advise for filtering out swear words.....

    Darren Clark, Sep 7, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    392
    Lucas Tam
    Sep 7, 2004
  4. Replies:
    3
    Views:
    1,652
    Bruce Barker
    Mar 20, 2006
  5. zax75
    Replies:
    1
    Views:
    1,123
Loading...

Share This Page