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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ Don't use the bare `python3 -m doctest <file>.rst` CLI (no `optionflags`) to che

**`pr/NNN` local branches** track upstream PRs — don't commit to them by accident. Check `git branch --show-current` before starting work.

**Title vs suffix is positional for BARE words, and the leading period-abbreviation rule overrides even that** — a word matching `TITLES` at the front of a name becomes `title`; the same word matching `SUFFIX_ACRONYMS`/`SUFFIX_WORDS` at the end becomes `suffix` (never both, regardless of the word's real-world meaning). The `TITLES`/suffix overlap was audited in #296 (2026-08-23): the pure postnominals (`jr`, `junior`, `phd`, `do`, `se`) left `TITLES`, the v1-residue `dr`/`sra` left the suffix sets, and the eleven words in both on 2026-11-21 (`ms`, `sr`, `lt`, `ra`, `vc`, the ranks `cpl`, `cpo`, `cpt`, `csm`, `sgm`, and since #1128 the Cyrillic `д-р`; `md` and `sa` were duals too until #853 took `md`'s title reading out, a leading `Md` being the given name Muhammad, and #857 took `sa` out of the vocabulary) are deliberate duals that position decides (recount with `L = Parser().lexicon._sets; sorted(L.titles & (L.suffix_acronyms | L.suffix_words))`). External test sources (old issue gists, etc.) sometimes assert `suffix` for a leading professional abbreviation like `RA`/`PD`/`Dipl.-Ing.` — that's the source data being wrong, not a parser bug. Verify position before "fixing" it. Two qualifications the older "purely positional" wording papered over, the first measured 2026-08-01 and the second answered 2026-09-08 (#316): a PERIOD-marked leading word is claimed by the shape rule before any vocabulary is read (`"Esq. Smith"` → `title`, though `esq` is suffix-only), save a listed title and, since #789, a given name written short (`"Chas. Smith"` → `given`), while a run of single letters, which the shape rule never takes, is a title at the head only by rules/H10's vocabulary (`"U.S. Senator John Smith"` → `title='U.S. Senator'`), and a PERIOD-marked trailing word is claimed by VOCABULARY — first the suffix sets, which the peel reads before anything else (`"John Smith Esq."` → `suffix`), then the titles (`"John Smith Prof."` → `title='Prof.'`, `rules/H5`) — while an unlisted abbreviation there stays a name part (`"John Smith Xyz."` → `family='Xyz.'`) unless it is written as two or more period-separated chunks, which since 2.4 IS a trailing shape rule (`Policy.unlisted_dotted_suffixes`, default on: `"John Smith X.Y.Z."` → `suffix='X.Y.Z.'`, read by the same words-to-spare count a bare ambiguous acronym takes, `rules/S3`), except paired initials in a script with capitals, which stay a name word (`"Ram Bahadur B.K."` → `family='B.K.'`, #864). The SINGLE trailing period is still not one, deliberately — it is the abbreviation shape any word can wear. The bare word is where "positional" still holds whole -- outside a part past the second comma, which holds no name word, so C2 reads a bare title word there as a title since #603 (`Eric H. Holder, Jr., Attorney General`), and outside a listed salutation ending the given part after a family comma, which rules/H8 reads as the title since #835 (`Doe, Jane Mrs`), the comma having marked the surname's place -- and the reason it must: `TITLES` holds words that are in no suffix set — 787 of them on 2026-10-11 (746 before #606's salutations), measured with `L = Parser().lexicon._sets; len(L.titles - L.suffix_acronyms - L.suffix_words)`, a figure that grows with the vocabulary and never shrinks the argument — and many are ordinary surnames (`pope`, `bishop`, `judge`, `sheriff`, `baron`, `master`, ...), so a vocabulary-first rule over BARE trailing words would read `"Mary Jane Pope"` as `title='Pope'`, `family='Jane'`. The period is what separates the safe case from that one, and it separates it by being a WRITING convention rather than by making the collision go away: `"Mary Jane Pope"` keeps `family='Pope'` while `"Mary Jane Pope."` reads `title='Pope.'`, `family='Jane'`, a cost accepted under the input-is-a-name premise rather than one the rule prevents (the trailing-position bullet in decisions/vocabulary-exclusions, measured 2026-09-09). Since #316 that sentence describes the shipped rule rather than an aspiration.
**Title vs suffix is positional for BARE words, and the leading period-abbreviation rule overrides even that** — a word matching `TITLES` at the front of a name becomes `title`; the same word matching `SUFFIX_ACRONYMS`/`SUFFIX_WORDS` at the end becomes `suffix` (never both, regardless of the word's real-world meaning). The `TITLES`/suffix overlap was audited in #296 (2026-08-23): the pure postnominals (`jr`, `junior`, `phd`, `do`, `se`) left `TITLES`, the v1-residue `dr`/`sra` left the suffix sets, and the ten words in both on 2026-11-21 (`ms`, `sr`, `lt`, `vc`, the ranks `cpl`, `cpo`, `cpt`, `csm`, `sgm`, and since #1128 the Cyrillic `д-р`; `md`, `sa` and `ra` were duals too until #853 took `md`'s title reading out, a leading `Md` being the given name Muhammad, #857 took `sa` out of the vocabulary, and #1483 gave `ra` a Korean name reading, which makes its title one only inside a title phrase, rules/H9) are deliberate duals that position decides (recount with `L = Parser().lexicon._sets; sorted(L.titles & (L.suffix_acronyms | L.suffix_words))`). External test sources (old issue gists, etc.) sometimes assert `suffix` for a leading professional abbreviation like `PD`/`Dipl.-Ing.` — that's the source data being wrong, not a parser bug. Verify position before "fixing" it. Two qualifications the older "purely positional" wording papered over, the first measured 2026-08-01 and the second answered 2026-09-08 (#316): a PERIOD-marked leading word is claimed by the shape rule before any vocabulary is read (`"Esq. Smith"` → `title`, though `esq` is suffix-only), save a listed title and, since #789, a given name written short (`"Chas. Smith"` → `given`), while a run of single letters, which the shape rule never takes, is a title at the head only by rules/H10's vocabulary (`"U.S. Senator John Smith"` → `title='U.S. Senator'`), and a PERIOD-marked trailing word is claimed by VOCABULARY — first the suffix sets, which the peel reads before anything else (`"John Smith Esq."` → `suffix`), then the titles (`"John Smith Prof."` → `title='Prof.'`, `rules/H5`) — while an unlisted abbreviation there stays a name part (`"John Smith Xyz."` → `family='Xyz.'`) unless it is written as two or more period-separated chunks, which since 2.4 IS a trailing shape rule (`Policy.unlisted_dotted_suffixes`, default on: `"John Smith X.Y.Z."` → `suffix='X.Y.Z.'`, read by the same words-to-spare count a bare ambiguous acronym takes, `rules/S3`), except paired initials in a script with capitals, which stay a name word (`"Ram Bahadur B.K."` → `family='B.K.'`, #864). The SINGLE trailing period is still not one, deliberately — it is the abbreviation shape any word can wear. The bare word is where "positional" still holds whole -- outside a part past the second comma, which holds no name word, so C2 reads a bare title word there as a title since #603 (`Eric H. Holder, Jr., Attorney General`), and outside a listed salutation ending the given part after a family comma, which rules/H8 reads as the title since #835 (`Doe, Jane Mrs`), the comma having marked the surname's place -- and the reason it must: `TITLES` holds words that are in no suffix set — 787 of them on 2026-10-11 (746 before #606's salutations), measured with `L = Parser().lexicon._sets; len(L.titles - L.suffix_acronyms - L.suffix_words)`, a figure that grows with the vocabulary and never shrinks the argument — and many are ordinary surnames (`pope`, `bishop`, `judge`, `sheriff`, `baron`, `master`, ...), so a vocabulary-first rule over BARE trailing words would read `"Mary Jane Pope"` as `title='Pope'`, `family='Jane'`. The period is what separates the safe case from that one, and it separates it by being a WRITING convention rather than by making the collision go away: `"Mary Jane Pope"` keeps `family='Pope'` while `"Mary Jane Pope."` reads `title='Pope.'`, `family='Jane'`, a cost accepted under the input-is-a-name premise rather than one the rule prevents (the trailing-position bullet in decisions/vocabulary-exclusions, measured 2026-09-09). Since #316 that sentence describes the shipped rule rather than an aspiration.

### Tests (`tests/`)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Standing

- Inside a comma part a one-character suffix word is read by what stands before it: behind another suffix word it continues the run, with a period or without (`Smith, PSM I` → suffix 'PSM I'; `Smith, PSM I.` → suffix 'PSM I.'), and behind a name word an ASCII period makes it a middle initial while the bare letter, with no further comma after it, is the suffix (`Smith, John V.` → middle 'V.'; `Smith, John V` → suffix 'V', v1 parity) — 2026-08-25 #430.
- The class is one-character suffix vocabulary, not a roman numeral (`Smith, John 2.` → middle '2.'), and a run's first word that is title vocabulary too stays in the run (`Smith, RA I` → suffix 'RA I'; `Smith, Jr. I` → suffix 'Jr. I') — 2026-08-25 #430.
- The class is one-character suffix vocabulary, not a roman numeral (`Smith, John 2.` → middle '2.'), and a run's first word that is title vocabulary too stays in the run (`Smith, VC I` → suffix 'VC I'; `Smith, Jr. I` → suffix 'Jr. I') — 2026-08-25 #430.
- The given part asks no initial in front of a numeral, the no-comma reading of one, so a numeral behind an initial stays the suffix (`Chang, Andy C I` → middle 'C', suffix 'I') — 2026-08-25 #430.
- A lone letter ending the given part ahead of a further comma is the middle initial whatever stands before it, a credential run in front stopping short of it (`Smith, John PhD I, Jr.` → middle 'I', suffix 'PhD, Jr.'), at the cost of splitting a certification level from its credential (`Smith, John PSM I, Jr.`) — 2026-10-25 #819.
- The given part's walk asks the numeral's predicate, which reads a one-letter numeral there by the vocabulary, so an unlisted letter stays the middle initial (`SMITH, JOHN X`), and a numeral of two or more letters as the generation (`Smith, John VI` → suffix 'VI') — 2026-10-25 #819.
Expand Down
2 changes: 1 addition & 1 deletion docs/design/decisions/H3-title-runs-floor.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- The leading title run gives back its last word where everything behind the run is suffix pieces and that word is not suffix vocabulary: `Dr Pope Jr` → title 'Dr', family 'Pope', suffix 'Jr' — 2026-09-08 #316.
- It gives back one word only: a joined title unit stays the title (`Prince of Wales Jr` → family 'Jr'), and where the word given back is the whole name it reads as the given name (`Dr Jr` → given 'Dr', suffix 'Jr', reporting `title-or-name`) — 2026-09-08 #316.
- The floor asks about the run's last word and nothing else: a run ending in suffix vocabulary keeps it (`Dr Pope RA PhD` → title 'Dr Pope RA'), and a bare numeral behind the run is the numeral fork's, not this floor's (`Dr Pope V` → title 'Dr Pope', given 'V') — 2026-09-08 #316.
- The floor asks about the run's last word and nothing else: a run ending in suffix vocabulary keeps it (`Dr Pope VC PhD` → title 'Dr Pope VC'), and a bare numeral behind the run is the numeral fork's, not this floor's (`Dr Pope V` → title 'Dr Pope', given 'V') — 2026-09-08 #316.

Open: none in this file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- An input the title peel eats down to one last word that is itself title vocabulary reads that word as the name and reports `title-or-name`, the `detail` naming the word: `Lord Chancellor` → family 'Chancellor', `Dr. Pope` reports — 2026-09-07 #491.
- `title-or-name` is emitted at assign's lone-name-word site, not at H1's retag, so it is reported under every name order, and so is the suffix half's `suffix-or-name`; the peel half's `detail` names no field — 2026-09-07 #491.
- Nothing is reported where no word was chosen or where the word left standing is no title word: a title alone or a title run with nothing behind it (`Dr.`, `Prince of Wales`), and a title before an ordinary word (`Dr. Smith`) — 2026-09-07 #491.
- An input whose every word is post-nominal vocabulary reads its first word as the name and reports `suffix-or-name` (`Rinpoche`, `QC MP` → given 'QC', `PhD`), reached only where no title was peeled (`RA DDS` reports nothing) and not with a maiden name beside it (`abd née Jones`) or for a lone CJK honorific a script order placed (`さん`); `Jr.` alone is H2's title — 2026-09-07 #491.
- An input whose every word is post-nominal vocabulary reads its first word as the name and reports `suffix-or-name` (`Rinpoche`, `QC MP` → given 'QC', `PhD`), reached only where no title was peeled (`VC DDS` reports nothing) and not with a maiden name beside it (`abd née Jones`) or for a lone CJK honorific a script order placed (`さん`); `Jr.` alone is H2's title — 2026-09-07 #491.
- `MA` alone reports `given-or-family` where `PhD` alone reports `suffix-or-name`, an asymmetry between this rule and O5 recorded and not fixed — 2026-09-07 #491.
- A lone name unit that is a join carrying title vocabulary reports `title-or-name` too (`John of Bishop`, `Smith and Bishop`; `prince` was the example until it left TITLES on 2026-10-27, decisions/H9), stated since 2026-10-20 as rules/H7 — 2026-09-07 #491.
- The join clause (rules/H7's, recorded here) stands beside the peel clause, so a peeled title, a maiden name or a claimed word does not silence it (`Dr. Smith and Bishop`, `van and Bishop`, `Attorney General of Minnesota` report) — 2026-09-08 #518.
Expand Down
2 changes: 1 addition & 1 deletion docs/design/decisions/H6-title-before-a-family-comma.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- A run of title words opening the part before a family comma is the title, joining the title field in input order with any title after the comma, and the comma decision is untouched, so the reading is the same under every name order: `Dr. Smith, John` → title 'Dr.', family 'Smith'; `Prof. Dr. Brühl, Ada Cornelia` → title 'Prof. Dr.' — 2026-10-17 #701.
- The run admits a word by vocabulary only, never by H2's shape, since the slot is a surname's slot too and a period-marked word there is as often a surname's abbreviated head, a given name written short or a stray period as a title: `Xyz. Smith, John` → family 'Xyz. Smith', `Mt. Pleasant, Jane` → family 'Mt. Pleasant'. `Sta. Maria, Juan` → family 'Sta. Maria' is the particle stop's since #725, which a shape peel would have to keep. A title missing there is fixed by listing it, a given name written short by a `given` reading with `same_as`, and a stray period reads where the rules put it — 2026-10-17 #701; 2026-10-18 #710; 2026-11-06 #1115.
- The run leaves the family its last piece (`Dr., John` → family 'Dr.'), stops at a word that is a particle too (`St Pierre, Ed` and `Freiherr von Berg, Ed` keep their families, while `Dr. Freiherr von Berg, Ed` peels 'Dr.'), and stops where nothing but post-nominals stands behind a title (`RA PhD Jr., John` → family 'RA'), so a title/suffix dual with a name word behind it peels (`Rev. Sr. Smith, Mary` → title 'Rev. Sr.') — 2026-10-17 #701.
- The run leaves the family its last piece (`Dr., John` → family 'Dr.'), stops at a word that is a particle too (`St Pierre, Ed` and `Freiherr von Berg, Ed` keep their families, while `Dr. Freiherr von Berg, Ed` peels 'Dr.'), and stops where nothing but post-nominals stands behind a title (`VC PhD Jr., John` → family 'VC'), so a title/suffix dual with a name word behind it peels (`Rev. Sr. Smith, Mary` → title 'Rev. Sr.') — 2026-10-17 #701.
- A surname-like title opening a two-word surname is the title (`Pope Smith, John` → title 'Pope'), an accepted cost — 2026-10-17 #701.
- `gov` is a title (`Lt. Gov. Smith, John` → title 'Lt. Gov.'), the first piece the run leaves is the family whatever it is (`Dr. PhD Smith, John` → family 'PhD Smith'), and the particle stop is all that keeps a rank in the family, so `Herzog Lambsdorff, Otto` reads title 'Herzog' (`Graf Lambsdorff, Otto`, a rank particle since decisions/vocabulary-collisions' 2026-11-04 (Derek), #709 entry, keeps family 'Graf Lambsdorff') — 2026-10-17 #701.
- The comma-less writing of an abbreviated surname is not this rule's; `sta` and `sto` are saint particles, so `Juan Sta. Maria` reads family 'Sta. Maria' and `Juan Sta. Maria Reyes` family 'Sta. Maria Reyes' — 2026-10-18 #710; 2026-11-04 #725.
Expand Down
Loading