dictionary profanity filter
1.0.0
Modul Python untuk penyaringan kata -kata kotor menggunakan kamus. Ini mendukung bahasa Inggris dan Rusia di luar kotak.
Gunakan perintah berikut untuk menginstal paket menggunakan PIP:
pip install dictionary-profanity-filterBerikut adalah beberapa contoh penggunaan modul:
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!'