-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No Substring Filter? #100
Comments
Did you find a solution or another library that does this? |
Is this really a good idea? |
It would be nice to at least have the option, as certain racial slurs do not really fit into any other words like Shitake :) |
people bypass the filter by doing adding an underscore on the word, or adding an extra r on the n word
|
+1 for adding the option to filter substrings. I'm creating a referral code generator that spits out a random alphanumeric code that the user can send to a friend to get them to sign up. We want to reduce the chances of offensive words sneaking into the randomly-generated string. |
@dodocodes is correct in this regard, however, @brianreavis brings up https://www.wikiwand.com/en/Scunthorpe_problem |
Fair point but for some use cases it can be desired, for example when we are generating random character serial numbers for item labels, we would like to filter any expletives that can be accidentally generated as as substring |
Has anyone found a way to enable a substring filter? As mentioned above it is very useful in some use cases. |
I agree that having the option to apply the filter for words containing bad words is desirable. The exclude list should be used to allow words like "raccoon" and "peacock" to pass without issue. Since developers can manage that list using the "removeWords" feature, it should be fairly straight-forward to implement this option without breaking changes. |
use the following splitRegex to consider _ as a word boundary: |
A slight thought: compound word bounds are good grounds for filtering, inherent words with coincidental substring is not. |
Hopefully I'm missing something or using the package incorrectly but seems like its not finding bad words as substrings..?
The text was updated successfully, but these errors were encountered: