Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
- 2026-10-01 (Derek) — A CAPITALS-SETTLED RUN OPENED BY A WORD OF THE CLASS REPORTS, AND RULES.MD#C1 NOW SAYS SO. C1 said a run whose every class word is written in capitals "reads whole in silence". That held only behind another credential: a class word OPENING the part is the first word after the comma, whose decision C1 reports either way, so `Doe, MA PhD`, `John Smith, MA MA` and `Smith, MA PhD` read wholly as suffixes and report `suffix-or-name` once, on that word, while `John Smith, PhD MA` and `Smith, PhD MA` are silent. The behavior predates #562 and is kept: nobody repeats `MA` at the end of their name on purpose, so the report is the right signal. Statement corrected, no parse moved. MEASURED 2026-10-01 on master b39c370c, the prefixes `John Smith, ` and `Smith, ` times every run of two or three words drawn with repetition from {MA, BA, ED, DO, JD, PhD, MD, Jr, Esq.} holding at least one class word: all 900 runs opening with a class word report, 895 of them read whole (14 of those hold a #562 particle pair, decisions/C4, whose count flip reports over the whole part rather than on the first word) and the other five being `Smith, MA DO DO` and its like, the one-name-word chain #562 left open; of the 560 opening with another credential, 554 read whole in silence, and the other six hold a #562 particle pair — four reading whole and reporting (`John Smith, PhD DO DO`), two being `Smith, PhD DO DO` and `Smith, Jr DO DO`. Recompute: parse that grid and bucket by whether the first word is a class word, whether `ambiguities` is empty, and whether the suffix is the whole part. The same day (Derek) rules/S2's first-slot precedence sentence gained the pointer to that exception, so the next reader does not rediscover it: S2 says the count decides the first slot after a family comma before case, true for one word (`John Smith, MA` flips by the count) and false for a capitals-settled run, where C1's shortcut (rules/C4 since #728) reads the capitals first and the comma keeps its family reading. And S2's list of reporting slots lost "the segments beyond it": no `suffix-or-name` report lands past the second comma (`Smith, John, MA` and `John Smith, Jr., MA` are silent). It once did: at #530's merge cc78c960 `John Smith, Jr., PhD Do Ma` reported `suffix-or-name` on 'Ma' beside its `comma-structure` flag, from group's chain emitter, which the 2026-09-28 #544 bullet (decisions/C11) silenced in a tail. S2 now points at C2 for what such a part does report, which is not only `comma-structure` — an unclosed delimiter there adds `unbalanced-delimiter` (`John Smith, Jr., (Bob`), and a maiden clause standing in it is read as one (`Smith, John, Jr nee Jones MA`, maiden 'Jones MA'). Derek, 2026-10-01: the silence is right.
- 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/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 rules/S2 states ("A name word the run absorbs is reported `suffix-or-name`"), which C1's credential-opening branch (rules/C8 since #728) reaches by reading the words after it as that run reads them, and which C1's example pins (`John Smith, PhD Jones` → `suffix-or-name`). The rule text and the code had disagreed since #603 added the report (in `assign`; #613 later moved it 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). The part's own reports are listed by their rules: C1's report of the decision at its comma (the flip, or the first word after the comma), S2's report on each word a credential in front of it reads as a suffix although it may be a name word (a name word the run absorbs, a member the company decides), and C2's flag. Measured by the review over about 1.2 million parses of suffix-comma and tail parts: those are the only reports such a part carries. 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.
- 2026-10-18 #728 — SPLIT FROM decisions/C1 with the rule. The entries above were written under decisions/C1 while this rule was part of rules/C1, and moved here unchanged but for the pointers the move broke, the measurement paragraphs, each cut to one line naming its population, counts, baseline and PR, and the superseded passages, each cut to its decision and what replaced it; where one says rules/C1 or C1, it means the rule as it then stood, which held this one.
- 2026-10-19 (Derek), follow-up to PR #738 — THE REPORT'S PAIRED-INITIALS EXCEPTION (`pair_only`) ASKS `is_title_piece` FOR THE TITLES IN FRONT OF THE FIRST PAIR. Recorded under decisions/C5 with the speaker scan it was changed beside, the measurement and the one configured move.
2 changes: 2 additions & 0 deletions docs/design/decisions/C5-paired-initials-after-the-comma.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# C5 — paired initials after the comma

