Skip to main content

Obscene words filter for python, built on regexp for Russian language.

Project description

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 from the box.

It may work with your language too (if you will write your own regular expressions).

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 :)

Quickstart

Sample code:

from obscene_word_filter.default import get_default_filter

f = get_default_filter()

Or:

from obscene_word_filter import conf
from obscene_word_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 :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-obscene-words-filter-0.1.5.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file python-obscene-words-filter-0.1.5.tar.gz.

File metadata

File hashes

Hashes for python-obscene-words-filter-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ab3a5b992d04e00c0de2580c2d63217299a34072d95b5f434043e1c190c1603f
MD5 77d2c18244fea7162f2008d57b14069b
BLAKE2b-256 da85b965cdc0622c9b082ec38927ad96d1e7e8f2bbf1439310d0d65df6bceb42

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page