Repository navigation
Set apart a bracketed clause of credentials, generations or titles (#792, #771) - #1067
Merged
Merged
Conversation
, #771) rules/S1 (a bracketed credential is not a nickname) dropped the brackets of suffix-shaped content and let its words join the name, so coverage depended on accidents: '(PhD, MBA)' and '(Dr)' read as nicknames, '(Dr.)' as a title by its period, 'John (Dr.) Smith' as a middle name, and 'John Smith (PhD) Withers' as suffix 'PhD Withers'. A clause wholly of words the vocabulary reads as no name is now set apart: no nickname, no maiden name, each word the title or suffix its vocabulary makes it, and the name around it read as beside a nickname. A member of the ambiguous class joins one where its writing settles it after the name (rules/S13). Exclusions: a clause of title modifiers and styles, a lone title of address, titles alone behind a credential, and a credential written as initials before a name word of its comma part. Other period-final content keeps v1's escape. classify tags a clause word without the comma written beside it, and R1's entry pass parts suffix words at a clause comma. read as the maiden name. S13's twin-difference Accepted bullets are gone, the twin now reading as the member does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov found the branch unreached: every lone member of the ambiguous class that its writing settles after the name is a clause of one non-name word to _set_apart_clauses, which runs first. What is left of S13's pass is the report on a member left the nickname. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…surement on master (#792) FEC's TOBIN, MARY (V) loses the suffix-or-name report master gives it: the set-apart clause is read after assign's walk reports, and rules/C9 now names a bracketed letter among the slots that settle it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73
force-pushed
the
feat/delimited-non-name-clause
branch
from
November 5, 2026 05:27
7a99a51 to
127b254
Compare
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.
Closes #792
Closes #771
The design question
Should one rule cover any phrase inside any known delimiter pair? The framing:
Option B was decided: set apart a clause of unambiguous credentials and title heads, each word by its vocabulary, with the exclusions below.
Why it was inconsistent. rules/S1 didn't make a clause a suffix. It dropped the brackets and let the words join the name.
John Smith (PhD, MBA)PhD, MBAJohn Smith (MBA, PhD)MBA, PhDJohn Smith (Dr)DrJohn (Dr.) SmithDr.Dr.John Smith (PhD) WithersPhD Withers(2.4.0 through 2.8.0)Withers, suffixPhDMr Hugh (Snr) BoyleSnrSnrJustin (JP) StearnsJPJPJohn Smith (Sir),(Mr)Alex Green, FRCS (SN)John Smith (Hon),MRCP (UK)#792's headline example,
W. Russell (Jr.) Withers, had already moved back to middleRussell Jr.when #1039 gatedJr.. It now reads suffixJr., familyWithers.The rule (rules/S1, rewritten)
A clause wholly of words the vocabulary reads as no name is set apart. It is no nickname and no maiden name, and the words around it read as they would beside a nickname. Each word takes the role its vocabulary gives it: a title is the title, and a credential or generation is the suffix. A word that is both is the title in front of the name's first word and the suffix elsewhere. A member of the ambiguous credential class (S4) joins the clause only where its writing settles it after the name (S13).
Exclusions, each of which keeps its pair's reading:
(UK),(Hon).(Sir),(Mr).FRCS (SN), which is a credential's qualifier.(JP),(R.N.). A title/suffix dual counts here only with a period after each letter, or in capitals in a mixed-case name. This exclusion came from reading the moves, not from the options as first put.Other content ending in an ASCII period keeps v1's escape: the brackets are dropped and the content reads bare.
#771
rules/M2's Precedence bullet claimed a marker inside a delimited clause made the span the maiden name "whether or not the pair is a configured maiden delimiter". That is false for M3's Except cases. The bullet is now scoped to clauses that read as the maiden name. No reading moves.
Mechanism
_extract._set_apart: asks the vocabulary half and extracts the clause instead of dropping its brackets._suffix_shapedbecame_period_escape._post_rules._set_apart_clauses: gives the clause's words their roles once the name's are read, and asks the exclusions that need roles. It trims a comma off a word's span; R1's entry pass parts suffix words at that comma._classify: tags a clause word without the comma written beside it.mechanisms.md#CLAUSE-CONTENT-OVERRULES-DELIMITER records the split.
Measured
snapshot.py --local <source> --base <origin/master 84252268>, re-taken after rebasing onto master (the first measurement, against c620754, counted FEC 16):decisions/S1 records the moves by class. Two ORCID nickname clauses gain an S13
suffix-or-nicknamereport onMEng,. The seventeenth FEC entry is an interaction with #877, merged since:TOBIN, MARY (V)keeps suffixVbut loses thesuffix-or-namereport master gives it, because the clause is set apart after assign's walk reports. A letter its writer bracketed is not a middle initial in doubt, so rules/C9 now lists a bracketed letter among the slots that settle it (Smith, John (V)→ no ambiguity).CLDR agreement: one Czech rendering moves. In
Machová, Alexandra Zuzana (paní, Ph.D.), the given names now agree with CLDR, and the title gainspaní, which CLDR leaves out.Accepted costs (S1's Accepted bullets):
(ST)and(ME)read as titles.(Lady)reads as a title, becauseladyis in neither address set.John Smith, MD (Dr.)reads as a nickname.(MPH)alone leaves the name empty.Col. (Ret.) Smithreads suffixRet., where 1.4.0 through 2.8.0 read titleCol. Ret.. This re-pins two 1.x "known limitation" tests.Reviews
Four reviews ran: code, design-docs, test coverage and comments. Then a review of the fix commits.
Code defects found and fixed:
(MBA, PhD)and(PhD, MBA)read differently and(Jr, PhD)lost its generation.(Lt).(Jr.,) III.Docs fixed:
Jack (PhD)example (N3).(MBA)was S13's case.customize.rst,usage.rstand the_policy.pycomments described the old escape.The test review's unpinned branches are now rule examples. The suite passes on 3.11 and 3.15, and the serial benchmarks pass, with two new scaling rows.
🤖 Generated with Claude Code