docs: add Replacements-stripping recipe + example for digit false positives - #56
Open
jollycurv-e wants to merge 1 commit into
Open
docs: add Replacements-stripping recipe + example for digit false positives#56jollycurv-e wants to merge 1 commit into
jollycurv-e wants to merge 1 commit into
Conversation
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.
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 removingspecific digit-to-letter mappings from the default
Replacementstable, 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 botfeature let users look up gas prices by zip code, and the zip codes themselves were getting flagged via
digit-substitution decoding (e.g.
9→g,0→o).Testing
examples/leetspeak_replacements.rsbuilds and runs clean locally: