Python based unacceptable language filter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Pratt

    #1

    Python based unacceptable language filter

    Hi. Is anyone aware of any python based unacceptable language filter
    code to scan and detect bad language in text from uploads etc.

    Many thanks.
    David
  • Nigel Rowe

    #2
    Re: Python based unacceptable language filter

    David Pratt wrote:
    [color=blue]
    > Hi. Is anyone aware of any python based unacceptable language filter
    > code to scan and detect bad language in text from uploads etc.
    >
    > Many thanks.
    > David[/color]

    You might be able to adapt languagetool.


    Later versions have been ported to Java, but the old python version of
    languagetool is at http://tkltrans.sourceforge.net/#r03

    His thesis paper is at


    Mind you, given the poor language skills of many native english speakers
    (not to mention those for whom english is a second language) relying on
    automated filters to enforce 'good' language seems a trifle extreme. This
    post for example would probably not pass.

    Cheers,
    Nigel

    PS. For the humour impaired, this g*d d*mm post was a f*cking joke, OK! :-)

    Mind you, the links are real.

    --
    Nigel Rowe
    A pox upon the spammers that make me write my address like..
    rho (snail) swiftdsl (stop) com (stop) au

    Comment

    • Frithiof Andreas Jensen

      #3
      Re: Python based unacceptable language filter


      "David Pratt" <fairwinds@east link.ca> wrote in message
      news:mailman.13 57.1128292457.5 09.python-list@python.org ...[color=blue]
      > Hi. Is anyone aware of any python based unacceptable language filter
      > code to scan and detect bad language in text from uploads etc.
      >
      > Many thanks.
      > David[/color]

      Look up Spambayes - if you can filter on terms like "dear friend" you can
      filter on the inverse too, no? It needs samples to work with.


      Comment

      • Andrew Gwozdziewycz

        #4
        Re: Python based unacceptable language filter


        On Oct 2, 2005, at 9:45 PM, Nigel Rowe wrote:
        [color=blue]
        > David Pratt wrote:
        >
        >[color=green]
        >> Hi. Is anyone aware of any python based unacceptable language filter
        >> code to scan and detect bad language in text from uploads etc.
        >>
        >> Many thanks.
        >> David
        >>[/color]
        >
        > You might be able to adapt languagetool.
        > http://www.danielnaber.de/languagetool/features.html
        >
        > Later versions have been ported to Java, but the old python version of
        > languagetool is at http://tkltrans.sourceforge.net/#r03
        >
        > His thesis paper is at
        > http://www.danielnaber.de/languagetool/download/
        > style_and_gramm ar_checker.pdf
        >
        > Mind you, given the poor language skills of many native english
        > speakers
        > (not to mention those for whom english is a second language)
        > relying on
        > automated filters to enforce 'good' language seems a trifle
        > extreme. This
        > post for example would probably not pass.
        >
        > Cheers,
        > Nigel
        >
        > PS. For the humour impaired, this g*d d*mm post was a f*cking joke,
        > OK! :-)
        >
        > Mind you, the links are real.
        >
        > --
        > Nigel Rowe
        > A pox upon the spammers that make me write my address like..
        > rho (snail) swiftdsl (stop) com (stop) au
        > --
        > http://mail.python.org/mailman/listinfo/python-list
        >[/color]



        I think he may be referring to "bad" words, and 'filthy' language. At
        least that's what i got from the question.
        There are many PHP implementations on the web, which could be adapted
        to python fairly easily. Most of which are probably not the most
        ideal solution and
        involve alot of stuff like

        for n in badwords:
        texttofilter.re place(n, '<bad word deleted>')

        If that's all you need though, maybe it's not so bad.


        ---
        Andrew Gwozdziewycz
        apgwoz@gmail.co m




        Comment

        • Erik Max Francis

          #5
          Re: Python based unacceptable language filter

          Andrew Gwozdziewycz wrote:
          [color=blue]
          > I think he may be referring to "bad" words, and 'filthy' language. At
          > least that's what i got from the question.
          > There are many PHP implementations on the web, which could be adapted
          > to python fairly easily. Most of which are probably not the most
          > ideal solution and
          > involve alot of stuff like
          >
          > for n in badwords:
          > texttofilter.re place(n, '<bad word deleted>')
          >
          > If that's all you need though, maybe it's not so bad.[/color]

          This is a no-op, since it replaces the text, but then discards it. You
          meant:

          for badWord in badWords:
          textToFilter = textToFilter.re place(badWord, '<)!&%(#&)%>')

          --
          Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
          San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
          If anything is sacred, the human body is sacred.
          -- Walt Whitman

          Comment

          Working...