Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

asyncee/python-obscene-words-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python obscene words filter.


Python 2.7 pypi MIT License


This is ultra simple words filter, based on regular expressions. It is built on regular expressions, with Russian language support out of the box.

Before using in production, you should test it, because there are no swear words filter in the world that does well filtering, so the quality is not 100%. But test coverage is :)

Also it can eat CPU.

Quickstart

Sample code:

from obscene_words_filter.default import get_default_filter

f = get_default_filter()

Or:

from obscene_words_filter import conf
from obscene_words_filter.words_filter import ObsceneWordsFilter

f = ObsceneWordsFilter(conf.bad_words_re, conf.good_words_re)

Then you can mask use input:

f.mask_bad_words("Тут должны быть матерные слова.")
>>> Тут должны быть ******** *****.

Documentation

Just read the tests :)

About

Dead simple swear words filter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages