profanity

Profanity Filter using a Regular Expression (list of 100 words)

北城以北 提交于 2019-11-30 09:59:04
What is the correct way to strip profane words from a string given: 1) I have a list of 100 words to look for in an array of strings. 2) What is the correct way to handle partial words? How do most people handle this? For example the word mass. Then sometimes a partial word is also bad - assume foobar is an extremely profane word I may want to disallow foobar and foobar* and *foobar. So do you put all the words into a single expression or loop through the list? What's the right way to tackle it? I'm using Groovy/Grails but any modern languages examples welcome. This is quite a difficult

Profanity Filter using a Regular Expression (list of 100 words)

自古美人都是妖i 提交于 2019-11-29 15:32:02
问题 What is the correct way to strip profane words from a string given: 1) I have a list of 100 words to look for in an array of strings. 2) What is the correct way to handle partial words? How do most people handle this? For example the word mass. Then sometimes a partial word is also bad - assume foobar is an extremely profane word I may want to disallow foobar and foobar* and *foobar. So do you put all the words into a single expression or loop through the list? What's the right way to tackle

What’s a good Python profanity filter library? [closed]

天涯浪子 提交于 2019-11-28 20:56:40
问题 Like https://stackoverflow.com/questions/1521646/best-profanity-filter, but for Python — and I’m looking for libraries I can run and control myself locally, as opposed to web services. (And whilst it’s always great to hear your fundamental objections of principle to profanity filtering, I’m not specifically looking for them here. I know profanity filtering can’t pick up every hurtful thing being said. I know swearing, in the grand scheme of things, isn’t a particularly big issue. I know you

Regular expression preg_quote symbols are not detected

邮差的信 提交于 2019-11-27 10:24:00
I have a dictionary of swear words in the database, and the following works great preg_match_all("/\b".$f."(?:ing|er|es|s)?\b/si",$t,$m,PREG_SET_ORDER); $t is the input text and simply, $f = preg_quote("punk") ; "punk" is from the database dictionary, so at this point in the loop the expression is as follows preg_match_all("/\bpunk(?:ing|er|es|s)?\b/si",$t,$m,PREG_SET_ORDER); preg_quote replaces symbols eg. # with \\# so that the expression is escaped, but when the dictionary is checking eg. "F@CK" or "A$$" these symbols are not detected in the input string with the above expression, I have

“bad words” filter [closed]

与世无争的帅哥 提交于 2019-11-26 18:13:00
Not very technical, but... I have to implement a bad words filter in a new site we are developing. So I need a "good" bad words list to feed my db with... any hint / direction? Looking around with google I found this one, and it's a start, but nothing more. Yes, I know that this kind of filters are easily escaped... but the client will is the client will !!! :-) The site will have to filter out both english and italian words, but for italian I can ask my colleagues to help me with a community-built list of "parolacce" :-) - an email will do. Thanks for any help. I didn't see any language

Regular expression preg_quote symbols are not detected

让人想犯罪 __ 提交于 2019-11-26 15:09:40
问题 I have a dictionary of swear words in the database, and the following works great preg_match_all("/\b".$f."(?:ing|er|es|s)?\b/si",$t,$m,PREG_SET_ORDER); $t is the input text and simply, $f = preg_quote("punk") ; "punk" is from the database dictionary, so at this point in the loop the expression is as follows preg_match_all("/\bpunk(?:ing|er|es|s)?\b/si",$t,$m,PREG_SET_ORDER); preg_quote replaces symbols eg. # with \\# so that the expression is escaped, but when the dictionary is checking eg.

“bad words” filter [closed]

守給你的承諾、 提交于 2019-11-26 06:15:02
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Not very technical, but... I have to implement a bad words filter in a new site we are developing. So I need a \"good\" bad words list to feed my db with... any hint / direction? Looking around with google I found this one, and it\'s a start, but nothing more. Yes, I know that this kind of filters are easily