fix: mask values wrapped in quotes (v2.6.6)#39
Merged
Conversation
Names, rank+PIB and IPNs inside «...», "...", „...“ were skipped because
words stuck to quote chars ('«Петренко', 'сержант»') and only ,.!?;: was
stripped. Now quotes are stripped during recognition and normalized to
spaces in normalize_string. Quotes stay in place; roundtrip preserved.
+17 tests (tests/test_quoted.py).
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.
Quoted values were not masked
Names, rank+PIB and IPNs wrapped in quotes (
«Петренко Іван Сергійович»,сержант "Коваленко Марія Іванівна") were silently skipped: words stuck to the quote characters («Петренко,сержант»), and recognition only stripped,.!?;:— never quotes.Fix
looks_like_name,is_pib_anchor,is_likely_surname_by_case, and PIB/rank token extraction inparse_hybrid_line.normalize_stringmaps all quote styles («» „“” "" '' ‟) to spaces so ranks inside quotes are found.Note: a bare rank without a following PIB is still not masked — that's pre-existing behavior (avoids false positives on the word «сержант» in prose) and is independent of quotes.
Test plan
tests/test_quoted.py: masking, quote preservation, roundtrip, no-leak, parity with unquoted)https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7
Generated by Claude Code