Skip to content

Characters with visual similarities to those in a censored word are censored #47

@caoimhebyrne

Description

@caoimhebyrne

I don't really know how to describe the issue, so I will write some example code, and then explain what I think should be changed.

void main() {
    try (final CuredString curedString = new CuredString("cloor")) {
        curedString.censor("door", '*');

        System.out.println("Cured String: " + curedString); // *****
    }
}

In this example, we are censoring an input string (cloor) if it contains the term door. Decancer assumes that cl has a similar visual identity to d (which is not incorrect), and censors the string.

This behavior is fine, but it is not controllable. Some users of the library may not want to censor a string if some characters have similar visual identity to another.

My proposed solution would be to allow this behavior to be controlled so that it can be disabled. This would only apply to alphabetic characters, though. I think censoring when a number or some other weird character is in the string is perfectly fine behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions