feat: add composable profanity language profiles#163
Merged
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.
Summary
profile,filter,dictionary, andcreateFilterexports.Validation
npm cinpm run checknpm run benchmark:profanityBenchmark Evidence
Baseline
origin/main:createProfanityFilter(): 8.2377 avg mscheck long clean: 4.5381 avg mscensor short match: 0.0342 avg msThis branch:
createProfanityFilter(): 7.3197 avg mscheck long clean: 4.3273 avg mscensor short match: 0.0350 avg msNew profile paths on this branch:
composeProfanityProfiles([ru, en]): 0.0010 avg msmultilingual check match: 0.0037 avg msmultilingual scanner scan: 0.0568 avg msLegacy hot paths remained within same-machine run variance, while profile composition reuses ready-to-use filters instead of recompiling dictionaries.
Compatibility Notes
filter, positionalcreateProfanityFilter(strict, loose), dictionary factories, English long-name exports, and scanner contract names remain available.createCustomProfanityFilter({ strict, loose })andcomposeProfanityProfiles()are additive; the ambiguous factory alias remains as a deprecated compatibility export.Closes #162
No publish, no merge, no tag/release.