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!'