Skip to content

use damerau-levenshtein distance instead of direct comparison#370

Closed
gsayson wants to merge 1 commit into
Java-Discord:mainfrom
gsayson:main
Closed

use damerau-levenshtein distance instead of direct comparison#370
gsayson wants to merge 1 commit into
Java-Discord:mainfrom
gsayson:main

Conversation

@gsayson

@gsayson gsayson commented Dec 1, 2022

Copy link
Copy Markdown

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".

@gsayson gsayson requested a review from a team as a code owner December 1, 2022 07:16
@gsayson gsayson marked this pull request as draft December 1, 2022 08:09
@jasonlessenich

Copy link
Copy Markdown
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

@danthe1st

Copy link
Copy Markdown
Member

Note that for censoring, reading/reacting to automod logs would be more effective (if we ever plan to do that).

@jasonlessenich

Copy link
Copy Markdown
Member

Yeah, but we don't want to censor stuff. And we never will

@jasonlessenich

Copy link
Copy Markdown
Member

The only thing we ever did was "Glyph", "Deveden" and "Coda", but that was just for fun to annoy big rat :^)

@liquiddevelopmentnet

Copy link
Copy Markdown
Member

Pull request of the year

@jasonlessenich

Copy link
Copy Markdown
Member

Closed due to inactivity

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

Successfully merging this pull request may close these issues.

4 participants