You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc24386
Browse filesBrowse the repository at this point in the historyBrowse files
Word a report's field from the word's final role (#626) (#628)
* Word a report's field from the word's final role (#626)
Five of assign's reports named the field their word was read into
from the role it held at assign, and two later rules still move a
word: H1 takes a lone unit behind a title into the family, and P6's
attachment takes a trailing name word into the family at the end of
a name read family-first. So `Attorney General of Minnesota` said
'General of Minnesota' was "read as a given name" (since 2.3.0), and
`Kim Min Do` under FAMILY_FIRST said 'Do' was "read as a middle
name", each with the word in the family.
The decision stays at its site; the field's wording moves to
assemble, which alone knows final roles. An emitter naming a field
writes its sentence up to the field and passes the rest as
PendingAmbiguity.field_tail; assemble joins them around FIELD_READING
of the first referent's final role. All five emitters use it.
Measured on master over 51,835 names under all three orders: 2,689 of
66,208 field claims named the wrong field; on the tree, 0. No role,
kind, initials or rendering moves on the fingerprint; 40 details
change, all title-or-name 'given' -> 'family'. Guarded by
test_a_report_names_the_field_its_word_lands_in over every case row
under all three orders (control: 10 failures on master).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fix#626's review findings: the sixth emitter, P1's fold, a wider guard
The comma report on the word after a family comma hardcoded "read as
the given name", and with nothing before the comma H1 moves that word
to the family behind a trailing title (`, Ma Dr.`). It now defers its
field to assemble like the other five, so its given-side wording reads
"a given name". P1's family-first fold is a third rule moving reported
words (`de Kim Ma` under FAMILY_FIRST); the comments and docs that
named only H1 and P6 now name all three, and "H1's swap" is H1's move.
Assemble withdraws a field_tail report in an emptied name instead of
shipping half a sentence, and FIELD_READING is asserted complete over
Role. The sweep's phrase list covers the settled phrasings too (the
suffix run's, the numeral fork's, H4's "the name", P6's), states that
locale rows are not checked, and a second test records how many claims
it checks (1151) so it cannot go vacuous. Rows `, Ma Dr.` (fix(#316))
and `de Kim Ma` under FAMILY_FIRST (fix(#289)), both bisected; the
`Kim Min Do` note no longer claims both family-first orders. Unit
tests for assemble's join; two test_assign names now say "field".
decisions.md's entry carries a recompute recipe and re-measured
figures: 2,725 of 89,092 claims wrong on master over 53,517 texts
(comma shapes with an empty head and a trailing title added), 0 on
the tree; control 11 failures on master.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fix the fix commit's review: the opt-in movers, #629's route, the recipe
The patronymic rotations (O1, O2) and middle_as_family's fold (O3) also
move a word assign reported, under opt-in policies no three-order grid
reaches, so reverting the leading-particle emitter passed the whole
suite. Rows `Van Ivan Petrovich` (East Slavic), `Van Ali Veli oglu`
(Turkic) and `Do Bishop Do` (FAMILY_FIRST + middle_as_family) pin them,
and every mover list now names them. The sweep's claim count moves
1151 -> 1155 with the rows, its control on master 11 -> 14, and the
sweep reads its population from `_swept_rows` rather than a copy of
the skip.
decisions.md#A1 gains `Open: #629` (segment's "consumed as suffix"),
which mechanisms.md and the release log now qualify; AGENTS.md says the
guard covers only the phrasings it lists. The `, Ma Dr.` report dates
from #289, not #316; the recipe names the 6f15f21 case table and the
collapsed empty-head space, and scopes its figures to the three orders.
A mixed-role unit test pins assemble's first-referent choice; the
2026-09-17 entry notes the rewording; the release bullet adds the
patronymic example, which 2.3.0 also misreported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Correct #626's recipe and A1's interacts list (third review)
The recipe's case table is 0c54662's, the parent of #614's first
commit (6f15f21 has the same table but is not that parent), and the
claim that today's table moves the wrong count by at most two was
false: the rows the reviews added read 6 more on master. The random
draws, the stripping and the comma forms are now stated exactly
enough to rebuild the 53,517 texts. rules.md#A1's interacts list names
the movers the entry names: P1 and O1 to O3 beside H1 and P6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Simplify #626's change: one swept-row list, shared helpers
The two order-sweep invariants walk one `_SWEPT_ROWS` list, so the
row filter is stated once and neither test skips (582 -> 110 skips
in the suite); `_NAME_FIELDS` is `NAME_ROLES`; test_assign's
`_reported` reads through `run` rather than a hand-listed stage chain.
In assign, title-or-name's two branches share one constructor, the
particle emitter's comment points at `PendingAmbiguity.field_tail`
for the movers instead of carrying a third copy of the list, and its
one-use `token` binding is inlined. No behavior change: fingerprint
byte-identical on every common name, field grid 0 of 89,092, five
gates exit 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/design/mechanisms.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ Problem shape. A retired default rides in on old pickles, but a user may have de
114
114
115
115
## AMBIGUITY-AT-THE-DECISION-SITE — emit where the branch is taken
116
116
117
-
Problem shape. An ambiguity report should fire exactly when the parse chose between live readings — no more, no less — and the choosing happens in code, not in vocabulary. Contract statement. Emit at the site that takes the branch, not where an ambiguous tag sits; when a fork's two branches are decided in different stages, EVERY deciding stage carries an emitter; and a branch that runs but changes nothing is not a decision and must not report. How it works. PARTICLE_OR_GIVEN fires from assignment for a lone leading particle and from grouping when a title shifts it off the front — for two years only the first site emitted. And keying on
117
+
Problem shape. An ambiguity report should fire exactly when the parse chose between live readings — no more, no less — and the choosing happens in code, not in vocabulary. Contract statement. Emit at the site that takes the branch, not where an ambiguous tag sits; when a fork's two branches are decided in different stages, EVERY deciding stage carries an emitter; and a branch that runs but changes nothing is not a decision and must not report. The decision is the site's, but a FIELD the report names is not: a later rule can still move the word, so the emitter leaves the field to assemble (`PendingAmbiguity.field_tail`), which words it from the final role (#626; a comma-structure report on a part past the second comma still names "suffix" for a part holding a title, #629). How it works. PARTICLE_OR_GIVEN fires from assignment for a lone leading particle and from grouping when a title shifts it off the front — for two years only the first site emitted. And keying on
118
118
"the code got here" instead of "the outcome differed" once reported
119
119
a fork for all ambiguous particles on "Dr. Van Jr.". Lives in. The AmbiguityKind emitters across _pipeline/ (rule A1 is the observable contract). Reach for it when. Adding any ambiguous vocabulary or any new fork — count the deciding sites, then count the emitters.
Copy file name to clipboardExpand all lines: docs/release_log.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,8 @@ Release Log
36
36
37
37
- **Fix a comma part read wholly as suffixes reporting a particle in it as chained onto a name.** ``parse("John Smith, Jr., Freiherr von Richthofen").ambiguities`` names ``comma-structure`` alone, where 2.0 through 2.3 also named ``particle-or-given`` for ``von`` -- a word the same parse had put in the suffix, so the report described a reading it never made. This fix moves no field; the title change below (#603) moves ``Freiherr`` to the title. A part the parser consumes as suffixes, after a suffix comma or past the second comma, reports what the part is and nothing about its words as names, and the particle chain's credential-acronym report this release adds (above) keeps the same bound: ``John Smith, PhD Do Ma`` reports the comma's decision once and not again for ``Ma``. See the 2026-09-28 bullet of the ``C1`` entry in ``docs/design/decisions.md``
38
38
39
+
- **Fix an ambiguity report naming the field its word was first placed in rather than the one it ends up in.** ``parse("Attorney General of Minnesota").ambiguities`` says ``'General of Minnesota'`` was "read as a family name by convention", where 2.3.0 said "read as a given name" of a name whose family it was, and a leading ``Van`` that a patronymic rule rotates into the family name (``Van Ivan Petrovich`` under ``Policy(patronymic_rules=frozenset({PatronymicRule.EAST_SLAVIC}))``) is reported as read as a family name where 2.3.0 said a given one. A report that names the field one word was read into now names the field the word holds in the result, whatever rule moved it after the report was made. This fix moves no field and no report kind. See the #626 entry under ``A1`` in ``docs/design/decisions.md`` (closes #626)
40
+
39
41
- **A credential after the name core starts a suffix run to the end of its part.** ``HumanName("John Smith PhD Jones")`` gives suffix ``PhD Jones`` and reports ``suffix-or-name`` for the name word it took, where 2.3.0 gave middle ``Smith PhD``, last ``Jones``; ``Smith, John PhD Jones`` gives suffix ``PhD Jones`` where 2.3.0 gave middle ``Jones``, suffix ``PhD``. A title in the run is a title, so ``Eric H. Holder Jr. Attorney General`` gives title ``Attorney General``, suffix ``Jr.``, as the comma spelling ``Eric H. Holder, Jr. Attorney General`` already read, where 2.3.0 gave middle ``H. Holder Jr. Attorney``, last ``General``. Only an unambiguous credential or generational word starts the run, and only behind the name core -- two name words with no comma, or the given part after one. A credential that is also a name does not start one, nor does a surname particle or a single letter, so ``John Smith MA Jones`` and ``Mohamed Ali Abd Allah`` read as before, and a bare title word starts nothing: ``Mary Jane King Smith`` keeps middle ``Jane King``. See the ``S2`` entry of ``docs/design/decisions.md`` (closes #602)
40
42
41
43
- **Fix a comma part that opens with a credential being read as a given name.** ``HumanName("John Smith, PhD Jones")`` gives first ``John``, last ``Smith``, suffix ``PhD Jones`` and reports ``suffix-or-name`` for the name word it took, where 2.3.0 gave first ``PhD``, middle ``Jones``, last ``John Smith`` (and 1.4.0 title ``PhD``, first ``Jones``). With one word before the comma the whole part is suffixes: ``Doe, PhD Jones`` gives last ``Doe``, suffix ``PhD Jones``. A title word in the part stays a title. A word that is a title as well as a credential (``MD``, ``Ms``) opens nothing, so ``Smith, Ms Jane`` keeps title ``Ms``, first ``Jane``. An undeclared delimiter becomes one more word of the part: ``Steven Hardman, RN - CRNA`` gives first ``Steven``, last ``Hardman``, suffix ``RN - CRNA``, where 1.4.0 through 2.3.0 gave first ``RN``, middle ``-``, last ``Steven Hardman``. The split spelling now counts like the joined one, so ``Smith, John Ph. D. Jones`` gives suffix ``Ph. D. Jones``, where 2.3.0 gave middle ``Jones``, suffix ``Ph. D.``. See the ``C1`` entry of ``docs/design/decisions.md`` (closes #603)
0 commit comments