use damerau-levenshtein distance instead of direct comparison#370
Closed
gsayson wants to merge 1 commit into
Closed
use damerau-levenshtein distance instead of direct comparison#370gsayson wants to merge 1 commit into
gsayson wants to merge 1 commit into
Conversation
Member
|
Hey, this is actually pretty cool, but I don't know if we really want something like this as we actually don't want to censor "fuck" by itself. The current implementation is more like a joke, which one can bypass easily If we decide to do this, this behaviour should be controllable using the /preferences command imo |
Member
|
Note that for censoring, reading/reacting to automod logs would be more effective (if we ever plan to do that). |
Member
|
Yeah, but we don't want to censor stuff. And we never will |
Member
|
The only thing we ever did was "Glyph", "Deveden" and "Coda", but that was just for fun to annoy big rat :^) |
Member
|
Pull request of the year |
Member
|
Closed due to inactivity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the original implementation of
HugListener, a simple equality check was used. This resulted in plenty of easy bypasses such as "fug" and "fck".This PR improves the detection mechanism such that instead of an equality check being used, a similarity check is used to identify some bypasses through the Damerau-Levenshtein algorithm.
Given a string, the algorithm measures the number of transpositions, substitutions, insertions, or deletions, of a character in order to match the string
"fuck".