Do you mean rude words or words you shouldn't use (like REQUEST)? ;) -- Andy McKay. ----- Original Message ----- From: "Ben Ocean" <zope@thewebsons.com> To: <zope@zope.org> Sent: Friday, February 16, 2001 10:28 AM Subject: [Zope] Dirty Word Filter
Hi; Has anyone developed a Zope dirty word filter? TIA, BenO
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
At 10:38 AM 2/16/2001 -0800, you wrote:
Do you mean rude words or words you shouldn't use (like REQUEST)? ;)
Good point! How about both? BenO
-- Andy McKay.
----- Original Message ----- From: "Ben Ocean" <zope@thewebsons.com> To: <zope@zope.org> Sent: Friday, February 16, 2001 10:28 AM Subject: [Zope] Dirty Word Filter
Hi; Has anyone developed a Zope dirty word filter? TIA, BenO
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Ben Ocean] | Has anyone developed a Zope dirty word filter? How do you define filter? And how would you use it? F ex when displaying content? Or when adding content? For ZCatalog searches there is a stop-word list, I don't know too much about it, but for searches, that could be used I guess (albeit, it is a very ugly solution). Maybe (untested!): aString = 'you <dirty word1> bastard!' DirtyWords = [<dirty word1>, <dirty word2>] for word in string.split(aString, ' '): if word in DirtyWords: aString = string.replace(aString, word, '*bleep*') I guess that would work. If you combine that, with soundex and ZCatalog you could get a nice filter. Create it as a python module in the Extensions/ directory and let everything you want to check have a run through that script first.
At 08:44 PM 2/16/2001 +0100, you wrote:
[Ben Ocean]
| Has anyone developed a Zope dirty word filter?
How do you define filter? And how would you use it? F ex when displaying content? Or when adding content?
I'm thinking of when someone adds to a job or classifieds board or some other means of posting, such as SquishDot. BenO
For ZCatalog searches there is a stop-word list, I don't know too much about it, but for searches, that could be used I guess (albeit, it is a very ugly solution).
Maybe (untested!):
aString = 'you <dirty word1> bastard!' DirtyWords = [<dirty word1>, <dirty word2>]
for word in string.split(aString, ' '): if word in DirtyWords: aString = string.replace(aString, word, '*bleep*')
I guess that would work. If you combine that, with soundex and ZCatalog you could get a nice filter.
Create it as a python module in the Extensions/ directory and let everything you want to check have a run through that script first.
[Ben Ocean] | I'm thinking of when someone adds to a job or classifieds board or | some other means of posting, such as SquishDot. Then use the code-snippet I provided in the other mail on the text before you add it.
participants (3)
-
Andy McKay -
Ben Ocean -
Erik Enge