Python profanity filter
Project description
Dictionary Profanity Filter
Python module for profanity filtering using dictionaries. It supports English and Russian languages out-of-the-box.
Requirements
- Python 3.5 or higher
How to install
Use the following command to install the package using pip:
pip install dictionary-profanity-filter
How to use
Here are several examples of the module usage:
- Creating ProfanityFilter instance:
from dictionary_profanity_filter import ProfanityFilter
profanity_filter = ProfanityFilter()
- Adding custom words to censor:
profanity_filter.add_words(['censorship', 'blocking'])
profanity_filter.censor('I hate censorship and blocking!')
# Output: 'I hate ********** and ********!'
- Detect bad words in the text:
profanity_filter.is_clean('Porn is a restricted word')
# Output: False
- Removing word from custom dictionary:
profanity_filter.remove_word('blocking')
profanity_filter.censor('I hate censorship and blocking!')
# Output: 'I hate ********** and blocking!'
TODO
- Write documentation
- Write tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for dictionary_profanity_filter-1.0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 019c8e80080e426e605034d99a5c778d85f850d3bf566af2185d6db8f097c71b |
|
MD5 | 964ac5c3465f52346338896507b4504b |
|
BLAKE2b-256 | a5d62d63495159ad2dc22a1e847dfc78e1cb616c046701128804447d3b88102a |