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
1 change: 1 addition & 0 deletions docs/design/decisions/H2-leading-abbreviation-title.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Decided 2026-09-08 (was Open: [#316](https://github.com/derek73/python-nameparse

- 2026-09-10 — the shape declines a word carrying a script with no initials (#323); the argument, the halfwidth-kana limit and the measurements are in #cjk-full-stops. That limit was closed on 2026-10-03 by #594, which classifies halfwidth katakana (decisions/W4).

- 2026-10-20 (Derek), #761 — C13 WINS OVER H2 FOR A CREDENTIAL OPENING THE PART AFTER A FAMILY COMMA. The H section's skeleton migration (PR #779) found the two rules each claiming `Smith, Esq. John`: rules/H2 made an abbreviation opening the part after a family comma a title "even when the word is suffix vocabulary", with an exception only for a part that is nothing but suffix words (C8), while rules/C13 makes a credential opening that part the postnominal part however it goes on. The parser already read it C13's way, suffix 'Esq. John' with `suffix-or-name` under all three orders, and neither rule said so. Derek decided C13 wins, with no behavior change; rules/H2 gains the Precedence bullet and its Then names the exception. What the win covers was measured over the suffix vocabulary, each alphabetic word of two or more letters written title-case with a period in `Smith, <word> John` (2026-10-20, py3.11, the tree at #779): 666 words read as the postnominal part, and 22 still read as a title by H2's shape — the 12 title/suffix duals (`Cpl.`), 7 ambiguous acronyms (`Ma.`, `Do.`) and `Abd.`, `Mc.` and `Vd.` — none of them a word that starts S8's run. So the bullet is scoped to C13's own words rather than to every listed suffix word, which Derek confirmed once shown the 22 (keeping the parse unchanged), and `Smith, Ma. John` is an example beside `Smith, Esq. John` and the unlisted `Smith, Insp. John`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# H7 — a joined name unit carrying title vocabulary

## Standing

- A name unit of more than one word carrying title vocabulary reports `title-or-name`, stated in a rule of its own, split out of rules/H4 — 2026-10-20 #761.

Elsewhere: the clause itself (its reach to every such join, the hoist past a peeled title, a maiden name or a claimed word, and the two corpus names it reached) was decided under decisions/H4, in its 2026-09-07 #491 entry and its 2026-09-08 #518 review-round entry.

Open: none in this file.

## Log

- 2026-10-20 (Derek), #761 — THE JOIN CLAUSE IS A RULE OF ITS OWN. The H section's skeleton migration (PR #779) found rules/H4's join clause reaching past H4's own scope: H4 is about an input that holds no name word but vocabulary, while the join clause reports `title-or-name` for `Smith and King`, `John and King` and `Attorney General of Minnesota`, which hold ordinary words. Derek decided the clause moves to a new rule, with no behavior change. rules/H7 carries its text verbatim save two edits: "reports `title-or-name` as well" lost "as well", having no H4 statement beside it, and "the two corpus names the clause reaches" became "the two corpus names the clause reached on 2026-09-08", a dated count rather than a standing one, since the examples H7 gains put more names in the corpus. H4 keeps the "nothing but vocabulary" scope with a Then bullet pointing here, H7 points back for a unit of one word, and rules/O5's pointer names both. The examples are new: the old clause had none, its inputs being pinned in tests/v2/cases.py, so corpus_rules.jsonl gains its names; no reading moves.
1 change: 1 addition & 0 deletions docs/design/decisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Entry conventions:
- [H4 — an input that is nothing but vocabulary still has to name somebody](H4-input-that-is-nothing-but-vocabulary-still-has-to-name-somebody.md)
- [H5 — the trailing title run](H5-trailing-title-run.md)
- [H6 — a title before a family comma](H6-title-before-a-family-comma.md)
- [H7 — a joined name unit carrying title vocabulary](H7-joined-name-unit-carrying-title-vocabulary.md)

## Particles & surname prefixes (P)

Expand Down
169 changes: 69 additions & 100 deletions docs/design/rules/H1-title-and-one-name-word.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,72 @@
# H1 — a title and one name word

H1. Rationale: a title normally addresses by surname, so a title
followed by a single name word usually names the family; but a
given-name title addresses by given name. Several titles written
together are one form of address, and the one that does the
addressing is the last — the words in front of it rank the
person rather than name them. What stands beside the name word —
a suffix, a nickname, a maiden name — does not make the name any
longer, so it does not decide this reading. And a run written
BEHIND the one name word is the same form of address written on
the other side of it, so where no title run stands in front of
that word it decides the same reading. Where one does stand in
front, that run addresses: a title written behind the name is
the name plus that title (H5), and adding it cannot change how
the words in front of the name are read. Which side a title is
on is decided by the NAME WORD and by nothing else standing
beside it, so a run written around a nickname is one run: the
name Dr. 'Smitty' Sir John reads as Dr. Sir John does. A comma
with nothing but titles after it names no given part, so it says
nothing about which field the word before it fills, and neither
does a declared order, which places only a word nothing else
decided (O5): the title decides there as it does with no comma.
A title followed by exactly one name word makes that word the
family name, whatever suffix, nickname or maiden name stands
beside it, unless the title is a given-name title, which keeps
it the given name; a run of several titles addresses as its last
title does, and where a run stands BEFORE the one name word it
is the run that addresses, a run standing behind it deciding
that word's field only when none stands before; and a comma with
no given name after it does not decide the field, nor does a
declared order.
"Mr. Johnson" → family="Johnson"
"Mrs. Garcia" → family="Garcia"
"Dr. Smith née Jones" → family="Smith"
"Her Majesty Queen Elizabeth" → given="Elizabeth"
"Dr. Sir John" → given="John"
"Smith Sir." → given="Smith"
"Sir John Prof." → given="John"
"Dr. Smith Sir." → family="Smith"
"His Excellency Lord Duncan" → family="Duncan"
"Her Royal Highness Princess Anne" → given="Anne"
"Elizabeth II, Queen" → given="Elizabeth"
"John III, Sir" → given="John"
"Anne, Princess" → given="Anne"
"Sir John" family-first → given="John"
"Sir John" → given="John" · boundary
"John III, Dr." → family="John" · boundary
"van der Berg, Sir" → family="van der Berg" · boundary
"van Gogh, Sir" → family="van Gogh" · boundary
"Dr. Smith II, Sir" family-first → family="Smith" · boundary
Accepted: a given-name title plus one name word leaves the
family empty — the input names no family, and inventing one
would be worse. A run whose last title is a given-name title
reads the same way, `queen` doing the addressing where `her
majesty` only ranks.
"Sir John" → family=""
"Her Majesty Queen Elizabeth" → family=""
"Smith Sir." → family=""
Accepted: a listing record whose given field holds only a
given-name title reads that title's reading, so `Smith, Sir` (a
row with the given name missing) reads given `Smith` with the
family empty, as `Sir Smith` does: the input names one word and
one title, and the title is the only evidence there is. A
particle surname standing alone before the comma stays the
family, the comma being the evidence that the part is a surname
(C3), and so does a never-given particle with a word behind it
and no comma (P1's fold); an ambiguous particle no comma settled,
or a bare one, is a word the order placed, and reads given. 1.4.0
read the word before the comma as the last name in these rows
(`Elizabeth II, Queen`, `John III, Sir`, `Smith, Sir`) but for
`Anne, Princess`, which it read as first `Anne`.
"Smith, Sir" → family=""
"Sheik Abu Bakar" family-first → given="Abu Bakar"
"Sir de Mesnil" family-first → family="de Mesnil"
"Sir de" family-first → given="de"
"St Sir de Mesnil" family-first → given="de Mesnil"
Accepted: a title word in the run that no vocabulary knows does
not change what the run addresses by, the last word being the
one asked — `His Excellency Lord Duncan` reads family `Duncan`
because `lord` is not a given-name title, not because the run is
long. `lord` and `lady` stay out of that list by decision
(#519): each addresses by given name only as a courtesy style for
children of the senior ranks (`Lord Peter`, `Lady Diana`) and by
title or surname for every peer and every wife (`Lord Byron`,
`Lady Thatcher`), and the text does not say which the bearer is,
which the list cannot express; `prince` and `princess` are in it.
Accepted: a title word that is also borne as a name, though
rarely as the first word of one (`graf`, `greve`, `herra`), is
the title in front of a name, so a name that BEGINS with it -- a
surname written first without a comma, or a given name -- gives
that word to the title, under a declared family-first order too.
Written last without a period, or alone before a family comma,
it is the name; a period behind it makes it the title by H5, as
for `Mary Jane King.` (#606), and a name word behind it before
a family comma makes it the title by H6.
"Greve Smith, Anna" → title="Greve"
"Greve Anna" → family="Anna"
"Anna Greve" → family="Greve"
"Greve, Anna" → family="Greve"
Signal: a count: exactly one name word beside a title run, read by the run's addressing title
history: decisions/H1 · interacts: C3, C8, O5, H3, H5, H6, P2, P3, P5, M2, S1, S2, N1, N3 · implemented: nameparser/_pipeline/_post_rules.py
**When:** a title or a run of titles stands beside exactly one name word, as in "Mr. Johnson".

**Then:** a title followed by exactly one name word makes that word the family name, whatever suffix, nickname or maiden name stands beside it, unless the title is a given-name title, which keeps it the given name; a run of several titles addresses as its last title does, and where a run stands before the one name word it is the run that addresses, a run standing behind it deciding that word's field only when none stands before.

- **A run written behind the one name word** is the same form of address written on the other side of it, so where no title run stands in front of that word it decides the same reading. Where one does stand in front, that run addresses: a title written behind the name is the name plus that title (H5), and adding it cannot change how the words in front of the name are read.
```
"Smith Sir." → given="Smith"
"Sir John Prof." → given="John"
"Dr. Smith Sir." → family="Smith"
"Dr. Smith II, Sir" family-first → family="Smith" · boundary
```
- **Which side a title is on is decided by the name word** and by nothing else standing beside it, so a run written around a nickname is one run: the name Dr. 'Smitty' Sir John reads as Dr. Sir John does.
- **Neither a comma with nothing but titles after it nor a declared order decides the field.** A comma with nothing but titles after it names no given part, so it says nothing about which field the word before it fills: a comma with no given name after it does not decide the field, nor does a declared order, which places only a word nothing else decided (O5), and the title decides there as it does with no comma.
```
"Elizabeth II, Queen" → given="Elizabeth"
"John III, Sir" → given="John"
"Anne, Princess" → given="Anne"
"Sir John" family-first → given="John"
"John III, Dr." → family="John" · boundary
```

**Because:** a title normally addresses by surname, so a title followed by a single name word usually names the family; but a given-name title addresses by given name. Several titles written together are one form of address, and the one that does the addressing is the last — the words in front of it rank the person rather than name them. What stands beside the name word — a suffix, a nickname, a maiden name — does not make the name any longer, so it does not decide this reading.

```
"Mr. Johnson" → family="Johnson"
"Mrs. Garcia" → family="Garcia"
"Dr. Smith née Jones" → family="Smith"
"Her Majesty Queen Elizabeth" → given="Elizabeth"
"Dr. Sir John" → given="John"
"His Excellency Lord Duncan" → family="Duncan"
"Her Royal Highness Princess Anne" → given="Anne"
"Sir John" → given="John" · boundary
```

**Except:**

- **A particle surname a comma or P1's fold settled keeps the family.** A particle surname standing alone before the comma stays the family, the comma being the evidence that the part is a surname (C3), and so does a never-given particle with a word behind it and no comma (P1's fold).
```
"van der Berg, Sir" → family="van der Berg" · boundary
"van Gogh, Sir" → family="van Gogh" · boundary
"Sir de Mesnil" family-first → family="de Mesnil"
```

**Accepted:**

- A given-name title plus one name word leaves the family empty — the input names no family, and inventing one would be worse. A run whose last title is a given-name title reads the same way, `queen` doing the addressing where `her majesty` only ranks.
```
"Sir John" → family=""
"Her Majesty Queen Elizabeth" → family=""
"Smith Sir." → family=""
```
- A listing record whose given field holds only a given-name title reads that title's reading, so `Smith, Sir` (a row with the given name missing) reads given `Smith` with the family empty, as `Sir Smith` does: the input names one word and one title, and the title is the only evidence there is. 1.4.0 read the word before the comma as the last name in these rows (`Elizabeth II, Queen`, `John III, Sir`, `Smith, Sir`) but for `Anne, Princess`, which it read as first `Anne`. An ambiguous particle no comma settled, or a bare one, is a word the order placed, and reads given.
```
"Smith, Sir" → family=""
"Sheik Abu Bakar" family-first → given="Abu Bakar"
"Sir de" family-first → given="de"
"St Sir de Mesnil" family-first → given="de Mesnil"
```
- A title word in the run that no vocabulary knows does not change what the run addresses by, the last word being the one asked — `His Excellency Lord Duncan` reads family `Duncan` because `lord` is not a given-name title, not because the run is long. `lord` and `lady` stay out of that list by decision (#519): each addresses by given name only as a courtesy style for children of the senior ranks (`Lord Peter`, `Lady Diana`) and by title or surname for every peer and every wife (`Lord Byron`, `Lady Thatcher`), and the text does not say which the bearer is, which the list cannot express; `prince` and `princess` are in it.
- A title word that is also borne as a name, though rarely as the first word of one (`graf`, `greve`, `herra`), is the title in front of a name, so a name that BEGINS with it -- a surname written first without a comma, or a given name -- gives that word to the title, under a declared family-first order too. Written last without a period, or alone before a family comma, it is the name; a period behind it makes it the title by H5, as for `Mary Jane King.` (#606), and a name word behind it before a family comma makes it the title by H6.
```
"Greve Smith, Anna" → title="Greve"
"Greve Anna" → family="Anna"
"Anna Greve" → family="Greve"
"Greve, Anna" → family="Greve"
```

---
**Signal:** count: exactly one name word beside a title run, read by the run's addressing title
**history:** decisions/H1 · **implemented:** nameparser/_pipeline/_post_rules.py
Loading
Loading