Skip to content

docs: add Replacements-stripping recipe + example for digit false positives - #56

Open
jollycurv-e wants to merge 1 commit into
finnbear:mainfrom
jollycurv-e:add-leetspeak-replacements-recipe
Open

docs: add Replacements-stripping recipe + example for digit false positives#56
jollycurv-e wants to merge 1 commit into
finnbear:mainfrom
jollycurv-e:add-leetspeak-replacements-recipe

Conversation

@jollycurv-e

Copy link
Copy Markdown

Hi, I'm jollycurv-e, I run ForestBot. I've been using rustrict as the censorship backend and ended up with this solution to a false positive on one of the commands. Figured it was worth sending upstream.

What

Adds a documented recipe (README) + runnable example (examples/leetspeak_replacements.rs) for removing
specific digit-to-letter mappings from the default Replacements table, for cases where digit-heavy text
(zip codes, numeric IDs, prices) is decoding into flagged words via leetspeak-style substitution.

Why

No code changes to the crate itself. This is purely additive documentation/example, using the existing
public Replacements::customize_default() API. Motivated by a real production false positive: a chat bot
feature let users look up gas prices by zip code, and the zip codes themselves were getting flagged via
digit-substitution decoding (e.g. 9g, 0o).

Testing

examples/leetspeak_replacements.rs builds and runs clean locally:

cargo run --example leetspeak_replacements --features customize

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.

1 participant