dictionary profanity filter
1.0.0
Python module for profanity filtering using dictionaries. It supports English and Russian languages out-of-the-box.
Use the following command to install the package using pip:
pip install dictionary-profanity-filterHere are several examples of the module usage:
from dictionary_profanity_filter import ProfanityFilter
profanity_filter = ProfanityFilter()profanity_filter.add_words(['censorship', 'blocking'])
profanity_filter.censor('I hate censorship and blocking!')
# Output: 'I hate ********** and ********!'profanity_filter.is_clean('Porn is a restricted word')
# Output: Falseprofanity_filter.remove_word('blocking')
profanity_filter.censor('I hate censorship and blocking!')
# Output: 'I hate ********** and blocking!'