Skip to content

Read a title that is also a given name as a title only inside a title phrase (#752, phase 2i) - #894

Merged
derek73 merged 8 commits into
masterfrom
claude/phase2i-front-of-name-c36590
Oct 26, 2026
Merged

derek73 merged 8 commits into
masterfrom
claude/phase2i-front-of-name-c36590

Conversation

@derek73

@derek73 derek73 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Phase 2i of #752, the front of the name. One PR.

What changes

A title that is also a given name is a title only inside a title phrase (new rules/H9, the title phrase). dean, justice and major gain an office or military reading beside a dated given one. A word with both readings compiles into the new TITLES_AMBIGUOUS instead of TITLES. It is a title only beside a partner:

  • a modifier or a style before it (Associate Dean, The Hon. Justice);
  • of after it (Dean of Students);
  • a title it attaches to, on either side (Major General, Chief Justice).

A salutation is never a partner (#853's Mr Dean Smith), and neither is any other title after the word (FEC's SMITH, DEAN MR.). Outside a phrase the word reads exactly as an unlisted word, so Dean Smith keeps given Dean (decision 13). Where it is the first name word and no comma has marked the given name, the parse reports title-or-name (Dean Smith reports, Smith, Dean does not), if a phrase the vocabulary lists holds the word. grace is held by none (nothing attaches to the style kind), so it is a title only behind a style or a modifier, or before of, and Grace Smith reports nothing; dean, justice and marshal are held through chief's phrases and major through its own, so Dean Smith, Justice Smith, Marshal Yanda and Major Smith report (Derek, 2026-10-26).

After Derek's answers (2026-10-26): grace (a style) and marshal (a rank, its #606 exclusion replaced) are phrase-only too, so His Grace John Smith and Field Marshal Bernard Montgomery read the title. attaches may name a word as well as a kind: sergeant attaches to major (Sergeant Major), and major to general. Attaching to the whole military kind made Sgt Marshal Smith lose its given name once marshal joined that kind.

Decision 10, at the head of the name only. A modifier (wing, vice, grand…) before the first comma is a title only:

  • with a head title after it in its run,
  • with of after it (Member of Parliament), or
  • as the object of a connective there (President of the United States).

Wing Lau and Mr Wing Lau read given Wing. After a comma a modifier is read as any title is (John Smith, Vice).

The vocabulary

  • attaches is lifted from its phase-1 reservation: a title property naming title kinds, compiled into two-word phrases.
  • Four new Lexicon fields: titles_ambiguous, title_modifiers, title_styles, title_phrases.
  • Reclassified as the build found:
    • resident and rt to occupation, and pro to academic (item 10's own);
    • d'affaires and member to office, since each heads or completes its phrase.
  • 13 salutations had given readings that Should Doe, Jane Mrs read Mrs as a title rather than a middle name? #835 recorded as H8's evidence (mr, herr, master, señora…). Those counts move into the salutation reading's note, as ld's did; otherwise the derivation would have read Mr Smith as given Mr. No reading moves.
  • st and freiherr keep their given readings for the particle marker and stay titles.

Compat. A word a caller lists in titles is a title everywhere, which keeps the 1.4 recipe c.titles.add("dean") and Lexicon.default().add(titles={"dean"}). That is why the contested words leave TITLES rather than sit in both.

#853's rule on its own

As decisions/vocabulary-model's item 12 asks, I measured the rule itself rather than the words taken out of titles. The scratch tree gave the nine D12 words a given reading; it was not committed.

  • PSC, the word after another title: 643 fixed, 0 broken (the design's spike had 644 / 0).
  • Alone at the head: 152 fixed, 24 set aside.

So the rule lands without declaring any D12 word. Its live reach here is dean, justice and major. The batches stay 2j's.

Measured

Against master a46b3a6e, py3.11, every local check with --base. Counts and token shapes only. Re-taken after merging master at ee1b21dd (#895, phase 2g) with that commit as the base: every local figure below is unchanged, and the committed snapshot shows the same 12 moves.

Check Result
Committed snapshot 12 moves against master (Grace Dean Smith no longer reports), plus 37 new names from the rules' examples (His Grace John Smith and Field Marshal Bernard Montgomery among them, reading the title). The Dean …/Major … names gain the report, Wing Lau and Grand Rounds read given, and the Dean of Chemistry rows read the phrase as the title
CLDR / GND / Wikidata agreement Conventions Wing Lau now agrees on given and title; no regression
PSC (local_agreement.py --base, 1,039,174 scored) 178 fixed, 3 broken, 16 changed. The broken 3 are roles typed in the title box (British ×2, Director Uk). The first build broke 4 Designated Member records, which member → office fixed
ctgov-officials 195 moved, 117 of them the report alone (Dean 115). Field moves: Wing heads read as the given name (Aa Aa, AA), and role strings opening with a modifier
fec-individuals 53 moved, none for the report alone (every FEC name has a family comma). They are family parts H6 no longer peels: FIELD SMITH, JOHN keeps family FIELD SMITH, as 1.4.0 read it; most of the rest is the INFORMATION REQUESTED placeholder
tse-donors 25 moved: 16 the report alone (DEAN 14, MARSHAL 2), 9 a modifier opening a name (ROCK, AIR) now read as the given name
Spelling consistency jrc-names 35 persons and nepal-candidates 4 pairs now alike, none apart; tse pairs unchanged

Sweeps. I ran a 34,380-parse grid built from:

  • comma shapes: empty head, nickname head, particle surname, title before the comma;
  • given-first and family-first orders;
  • spellings: bare, capitals, lower case, period-marked;
  • both-vocabulary heads (Freiherr, St, St.) and the dual Rev. Sr. second in a run.

It moved only these shapes. It also found the John Smith, DEAN reversal, fixed by leaving titles_ambiguous out of the capitals shape's "unlisted" roster.

Accepted costs (rules/H9):

  • Mr Justice Smith reads given Justice, since a salutation is no partner. Measured: all 17 PSC records with a salutation then Justice file it as the forename; none files it as a title. ctgov, FEC and the committed corpora hold none.
  • Grand Duke of Tuscany reads given Grand, because duke is refused.
  • A modifier after its head, with no of behind it, loses the title: Princess Royal Anne reads given Royal.
  • A modifier whose head is not a listed title loses the title (Grand Duke of Tuscany reads given Grand).
  • In the given part after a family comma a modifier is read as listed (Lau, Wing → title Wing), so the listing form and the written order disagree. That is the cost decision 10 took by keeping the gate out of comma parts.

Docs

  • rules/H9 (new) and an Except bullet in rules/H6.
  • decisions/H9 (new); decisions/vocabulary-model gets a phase 2i entry and updated Standing lines.
  • decisions/salutation-titles: justice leaves its "stay out" line.
  • The RFC's front-of-the-name section, the H section Background, and nameparser/vocab/README.md (the attaches row, the fourth derived marker, the kinds).
  • docs/customize.rst, concepts.rst and migrate.rst.
  • Release-log bullets.
  • AGENTS.md: the stale "Dean is absent from the titles" Gotcha, plus three lessons this PR earned: a new derivation reads readings recorded for another purpose; a gated set leaves its base when a caller's listing must keep its meaning; and the _VOCAB_FIELDS rosters.

Checks

  • uv run pytest, and -n0 -m serial.
  • --python 3.15, mypy and ruff.
  • The sphinx doctest build, README doctest, and tools/vocab/build.py --check.
  • A code review with the sweeps and a design-docs review, then a second review of the fix commit. Each round's findings are fixed and recorded in decisions/H9: a period-joined title losing its tag, a trailing modifier losing H5's title, Mr. and Mrs. Wing Lau, v1 titles.clear(), and of after a modifier. Two more rounds on the Grace change: the phrase test is cached per vocabulary (it had cost 175 more frames on every name opening with Grace) and counts only phrases the parse can read.

Refs #752, #853, #348.

🤖 Generated with Claude Code

… phrase (#752, phase 2i)

rules/H9, the title phrase. A title with a given reading (dean, justice,
major) compiles into TITLES_AMBIGUOUS instead of TITLES and is a title
only beside a partner: a modifier or style before it, a title that
attaches to it, or `of` after it, never a salutation (#853's rule).
Outside a phrase it reads as an unlisted word, reported title-or-name
where it opens the name. A modifier in the leading run of titles is a
title only with a head title after it, `of` after it, or in the object
of `of`/`the` there (decision 10, at the head only).

`attaches` gains its meaning (TITLE_PHRASES); new Lexicon fields
titles_ambiguous, title_modifiers, title_styles, title_phrases.
resident/rt/pro, d'affaires and member reclassified; thirteen
salutations' given counts move into notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added enhancement breaking-change Backwards-incompatible API change design vocabulary Per-word vocabulary model and language packs labels Oct 26, 2026
@derek73 derek73 self-assigned this Oct 26, 2026
derek73 and others added 4 commits October 26, 2026 10:25
…ame; grace, marshal, sergeant major; coverage
…shal phrase-only; attaches may name a word

- the title-or-name report is silent where a family comma has marked the
  given name (SMITH, DEAN)
- grace (style) and marshal (military) gain given readings: His Grace,
  Field Marshal read as titles; marshal's #606 exclusion replaced
- attaches may name a title word: sergeant/sgt attach to major, major to
  general, so Sgt Marshal Smith keeps given Marshal
- a style or modifier before a contested word is a partner only where it
  is read as a title (Grace Dean Smith)
- drop a dead given-title tag line in classify; shim mirrors titles_ambiguous
- Mr Justice: PSC's 17 salutation + Justice records all file Justice as a
  forename; no exception

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hase 2i)

Derek's answer to the `Grace` report volume: a title that may be a
given name and that no phrase in `title_phrases` holds is a title only
behind a style or a modifier (`His Grace`), so standing alone it is no
fork a reader hesitates over. `Grace Smith` and `GRACE SMITH` report
nothing; `Dean Smith`, `Marshal Yanda`, `Justice Smith` and `Major
Smith` still report, each held by a phrase (`chief` attaches to office
and military; `major` attaches to `general`). Derived from the phrases
`attaches` compiles, no new property.

Measured against master a46b3a6 with --base: ctgov 195 moved, 117
report-only (was 318/240); tse 25, 16 report-only (was 94/85); FEC 53,
unchanged. rules/H9 and decisions/H9 amended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 2.7 milestone Oct 26, 2026
derek73 and others added 3 commits October 26, 2026 13:07
…se 2i)

The review of 2aebd82:
- in_a_title_phrase split every phrase per call, 175 frames on each name
  opening with Grace; the phrase words are now cached per vocabulary, as
  _marker_heads is (163 frames, below the parent's 169).
- it counted phrases classify never reads (a caller's 'your grace', a
  three-word phrase), so one made Grace report; only two-word phrases of
  titles count now, as title_phrases' docstring says.
- rules/H9's reason omitted 'of' after the word, which every contested
  word takes as a partner ('Grace of Monaco'); the rule, the code quotes
  and the release log say so now.
- the titles_ambiguous and TITLE_OR_NAME docstrings name the condition.
- 'Justice Smith' and 'Major Smith' rows pin the report surviving.

No reading of the default vocabulary moves: its phrase words are the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second review of d730db9: title_phrases' docstring said a phrase
needs both words in titles, where classify and the report read titles
or titles_ambiguous; and titles_ambiguous' said any phrase holding the
word makes it report, where only a readable one does. decisions/H9's
frame figure now says 175 more (344 against 169).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-of-name-c36590

# Conflicts:
#	docs/design/decisions/vocabulary-model.md
#	docs/release_log.rst
#	tests/v2/test_cases.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Backwards-incompatible API change design enhancement vocabulary Per-word vocabulary model and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant