473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 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 1984
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.