Read halfwidth corner brackets as a nickname delimiter (#597) - #599
Merged
Merged
Conversation
The halfwidth corner brackets 「」 (U+FF62/U+FF63), the only corner brackets JIS X 0201 data has, were not a default nickname pair, so a clause they enclose stayed in the name as a middle, brackets and all. Since #594 that also cost the name its order: the unclassified bracket kept 山田 「タロー」 タロウ from being wholly East Asian script, so it read given 山田. DEFAULT_NICKNAME_DELIMITERS gains ("「", "」") beside 「」, and the v1 facade's nickname_delimiters gains the matching halfwidth_corner_brackets key, so HumanName reads them as parse() does. The pair is not script-gated: John 「Jack」 Smith reads nickname Jack, as John 「Jack」 Smith does. Nothing else needs a halfwidth twin. Three fix(#597) case rows, run through both APIs; with the facade key removed, the facade rows and test_snapshot_field_translation fail. fix(#597) ledger rules at every baseline (no corpus line held the brackets before; the three rows are the whole population), rules.md N1 example and history link, a new decisions.md#N1 entry, modules.rst, AGENTS.md's sentinel bullet, and the release log. Closes #597. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The release log and a case note blamed the bracket for every release's given-first reading of 山田 「タロー」 タロウ; in released versions the unclassified halfwidth kana did that, and the bracket became the blocker only after #594. The order moves with #594 and #597 together, and the prose says so. - "Kept as a middle" holds for the spaced rows only: 山田「タロー」太郎 was one given word. decisions.md#N1 and the five ledger comments now say which. - A v1 Constants restored from a pickle keeps its saved keys and does not gain the pair, the policy #273's pairs followed; decisions.md and the release bullet now say so. - Two _config_shim comments called every non-v1 pair #273's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #599 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 45 45
Lines 4235 4235
=======================================
Hits 4192 4192
Misses 43 43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
The full-width corner brackets
「」have been a default nickname pair since #273, but their halfwidth forms「」(U+FF62/U+FF63) were not. Those halfwidth forms are the only corner brackets legacy JIS X 0201 data has. So a clause enclosed in them stayed in the name, brackets and all.Fix.
DEFAULT_NICKNAME_DELIMITERSgains("「", "」"), and the v1 facade'snickname_delimitersgains the keyhalfwidth_corner_brackets, soHumanNamereads the pair the same wayparse()does.山田 「タロー」 タロウ山田, middle「タロー」山田, givenタロウ, nicknameタロー山田「タロー」太郎山田, given太郎, nicknameタローJohn 「Jack」 Smith「Jack」JackThe order change in the first row comes from #594 and this PR together. #594 (halfwidth katakana) is unreleased, in the same cycle. Released versions read that name given-first because the halfwidth kana were unclassified. After #594 alone, the unclassified bracket was the only thing still stopping the name from reading as Japanese.
What's not covered:
Constantsrestored from a pickle keeps the keys it was saved with, so it doesn't gain the new pair. That's the same policy Support smart quotes (“Jack”), guillemets («Petit»), and CJK brackets as nickname delimiters #273's pairs followed.『』or of the fullwidth parentheses, so nothing else needs a halfwidth twin.Verification
fix(#597)case rows, run through bothparse()andHumanName. With the facade key removed, the three facade rows fail, and so doestest_snapshot_field_translation.「」, re-spelled with「」, gives the same output in both APIs. No differences across 9 texts.fix(#597)ledger rules at all five baselines. No corpus line held the brackets before this, so the three new rows are the only names that move. The gate exits 0 everywhere.history:link, plus a new decisions.md#N1 entry. modules.rst, AGENTS.md's note on the v1 delimiter keys, and the release log are updated too.Closes #597.
🤖 Generated with Claude Code