472,958 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

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
Oct 2 '05 #1
4 1969
David Pratt wrote:
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


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/languageto...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
Oct 3 '05 #2

"David Pratt" <fa*******@eastlink.ca> wrote in message
news:ma*************************************@pytho n.org...
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


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.
Oct 3 '05 #3

On Oct 2, 2005, at 9:45 PM, Nigel Rowe wrote:
David Pratt wrote:

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


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_grammar_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


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.replace(n, '<bad word deleted>')

If that's all you need though, maybe it's not so bad.
---
Andrew Gwozdziewycz
ap****@gmail.com
http://ihadagreatview.org
http://plasticandroid.org
Oct 3 '05 #4
Andrew Gwozdziewycz wrote:
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.replace(n, '<bad word deleted>')

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


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

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

--
Erik Max Francis && ma*@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
Oct 3 '05 #5

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

Similar topics

0
by: Irmen de Jong | last post by:
QOTW: "I'll claim without proof that how mixed-type comparisons work with Python classes is also beyond wizard prediction in all cases: the implementation of comparison in Python is crushingly...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
49
by: Ville Vainio | last post by:
I don't know if you have seen this before, but here goes: http://text.userlinux.com/white_paper.html There is a jab at Python, though, mentioning that Ruby is more "refined". -- Ville...
0
by: Emile van Sebille | last post by:
QOTW (advanced interfaces track): "I'm firmly in favour of any language that can DWIMNWIS." -- Tim Delaney QOTW (MS roadkill track): "Underestimate MS at your own risk. It is one thing to not...
68
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
9
by: Alex | last post by:
I'm looking at a tutorial with the code below from wxPython.wx import * class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, "winApp", size = (800,640)) frame.Show(true)...
34
by: Ville Voipio | last post by:
I would need to make some high-reliability software running on Linux in an embedded system. Performance (or lack of it) is not an issue, reliability is. The piece of software is rather simple,...
267
by: Xah Lee | last post by:
Python, Lambda, and Guido van Rossum Xah Lee, 2006-05-05 In this post, i'd like to deconstruct one of Guido's recent blog about lambda in Python. In Guido's blog written in 2006-02-10 at...
15
by: Lorenzo Stella | last post by:
Hi all, I haven't experienced functional programming very much, but now I'm trying to learn Haskell and I've learned that: 1) in functional programming LISTS are fundmental; 2) any "cycle" in FP...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.