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 Distribution
Built Distribution
Close
Hashes for dictionary-profanity-filter-1.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d141c5fddec6f210a6ce0467207a9b8d89f5ee4b5c58eb64560636fa1c6fc63 |
|
MD5 | d4b46a2a90288a289d7327db80139620 |
|
BLAKE2b-256 | bf7a44418f1488b3ed32b79207866b055ca4fc25b5696475735cee9283453b90 |
Close
Hashes for dictionary_profanity_filter-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39a70111196ba43a52d64db352c332a8ebde78683d2ede4e9beabe7579811924 |
|
MD5 | 6750c6c491154f408cec495379026021 |
|
BLAKE2b-256 | 29fd7fad034c5043fa747232bde5244a586d0053a6f84abd4bcdf8aaa13f198d |