Skip to content

Commit 782d9ac

Browse files
derek73claude
andcommitted
Narrow C2's no-name-reading clause to a word read as a name (#641)
rules.md#C2 said a part consumed wholly as suffixes raises no report about reading a word of it as a name, yet the part after a suffix comma reports each word its opening credential takes ("may be a name word"), the report C1's statement promises and its `John Smith, PhD Jones` example pins. The report stays, and C2's sentence is narrowed to what it meant -- no report that a word was READ AS a name; C1's report on a word read as a suffix that may be a name word is the part's own, with C1's flip and C2's flag. Text only: no reading or report moves; the code comment quoting the sentence follows it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8d1af36 commit 782d9ac

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎docs/design/decisions.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,8 @@ Excluded (MAIDEN_MARKERS, per nameparser/config/maiden_markers.py):
10381038
- 2026-10-11 (Derek), #636 — NO PARTICLE CHAIN IS MADE IN A PART THAT HOLDS NO NAME WORD. A part past the second comma, after either comma, is read wholly as suffixes, its title words as titles (C2, #603), but group still ran the particle chain over it, which builds a name unit no reading uses (the part after a suffix comma, which C2 covers too, had reached no chain since #613, `_comma.decide` binding it and emptying its segment before any join; a suffix-comma grid moves nothing here -- `{head} {w1 … wk}` for k from 1 to 3 over the heads `John Smith, Jr.`, `John Smith, PhD`, `, PhD`, `John Smith, MD Ma`, `John Smith, Jr. MA`, `Smith, PhD`, `, Jr.`, `John Smith, X.Y.Z.` and the words `van der de la von und St Freiherr do mc vd du Dr. Dr Prof. Prof Attorney Sir Lt.Gov. Mr. MA Ma PhD X.Y.Z. VI V Jr. Berg Jones`, 606,216 parses under the three orders, a sample reaching both comma structures): a particle past the part's first word took the words behind it, a title word among them, so `John Smith, Jr., van der Berg Prof.` read suffix 'Jr., van der Berg Prof.' where `John Smith, Jr., Prof.` and `John Smith, Jr., van Berg Prof.` (whose leading `van` chains nothing, P4) read title 'Prof.'. Now group makes no chain in such a part, and asks no chain bound there, so C2 reads every title word in it, bare (`Prof`) or mid-part (`van der Prof. Berg`) alike. DECIDED (Derek): no chain there, rather than the issue's proposal, #623's bound (`trailing_run_start`) at this site; that reads trailing titles only (H5), narrower than C2's rule, and adds a call where removing the chain takes one away. The chain's two report emitters had been handed no report list in these parts for the same reason (rules.md#C2's no-name-reading clause, 2026-09-28); with no chain there is nothing to suppress, and the handoff now suppresses reports only after a family comma (removing the tail half moved nothing over the suite, #624's comma-tail grid's 292,950 parses, every corpus name and case text, and the suffix-comma grid above).
10391039
MEASURED 2026-10-11 against 3b2b6f0d (#635's merge), py3.11, `nameparser.__file__` asserted on each side. #624's comma-tail grid (its recipe, decisions.md#P2, 2026-10-10; 97,650 texts under the three orders), with every corpus name and case text at 3b2b6f0d: 18,318 parses on 6,106 texts move a role, every one in the grid and none of 3b2b6f0d's corpus names or case texts, and no parse moves a report alone. 15,330 put a title word that stood behind a particle run into the title field (`,, 'Bob' van der Attorney` → title 'Attorney', suffix 'van der'; master suffix 'van der Attorney'), and 2,988 take a particle back out of a title the chain had joined it to, where the chain merged it with a P3-joined title and kept the tag (`,, 'Bob' van der Mr. and Mrs.` → title 'Mr. and Mrs.', suffix 'van der'; master title 'der Mr. and Mrs.', suffix 'van'). The S2 stress grid, #624's title-particle grid, #623's given-part grid and #625's particle grid: 0. The five gates exit 0, a `fix(#636)` rule in each 2.x ledger; at 1.4.0 the broad `fix(comma-family) lone post-comma piece routes to suffix/title` rule explains the new example. Frames: the reference rows and family-comma names do not move; a tail part with a particle costs less (`John Smith, Jr., Freiherr von Richthofen` 440 → 428, `John Smith, Jr., van der Berg Prof.` 462 → 452, py3.11 warm). Recorded negative control: with the chain run in these parts again, 9 tests fail -- the three `fix(#636)` rows on both surfaces, the two new rules.md#C2 examples, and `a_part_past_the_second_reports_no_particle_fork`, whose chain report the handoff no longer suppresses, so that row guards the change too -- and with it run only after a family comma, the review's rows `Smith, John, van der Berg Prof.` and `,, van der Berg Prof.` (both surfaces), which it added after that mutant passed the suite.
10401040
THE REVIEW (2026-10-11), measured, all garbage-neutral or better, no reading worse over the review's generated tail-part sweeps under thirteen configurations (fields, reports, `initials()`, `capitalized()` and the facade's views compared; the populations were the reviewer's and are not recorded here, so no count is quoted): a word in both the title and particle vocabularies inside a tail part now reads as a title as a plain title there already did (`John Smith, Jr., Berg St Smith` → title 'St'); a particle between two titles there becomes a suffix entry of its own (`John Smith, Jr., St von Mr. and Mrs.` → title 'St Mr. and Mrs.', suffix 'Jr., von'). Two gaps outside this change, already on master: P5's bound join still runs in a tail part after a suffix comma (`John Smith, Jr., abdul Dr. Smith` keeps 'Dr.' in the suffix where `John Smith, Jr., Berg Dr. Smith` reads title 'Dr.'), and rules.md#C2's no-name-reading clause is contradicted for the part after a suffix comma by #613's per-word report (`John Smith, PhD van der Berg` reports suffix-or-name on each word).
1041-
Open: #640, #641.
1041+
Open: #640, #641. (Both settled 2026-10-11: #640 by #637's entry, decisions.md#P5; #641 below.)
1042+
- 2026-10-11 (Derek), #641 — C2'S NO-NAME-READING CLAUSE MEANS A WORD READ AS A NAME, AND C1'S PER-WORD REPORT IS THE PART'S OWN. rules.md#C2 said a part the parse consumes wholly as suffixes "raises no report about reading a word of it as a name", whether it is the part after a suffix comma or a part beyond the second; but the part after a suffix comma reports each word its opening credential takes (`John Smith, PhD van der Berg` → suffix-or-name on 'van', 'der' and 'Berg', "follows a credential, so it reads as part of the suffix run; it may be a name word"), the report C1's own statement promises ("each word it takes that would have made it the given part, as #602's run reports them", #603) and its example pins (`John Smith, PhD Jones` → `suffix-or-name`). The rule text and the code had disagreed since #613 moved the report into `_comma.decide`, and no test held either side's wording. DECIDED (Derek): the report stays -- a word behind a credential in a part the comma made postnominal is the fork it reports in `John Smith PhD Jones` -- and C2's sentence is narrowed to what it meant: no report that a word of such a part was READ AS a name (a particle chained onto a name word, an acronym taken into the name), C1's report on a word READ AS a suffix that may be a name word being, with C1's flip and C2's flag, the part's own. A text change only: no reading or report moves (the suite and the five gates unchanged), and the one code comment quoting the old sentence quotes the new.
10421043

10431044
### T1 — separators, not joiners
10441045

‎docs/design/rules.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,14 +2091,16 @@ C2. Rationale: text beyond the recognized comma parts should be
20912091
reach here in any setting: the shape a tail segment is
20922092
recognized by is the dotted one alone.
20932093
A part the parse consumes wholly as suffixes raises no report
2094-
about reading a word of it as a name, whether it is the part
2094+
that a word of it was read as a name, whether it is the part
20952095
after a suffix comma (C1) or a part beyond the second: nothing
20962096
in it is read as one, a maiden marker there being an ordinary
20972097
word (M2), and no particle chain (P2) is made in it, so a title
20982098
word behind a particle run there is a title like any other, and
20992099
the part reports neither a particle chained onto a name word nor
21002100
an acronym taken into the name. What such a part reports is its
2101-
own — C1's flip and this rule's flag.
2101+
own — C1's flip, C1's report on each word the opening credential
2102+
takes that may be a name word read as a suffix, and this rule's
2103+
flag.
21022104
"John Smith, MD, Bart" → suffix="MD, Bart"
21032105
"Eric H. Holder, Jr., Attorney General" → title="Attorney General"
21042106
"Eric H. Holder, Jr., Attorney General" → ambiguities=()

‎nameparser/_pipeline/_group.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ def group(state: ParseState) -> ParseState:
13541354
# suppression: group makes no particle chain there (#636) and
13551355
# takes no maiden clause (rules.md#M2, #601), so nothing in group
13561356
# reports in one. rules.md#C2: "a part the parse consumes wholly
1357-
# as suffixes raises no report about reading a word of it as a
1357+
# as suffixes raises no report that a word of it was read as a
13581358
# name"
13591359
tail = tail_start is not None and seg_idx >= tail_start
13601360
# #601: where a maiden clause would stand, off the three facts

0 commit comments

Comments
 (0)