dictionary profanity filter
1.0.0
Python -Modul zur Obszönitätsfilterung unter Verwendung von Wörterbüchern. Es unterstützt englische und russische Sprachen außerhalb des Boxs.
Verwenden Sie den folgenden Befehl, um das Paket mit PIP zu installieren:
pip install dictionary-profanity-filterHier sind einige Beispiele für die Modulverwendung:
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: False profanity_filter . remove_word ( 'blocking' )
profanity_filter . censor ( 'I hate censorship and blocking!' )
# Output: 'I hate ********** and blocking!'