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

Case sensitivity #11

Closed
bbuehrle opened this issue May 12, 2020 · 8 comments · Fixed by bbuehrle/mattermost-plugin-profanity-filter#1 or #12
Closed

Case sensitivity #11

bbuehrle opened this issue May 12, 2020 · 8 comments · Fixed by bbuehrle/mattermost-plugin-profanity-filter#1 or #12
Assignees
Labels
Difficulty/1:Easy Easy ticket Good First Issue Suitable for first-time contributors Help Wanted Community help wanted Tech/Go

Comments

@bbuehrle
Copy link
Contributor

Is there a flag to set that would ignore case-sensitivity? The filter censors f*** but leaves F*** alone.

@hanzei hanzei added Difficulty/1:Easy Easy ticket Good First Issue Suitable for first-time contributors Help Wanted Community help wanted Tech/Go Up For Grabs Ready for help from the community. Removed when someone volunteers labels May 13, 2020
@hanzei
Copy link
Contributor

hanzei commented May 13, 2020

Good suggestion @bbuehrle 👍

@bbuehrle
Copy link
Contributor Author

I've never used Go before and I couldn't even get it to build. From what I can tell, maybe...

func (p *Plugin) OnActivate() error {
	p.badWords = make(map[string]bool, len(badWords))
	for _, word := range badWords {
/** make sure all words in array are lower case */
                word := string.ToLower(word)
		p.badWords[word] = true
	}

	return nil
}
func (p *Plugin) WordIsBad(word string) bool {
/** make sure word to be compared is lower case */
        word := string.ToLower(word)
	_, ok := p.badWords[word]
	return ok
}

Would something like this work?

@hanzei
Copy link
Contributor

hanzei commented May 14, 2020

Yes, that would work 👍

@hanzei hanzei removed the Up For Grabs Ready for help from the community. Removed when someone volunteers label May 14, 2020
@hanzei hanzei linked a pull request May 16, 2020 that will close this issue
@hanzei
Copy link
Contributor

hanzei commented May 16, 2020

Let's keep this open until #12 is merged

@hanzei hanzei reopened this May 16, 2020
@bbuehrle
Copy link
Contributor Author

Good deal. Do you know when that may be?

@hanzei
Copy link
Contributor

hanzei commented May 17, 2020

Your PR is awaiting review from @iomodo, but once that is done, we can merge it.

@bbuehrle
Copy link
Contributor Author

Thanks, @hanzei. Do you know when the next release will be? Looks like the last one was 18 months ago.

@hanzei
Copy link
Contributor

hanzei commented May 18, 2020

I'm not sure @bbuehrle. But if you really want that new version, you can just build it yourself from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty/1:Easy Easy ticket Good First Issue Suitable for first-time contributors Help Wanted Community help wanted Tech/Go
Projects
None yet
2 participants