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

bug: Custom Dictionaries Uppercased fails to match #41

Closed
CyTechNomad opened this issue Nov 23, 2022 · 1 comment
Closed

bug: Custom Dictionaries Uppercased fails to match #41

CyTechNomad opened this issue Nov 23, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@CyTechNomad
Copy link

Describe the bug

We use a custom dictionary for other things I was hoping to use the same dictionary here. The issue is this dictionary is all upper case. I'm not in a position to change the dictionary used everywhere else so I'm needing this library to Lower the dictionary word as it runs

What do you see?

ran with the following input list words := []string{"FUCK", "ass", "POOP", "penis", "bitch"}
and this custom Dictionary WithCustomDictionary([]string{"FUCK", "ASS", "POOP", "PENIS", "BITCH"}, DefaultFalsePositives, DefaultFalseNegatives)
im getting the following output
Expected true, got false from word FUCK
Expected true, got false from word ass
Expected true, got false from word POOP
Expected true, got false from word penis
Expected true, got false from word bitch

What do you expect to see?

I expeted it to pass the test in all cases

List the steps that must be taken to reproduce this issue

  1. use custom dictionary containing uppercase words
  2. Run the test

Version

latest

Additional information

I have a functional fork that i would like to bring in where i am ToLower the dictionary words as they come through the Extract profanity function

@CyTechNomad CyTechNomad added the bug Something isn't working label Nov 23, 2022
@TwiN
Copy link
Owner

TwiN commented Jan 16, 2023

I've just made it clear in b8dfd2b, but to keep it short, all custom dictionaries are expected to be pre-lowercased.

@TwiN TwiN closed this as completed Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants