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