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

Swear Words filter seems to be overmatching #3

Closed
Sitzilla opened this issue Mar 1, 2017 · 1 comment
Closed

Swear Words filter seems to be overmatching #3

Sitzilla opened this issue Mar 1, 2017 · 1 comment

Comments

@Sitzilla
Copy link
Contributor

Sitzilla commented Mar 1, 2017

There seems to be an issue with the swear words filter overmatching. Words that I have found that are counted as swear words include: ("me", "and", "an")

Example:
ExudeData.getInstance().getSwearWords("crap this is me and my friend");
image

@Sitzilla
Copy link
Contributor Author

Sitzilla commented Mar 2, 2017

Discovered this is because the isValidWord method checks if the String of swear words contains the word passed in. So for example "as" will return as a swear word because it is contained in "asshole".

It seems to me the solution is to tokenize the string of bad words (ex. "...,asholes,ass,ass monkey,..." becomes [..., "asshole", "ass", "ass monkey", ...]), iterate over each one and check for equality.

@uttesh I'll make a fork, make this change, and open a pull request on it

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

2 participants