Skip to content

Read Maj as a given name outside a title phrase (#999) - #1027

Merged
derek73 merged 7 commits into
masterfrom
claude/999-maj-given-name-7b287a
Nov 3, 2026
Merged

derek73 merged 7 commits into
masterfrom
claude/999-maj-given-name-7b287a

Conversation

@derek73

@derek73 derek73 commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Closes #999.

Maj (Major written short) is also a Scandinavian given name, and parse() read it as a title wherever it opened a name. It is now a title only inside a title phrase (rules/H9, the title phrase), as Dean, Prince and King are.

"Maj Sjöwall"           before: title='Maj'        now: given='Maj'   (title-or-name reported)
"Mr Maj Zura"           before: title='Mr Maj'     now: title='Mr', given='Maj'
"Maj Gen John Smith"    title='Maj Gen'            unchanged ('maj' attaches to 'gen', 'general')
"Sgt Maj John Smith"    title='Sgt Maj'            unchanged ('sgt', 'sergeant' attach to 'maj')
"Major Gen John Smith"  before: given='Major'      now: title='Major Gen'
"Maj. John Smith"       title='Maj.'               unchanged (H2's shape)
"SMITH, JOHN B. MAJ."   title='MAJ.'               unchanged (H5, below)
"MAJ Ian Stewart, MD"   before: title='MAJ'        now: given='MAJ'   (accepted cost)

The trailing rank: H5 reads a title written short

FEC writes the rank last (SMITH, JOHN B. MAJ.). H5 (the trailing title run) reads only TITLES, and a gated word isn't in it, so the gate alone would have moved 73 FEC rows to middle B. MAJ.. The chain now also takes a gated title whose title reading is marked written short. The mark is a new behavioral title property, abbreviation = true, compiled into a private TITLE_ABBREVIATIONS set; today only maj carries it.

The scope is narrow on purpose. Widening it to every period-marked gated title moved no corpus row, but it would have reversed the trailing reading phase 2j recorded for 28 other words (John Karimi Mahdi. → family Mahdi.). A period on a word written short marks the word as cut short; on a full word it is no such sign. This was decided narrow, recorded in decisions/H5.

P5's bound-given join now declines the word as it declines Prof. (Smith, abdul Maj. → title Maj.); the comma-shape sweep found this.

Measured

Against master 95475304, over every local-corpus text holding maj or a gated title (30,367, distinct within each corpus). 65 texts move, all of them maj texts:

  • 47 given names fixed (orcid 21, jrc 13, patentsview 6, ctgov 5, psc 2).
  • 16 bare ranks now read as given names (ctgov 8, fec 3, jrc 3, orcid 1, psc 1). This is rules/H9's new Accepted bullet; a capitals signal to keep ctgov's MAJ ranks was declined.
  • 2 unclear.

FEC's 73 trailing MAJ. rows do not move.

measure.py --base gives the same per-corpus moves. CLDR, GND and cz-candidates agreement don't move. Box agreement: orcid 19 progress and 3 changed, patentsview 6 progress, psc 2 progress and 1 regression. JRC spelling consistency: 1 person now alike, 0 apart.

The committed snapshot moves only by the new rules examples.

Docs

  • Rules: rules/H5 gains a Precedence bullet. Its signal stays H5's own: period-marked title vocabulary, now one property of it. rules/H9 gains examples, a Precedence bullet pointing to H5, and an Accepted bullet. Both rules grow in rules_budget.json; the Accepted bullet reads no new signal and declines the capitals one.
  • Decisions: decisions/H5 and decisions/H9 get Standing lines and dated entries with the recompute recipe.
  • Other files: the vocab README gets the property, AGENTS.md gets the set, and the release log gets a bullet. nameparser/vocab/AGENTS.md records the check the review found missing: list the phrases other words make with a gated title, as sgt makes with maj.

Review

Two design-docs review rounds, on the change and on its fixes. Everything they found is fixed in the later commits.

A third round (code, test-coverage and comment reviews) found three more things, all fixed in the last two commits:

  • _pieces._weighed asked H5's question without the mark, so Freiherr Mc Maj. V reported suffix-or-name.
  • The maiden take's candidate read and a caller's abbreviation= had no test that fails when they break; the candidate grid now holds Maj., and the dropped-mark mutation fails it.
  • Comments the change had made stale are corrected.

Checks run: full suite, -m serial benchmarks, the suite on 3.15, mypy, ruff, the Sphinx doctests, build.py --check, and the comma-shape and name-order sweep.

🤖 Generated with Claude Code

derek73 and others added 4 commits November 3, 2026 01:06
`maj` gains a dated given reading (a Scandinavian given name; nam_dict
band 8 in Sweden) and is a title only inside a title phrase: `Maj
Sjöwall` reads given 'Maj', reported title-or-name. It attaches to
`gen` and `general`, and `major` now attaches to `gen` too, so `Maj
Gen John Smith` and `Major Gen John Smith` read the title.

H5's trailing chain takes a title that may be a given name where its
title reading is written short: a new behavioral title property,
`abbreviation`, compiled into TITLE_ABBREVIATIONS and marked by
classify, so FEC's `SMITH, JOHN B. MAJ.` keeps title 'MAJ.' while
phase 2j's `John Karimi Mahdi.` keeps family 'Mahdi.'. P5's join
declines the word as it declines `Prof.` (`Smith, abdul Maj.`).

Measured against 9547530 over the local corpora: 65 texts move, 47
given names fixed, 16 bare ranks now read as given names (rules/H9's
Accepted clause), 2 unclear; FEC's 73 trailing ranks do not move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`sgt` and `sergeant` attach to `maj` as to `major`, so `Sgt Maj John
Smith` keeps its title phrase. rules/H9's Accepted bullet reaches the
given part after a family comma (`NOLEN, MAJ MAUREEN`). decisions/H9
records `Maj. Smith, John` reading family 'Maj. Smith' (H6 peels by
vocabulary alone); decisions/H5 counts the wide scope's 28 other words,
states which gate the 73 FEC rows were measured under, and no longer
says a modifier is excluded by the code; the population is distinct
within each corpus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added bug design Changes what the model can express (a shape decision) vocabulary Fixed by a word-list entry: per-word vocabulary and language packs labels Nov 3, 2026
@derek73 derek73 self-assigned this Nov 3, 2026
@derek73 derek73 added this to the 3.0 milestone Nov 3, 2026
derek73 and others added 3 commits November 3, 2026 01:33
…ts (#999)

`_pieces._weighed` asked H5's question with `vocab:title` alone, so a
gated `Maj.` inside a particle chain stopped counting as a word of its
own and `Freiherr Mc Maj. V` reported suffix-or-name where `Prof.` does
not; it now reads TRAILING_TITLE_TAG too (found by the code review).

Comments the change had made stale: the trailing chain's and H6's
claims that they share one title read, `_KIND_TAGS`, classify's Reads:
line and tag list, the four inline tests, the tag's writer and readers,
`_LexiconSets.title_abbreviations`, `Lexicon.add`'s property list and
docs/customize.rst's (found by the comment review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test review found the maiden take's candidate read untested for a
title written short: dropping the mark from `is_trailing_title_word`
failed nothing, though `Jane Smith née Doe Maj.` read maiden 'Doe Maj.'.
'Maj.' joins the candidate grid (the mutation now fails it) and rules/H5's
maiden bullet gains the example. A caller's `abbreviation=` now has a
parse test both ways, with a pickle round-trip, and a refusal row. The
two translation-table entries for `title_abbreviations` are dropped:
no 2.x state holds the field and no path reaches them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n-name-7b287a

# Conflicts:
#	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

bug design Changes what the model can express (a shape decision) vocabulary Fixed by a word-list entry: per-word vocabulary and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should Maj read as a given name in Maj Sjöwall, as Prince does, when FEC writes the rank trailing (SMITH, JOHN B. MAJ.)?

1 participant