- 2026-09-30 (Derek), #563 — PAIRED INITIALS ARE THE EXCEPTION TO THE NAME-WORD COUNT. The decision is recorded under decisions/S9 (#563), with the dotted shape it belongs to; decisions/C3's #575 entry records how `De La Cruz, M.J. K.L.` reads behind a one-word particle surname. This bullet is C5's pointer to both.
- 2026-10-19 (Derek), follow-up to PR #738 — THE TWO TITLE TESTS IN C5'S DECISION AND C11'S REPORT ASK `is_title_piece`, THE SHARED PREDICATE; UNDER THE DEFAULT VOCABULARY NO READING MOVES. The speaker scan ('an unambiguous suffix word in front of them that is not also title vocabulary') and `pair_only` (only titles in front of the first pair, the C11 report's paired-initials exception) each hand-copied a one-word `vocab:title` test that a title P3 joins does not pass; #738 found the same copy in C12 reading `Mr. and Mrs.` as a credential. The two tests differ only on such a joined title, and both sit behind C4's run: the speaker scan runs only where the part is the credential run, and the report asks `pair_only` only beside it. A joined title's free connective fails C4's every-word-a-suffix-word test, a connective that IS suffix vocabulary being frozen rather than joined, so neither site meets one by default. Measured 2026-10-19 against the parent (550720c6, extracted with `git archive`, `__file__` asserted on both sides), over `John Smith`, `Smith`, `Garcia Marquez`, `John Smith Jr.`, an empty head, `Dr. John Smith`, `Mary Jane Smith` before the comma × the lead-ins (none), `Mr. and Mrs.`, `Mr. & Mrs.`, `Dr.`, `Dr. and Ms`, `Mr. and Ph. D.`, `Ph. D. and Mr.`, `Secretary of State`, `MD`, `Ms`, `PhD`, `Mr. and MD`, `MD and Ms`, `AD`, `Prof. Dr.` × the tails `G.J. A.B.`, `GJ AB`, `G.J.`, `GJ`, `G.J. MD`, `G.J. PhD`, `A.B. G.J. MD`, `AD`, `XY ZW`, `G.J. XYZ`, `M.J` × the three orders: 0 of 3,465 readings, ambiguity details or `initials()` move. Counted by wrapping `is_title_piece` there, the speaker test never disagrees with the copy, and `pair_only` disagrees on 6 inputs, every one behind a generation (`John Smith Jr., Mr. and Mrs. XY ZW`), where the run failed and C12's report is chosen. The PR's reviews widened it to about 200,000 default-vocabulary parses each, with more heads, lead-ins and the comma policies, and found no move.
A CONFIGURED connective that a configured delimiter splits into suffix words passes the run, and there the swap moves readings, found by the PR's code review: with `Lexicon.default().add(conjunctions={'phd/md'})` and `Policy(extra_suffix_delimiters=frozenset({'/'}))`, `John Smith, Ms. PHD/MD Ph. D. GJ` read given 'John', family 'Smith', suffix 'Ms. PHD/MD Ph. D. GJ' and now reads title 'Ms. PHD/MD Ph. D.', given 'GJ', family 'John Smith', the joined title no longer speaking for the pair; and `John Smith, MD PHD/MD Ms. G.J. K.L.` keeps its fields and now reports SUFFIX_OR_NAME. ACCEPTED (Derek, in the PR's review): a joined title reads as a lone title word does, the direction #738 took, on a configuration no default reaches.
9 changes: 3 additions & 6 deletions nameparser/_pipeline/_comma.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,7 @@ def decide(state: ParseState) -> ParseState:
speaker = next(
(j for j in range(len(p1))
if is_suffix_piece(p1[j], pt1[j], tokens)
and not (len(p1[j]) == 1
and "vocab:title"
in tokens[p1[j][0]].tags)),
and not is_title_piece(p1[j], pt1[j], tokens)),
len(p1))
# another shape word than this one: no set built per
# pair (a copy of `shape` each time was quadratic in C)
Expand Down Expand Up @@ -513,9 +511,8 @@ def decide(state: ParseState) -> ParseState:
# only titles among the other words in front of the first
pair_only = (len(pairs) >= 2 and len(pairs) == len(members)
and all(p[0] in member_set
or (len(p) == 1
and "vocab:title" in tokens[p[0]].tags)
for p in p1[:pairs[0]]))
or is_title_piece(p, pt, tokens)
for p, pt in zip(p1[:pairs[0]], pt1)))
if behind_generation:
# rules/C11: "A decision either way at the comma C1 reads is
# reported" -- here the suffix word before the comma decided it,
Expand Down
Loading