vzhou842 / profanity-check

A fast, robust Python library to check for offensive language in strings.
https://pypi.org/project/profanity-check
MIT License
612 stars 113 forks source link

Allow certain words? #31

Closed Codeize closed 2 years ago

Codeize commented 3 years ago

Sometimes the filter can be a tad excessive. I.E: I say damn, the filter is triggered. This should be customizable. Or what I recommend is setting up a 'level based filter' For example.. Level 1 - Low (F#@? gets deleted, and similar, not damn) and then something like Level 3 - Strict (Deletes all profanity, such as damn, sick, etc.)

BradKML commented 3 years ago

Because this library is model-based and does not rely on a wordlist? https://github.com/vzhou842/profanity-check#no-explicit-blacklist

API-Troubles commented 3 years ago

It could just check a list given and see if a word is on there. If its there then it will bypass all filters and it will be cleared.

BradKML commented 3 years ago

@FelixGao-discord "Model-Based" means that the library compresses the wordlist into a more generalized and fuzzy format using sub-patterns, and the process is irreversible. The only way to do what @Codeize said is something like having multiple wordlists of different strengths and multiple corresponding models to tune down its sensitivity.