dictionary profanity filter
1.0.0
使用字典進行褻瀆過濾的Python模塊。它支持開箱即用的英語和俄羅斯語言。
使用以下命令使用PIP安裝軟件包:
pip install dictionary-profanity-filter以下是模塊使用情況的幾個示例:
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!'