dictionary profanity filter
1.0.0
사전을 사용한 욕설 필터링을위한 파이썬 모듈. 그것은 영어와 러시아어를 기본적으로 지원합니다.
다음 명령을 사용하여 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!'