fix+perf: lettered sub-items, ~10x faster unmask (v2.6.3, v2.6.4)#37
Merged
Conversation
'п. В. Петренко' (clause item B), 'ст. А.', 'абз. Б.' etc. no longer masked as PIB — when a service abbreviation precedes an initials+surname pattern, the leading letter is a clause marker, not a name. Real PIB after ordinary words still masked. Backfill CHANGELOG for 2.6.1/2.6.2. https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7
unmask_other_data scanned the whole text once per mask (O(masks x text)). Now builds one alternation regex (longer masks first) and walks the text once. Per-mask occurrence counter preserves exact instance tracking for collisions. 278KB doc: ~30s -> ~2.8s. Fallback to per-mask scan kept for masks that fail regex compilation. +4 collision/case/substring tests. https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7
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.
Two deferred audit items closed
2.6.3 — false-positive initials
п. В. Петренко(clause item B),ст. А.,абз. Б.,див. п. В.no longer masked as PIBп.,пп.,ч.,ст.,абз.,гл.,розд., …) directly precedes an initials+surname pattern, the leading letter is a clause marker, not a name2.6.4 — unmask performance
unmask_other_datascanned the full text once per mask — O(masks × text)Test plan
https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7
Generated by Claude Code