Skip to content
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

Takes subset of a word and flags it as profane like ass in assessment #9

Closed
buzzwin opened this issue Jun 13, 2021 · 3 comments
Closed

Comments

@buzzwin
Copy link

buzzwin commented Jun 13, 2021

Two words that were rejected: practitioner * assessment. Reason? Because they contained letters in a row that named certain body parts, is there a way to prevent this from happening.

@Desync-o-tron
Copy link

This is huge..

@roshanrahman
Copy link
Owner

Hi @buzzwin, thanks for pointing that out. Turns out the getAllProfanity method is poorly written. (Link to the test that it fails)

I'll get it fixed shortly.

In the meantime, if you only want to find if the string contains profanity or not, you can use the hasProfanity() method (it passes the substring test). To get a list of detected profanity, something like this might help:

if(filter.hasProfanity(yourString)) { 
var listOfProfanity = filter.getAllProfanity(yourString);
}

@roshanrahman
Copy link
Owner

Published version 2.0.0 of the package that contains a fix for this.
https://pub.dev/packages/profanity_filter/versions/2.0.0

The test cases all pass, and it should now work correctly. Closing the issue for now.

Feel free to open new issue if you encounter any bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants