Split fix(suffix-routing) into the rules that name its shapes (#372) - #376
Open
derek73 wants to merge 2 commits into
Open
Split fix(suffix-routing) into the rules that name its shapes (#372)#376derek73 wants to merge 2 commits into
derek73 wants to merge 2 commits into
Conversation
It claimed 25 names in four shapes; its prose -- "two-token name with
unambiguous trailing suffix stays suffix" -- described four of them.
Three of the 25 move no suffix at all. 'Bob Jones, author' and
'MD, PHD' keep an identical title on both sides and move the pre-comma
run from `first` to `last`, because pre-comma is definitionally family.
Diff is exactly {given, family}. They now have their own rule,
fix(comma-precomma-family), separated from fix(comma-family) by fields
rather than order -- that rule's exclude `family`, which every name
here moves -- and Latin-anchored for the same reason it is.
The other 18 are #312's comma-less glued honorifics, and they stay.
They cannot be given a name_regex rule: '김민준씨' and the given name
'김지양' are the same string shape, hangul ending in a character that
is also an honorific, and only vocabulary plus segmentation tells them
apart. That is why fix(cjk-honorific-suffix) is anchored to a whole
trailing token.
Unanchoring that rule to reach the glued forms was the first design
here, and measuring it is what rejected it: it would make a future
suffix regression on '김지양' classify as a recognized honorific. A
specific rule confidently claiming a name it does not describe is
worse than this rule's honest breadth, and the differential run cannot
see the difference -- 108/0 either way -- because nothing is being
absorbed yet.
So the issue text becomes what all 22 remaining names share: a
trailing token routes to suffix. The Latin two-token case is four of
them; the comment now says the glued honorifics are the majority, and
why this is the last-resort tier rather than a gap left for later.
Gate unmoved: 108/0 at 1.4.0, 90/0 at 2.0.0, 1/0 at 2.1.0.
Three rosters recorded. _CORPUS_CLAIMS gains the new rule and rekeys
suffix-routing on its new issue text. _EXCLUSION_EFFECT's Ph. D. entry
gains fix(comma-precomma-family) in absorbed_by -- it JOINED, it did
not replace fix(suffix-routing), which still claims the readings
outside the new rule's two fields. _CROSS_RULE_WINNERS gains the five
names that now sit on either side of the split; measured, narrowing
the new rule so it can no longer claim them fails that pin.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #376 +/- ##
=======================================
Coverage 98.51% 98.51%
=======================================
Files 44 44
Lines 2895 2895
=======================================
Hits 2852 2852
Misses 43 43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The previous commit claimed 18 names could not have a name_regex rule -- that '김민준씨' and the given name '김지양' are the same string shape and only vocabulary plus segmentation separates them, neither reachable by a regex. Review falsified it, and the answer was in the config: GLUED_HONORIFICS deliberately omits 양, 군, 氏, 殿 and 博士, exactly the characters whose glued match collides with real given names. The parser had already solved this by curating a narrower vocabulary; a regex reaches vocabulary by hand-copying it, which this ledger does routinely and pins with a sync test. The 2.0.0 ledger has had such a rule since #308. This adds its twin to the 1.4 ledger, regex verbatim, enrolled in _HONORIFIC_SOURCES against the same GLUED_HONORIFICS source. 17 names. The other two were never glued: '김민준 씨.' and '김민준 양.' are spaced, and the spaced rule missed them only because its `$` would not tolerate a trailing period. Relaxed to `\.?$`. 양 stays safe there -- it is in the SPACED vocabulary, where a whole-token anchor already separates it from 지양. So fix(suffix-routing) is back to the four Latin names its original prose describes, and that prose is restored. It claimed 25 not because it was too broad but because it is the only fields-only rule and sorts last: when it grows, the question is which narrower rule is missing. Measured, all shapes accounted for and the gate unmoved at 108/0, 90/0, 1/0: fix(cjk-glued-honorific-peel) 17 new fix(cjk-honorific-suffix) 11 was 10, +2 periods, -1 to glued fix(comma-precomma-family) 3 unchanged from the last commit fix(suffix-routing) 4 was 25 Three rosters fired and were recorded: _HONORIFIC_SOURCES (the new vocabulary copy), _CORPUS_CLAIMS, _CROSS_RULE_WINNERS. One claim in this commit's first draft was also wrong and is corrected here rather than shipped: a suffix regression on '김지양' is still absorbed, by the fields-only catch-all. What #372 buys is that no rule NAMED for honorifics will claim it. Being taken by the catch-all is recoverable; being labelled 'recognized honorific' is not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 last of #372's confirmed over-claiming instances.
fix(suffix-routing)claimed 25 names in four shapes; its prose — "two-token name with unambiguous trailing suffix stays suffix" — described four. It is the onlyfields-only rule in any ledger, so it sorts after everyname_regexrule and takes whatever nothing narrower named. It was never too broad; the narrower rules were missing.The split
fix(cjk-glued-honorific-peel)김민준씨→ 김/민준/씨,Andersonさん→ Anderson/さんfix(cjk-honorific-suffix)김민준 씨.and김민준 양., loses김민준 박사님to gluedfix(comma-precomma-family)Bob Jones, author, which moves no suffix at allfix(suffix-routing)Smith Jr.,John V— exactly its original prose, restoredGate unmoved:
108/0at 1.4.0,90/0at 2.0.0,1/0at 2.1.0. Suite 3218.A claim this PR made and had to retract
The second commit asserted the 17 glued honorifics could not have a rule — that
김민준씨and the given name김지양are the same string shape, separable only by vocabulary and segmentation, neither reachable from a regex. Review falsified it, and the answer was sitting in the config:Exactly the characters whose glued match collides with real given names. The parser had already solved this by curating a narrower vocabulary; a regex reaches vocabulary by hand-copying it, which this ledger does routinely and pins with a sync test. The 2.0.0 ledger has had such a rule since #308 — this adds its twin, regex verbatim, enrolled in
_HONORIFIC_SOURCESagainst the same source.The other two names were never glued at all:
김민준 씨.and김민준 양.are spaced, and the spaced rule missed them only because$wouldn't tolerate a trailing period.What the residual gap actually is
A second wrong claim, corrected rather than shipped: a future suffix regression on
김지양is still absorbed — by the fields-only catch-all, measured. That is unchanged by this PR and is the standing cost of having a last-resort tier.What #372 buys is that no rule named for honorifics will claim it. Being taken by the catch-all is recoverable; being labelled
recognized honorificby a specific rule is not — and that is precisely what unanchoring the spaced rule (the first design here) would have caused.Rosters
Four fired and were recorded:
_HONORIFIC_SOURCES(the new vocabulary copy),_CORPUS_CLAIMS,_EXCLUSION_EFFECT(the Ph. D. entry'sabsorbed_bygainedfix(comma-precomma-family)— it joined, it did not replacefix(suffix-routing)), and_CROSS_RULE_WINNERS, which gains the names on either side of the glued/spaced boundary.#372 after this
All three confirmed instances are closed. Ambiguity reporting and the specificity floor remain declined on the evidence in #373.
🤖 Generated with Claude Code