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
6 changes: 6 additions & 0 deletions docs/design/decisions/P3-connectives.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Examples read under the default order unless a line names another.
- With the off switch a one-case `i` is the initial its capital is (rules/S10), so `rovira, i` and `john smith i jr` read alike with it on and off; and a connective letter ending its part is not reported — 2026-10-18, #721.
- P3 keeps the join and its three-word count, and the single-letter connective read as an initial is rules/P8's, the entries deciding it having moved to decisions/P8 — 2026-10-19.
- A frozen link joins nothing of its own but a neighbour's join can absorb it: `i y Carod Rovira Puig` → given 'i y Carod' (the first example, `Josep Carod Rovira Puig y i`, reads family 'Puig y', suffix 'i' since rules/P13, decisions/P13) — 2026-10-19 #760.
- French `dit` and `dite` are connectives under a French choice only (`fr.toml`, `default = false`): `Jean Dupont dit Lebrun` reads family 'Dupont dit Lebrun' and `Mamadou dit Madou Traore` given 'Mamadou dit Madou' under it, and the default is unchanged — 2026-11-21 #1159.

Elsewhere: P3's joins are made before S2's trailing run is read, so the run counts a joined part as one name word (`Juan y Garcia X.Y.Z.` → family 'X.Y.Z.') and a salutation keeps its connective (`Mr. and Mrs.` → title 'Mr. and Mrs.') — decisions/S2's 2026-10-07 (Derek), #614 entry, indexed here by the 2026-10-07 #614 cross-reference. A declared separator in a trailing suffix part ends the search as a comma would, so a connective never joins across it — decisions/C10's 2026-10-03 (Derek), #549 entry, indexed here by the 2026-10-03 #549 cross-reference; C3's count of the words before a comma counts a connective surname's words (`Ortega y Gasset, Dr.` → given 'Ortega', middle 'y', family 'Gasset') — decisions/C1's 2026-10-06 (Derek), #613 entry.

Expand Down Expand Up @@ -63,3 +64,8 @@ Open: none in this file.
- 2026-10-18, #721 — THE OFF SWITCH NO LONGER RESTORES THE ONE-CASE ROLE MOVERS. With `i` removed from the conjunctions, a one-case `i` is a one-letter roman numeral, which since #721 is the initial its capital is (rules/S10), so `rovira, i`, `john smith i jr` and `maier, amy i, jr.` read with the switch off exactly as with it on, and as their all-caps twins read either way — where 2.3.0 read them as suffixes, the disagreement with the capitals that decisions/P3's 2026-09-20 bullet "ACCEPTED, AND THE HONEST STATEMENT OF THE ONE-CASE HALF" measured. The off-switch grid's property is unchanged, and these rows no longer lean on its exemption (2): the two readings now agree on them (on: `initial`; off: `initial`, where 2.3.0's off reading was not), so they pass on equal fields. The exemption still guards the rows it was written for (#721's design-docs review measured the rows only it saves falling from thousands on master to a few hundred, all of them a connective `i` before a strict-comma numeral such as `I ROVIRA, V` — a dated snapshot). And a connective letter ending its part is not reported (rules/P8, "unless nothing of its part stands to its right"): the fork had no other way to go.
- 2026-10-19 — RULE SPLIT: the single-letter connective read as an initial left rules/P3 for rules/P8, one rule per piece of evidence (docs/design/AGENTS.md), P3 keeping the join and its three-word count and P8 taking the case contrast. The entries deciding that half moved to decisions/P8 with it: #267 (2026-07-30), the #383 + #479 entry with its #528, #289/#516 and #492/#478 amendments, the two 2026-09-13 #383/#479 entries after it, and the 2026-09-24 #478 cross-reference. The #397 entries stay here, since `i` joining is P3's question, and so does #721's off-switch entry; where they say the one-case half or the marked subset, that half is rules/P8's now.
- 2026-10-19 #760 — SUPERSEDED IN PART 2026-11-05 (#1098): its example reads family 'Puig y', suffix 'i' since rules/P13 joins a connective with nothing to link to the word before it (decisions/P13), and `i y Carod Rovira Puig` shows the absorption instead. MOVED FROM group's code comment on the both-sides test, the one fact the #397 entries above did not hold. "No join of its own" is the whole claim a frozen link carries: a NEIGHBOUR's join can still absorb it, since both loops of `join_connectives` skip a frozen piece as the join's SUBJECT and nothing keeps it out of the span another connective's join takes. `Josep Carod Rovira Puig y i` freezes the trailing 'i' (nothing stands on its right) and the 'y' beside it joins across it all the same, for family 'Puig y i', which is what the tree before #397's both-sides scope read there too; pinned by `test_a_frozen_link_is_still_absorbed_by_a_neighbours_join` in tests/v2/pipeline/test_group.py.

- 2026-11-21 #1159 — FRENCH `dit` AND `dite` ARE CONNECTIVES UNDER A FRENCH CHOICE, NOT BY DEFAULT. `dit` and `dite` ("called") join two words of a name in two uses: a hereditary French two-part surname, one legal surname in France, Quebec and Switzerland (`Dupont dit Lebrun`), and a West African alias beside the given name (`Mamadou dit Madou`). Read as written, the first half was a middle name (`Jean Dupont dit Lebrun` → middle 'Dupont dit', family 'Lebrun'). Neither word had a reading. As a particle the word strands the first surname in the middle and reads `Dit` opening a name as a particle; as an alias marker (rules/N4) it cuts a legal surname in half; a connective joins both sides, which both uses want, so `fr.toml` lists both as `conjunction`, P3 unchanged.
MEASURED against master 488ea605, the reading on by default first. Every local corpus holds 67 distinct names with `dit` or `dite` as a word between two others or at an end (`config_diff.py diff default <the reading added> --local all --match '(?i)(^|[\s,])dite?($|[\s,.])'`), and 50 move: hereditary surnames read whole, West African aliases joined to the given name with the family as before, and names written family first, data errors and an alias read into the family, wrong before and after. By population, scored against the filed boxes where a corpus has them: `orcid-researchers` 11 records fixed, 0 broken, 3 changed between two wrong readings; `patentsview-inventors` 2 fixed, 3 broken; `psc-individuals` 0 fixed, 3 broken (two of them boxes filing the alias or the first surname as a middle name), 1 changed; and by `snapshot.py --local --base`, `ctgov-officials` 6 moves (2 surnames read whole, 2 a surname `Dite` lower-cased by case repair and its initial dropped, 2 case only), `ctgov-contacts` 4 (3 surnames read whole, 1 family-first, wrong before and after) and `fec-individuals` 2 (a given name `Dit` lower-cased by case repair). The breaks are of two kinds. Where `Dit` or `Dite` is a person's own name, a given name or a surname (a Cantonese and a Latvian given name and a surname `Dite` among the corpora's, judged by the names' shape, the readings holding no country): a three-word name loses its family name to P3's three-word reading (given `X Dit Y`, as `Juan and Garcia` reads), a word ending a name takes the word before it into the family, and case repair writes it in lower case and `initials()` drops it inside a joined part (alone in its field it keeps its initial, `Jean Dit` giving 'J. D.'). And where it is the connective but P3's join, one word on each side, falls short: a second half opening with a particle, whatever its language, is split unless a family comma follows the surname, a suffix comma included (`Jean Dupont dit de Lebrun, Jr.` → family 'Lebrun'): given name first, the particle goes to the middle with the first half (`X Dit Abou Akl` → family 'Akl' among the corpora's Levantine surnames; `Jean Dupont dit de Lebrun` → family 'Lebrun'; of a run `de la` the first word only), and under a family-first order the second half leaves the family (`Dupont dit de Lebrun Jean` → family 'Dupont dit de'), while after a family comma the surname reads whole (`Dupont dit de Lebrun, Jean`). One three-word name with an Arabic word on each side reads as one given name, and whether its `Dit` is a name or the connective the record does not say. By default, then, the scored populations fix 13 records and break 6, and the unscored ones read 5 names right and break 4 by case, more breaks than a handful, so the reading is written `default = false`, read under a French choice: with it the default moves 0 of the 67, and the French choice moves the same 50 names to the same readings, its costs included. A gate keeping the reading only where no name reads (a lower-case `dit` alone, say) would need a property the build does not have, and was not built.
The grid, under all three orders and the four comma shapes: a title and a suffix around the name keep their fields, capitals and lower case read alike, two in one name join all three parts, `Dupont dit Lebrun, Jean` and `Traore, Mamadou dit Madou` read as their comma-free twins, a family-first order lays the joined part out by position (`Dupont dit Lebrun Jean` → family 'Dupont dit Lebrun', a particle opening the second half aside, below), `dit` opening a two-word name or alone after one word is a name word, and a hyphenated `Dupont-dit-Lebrun` is one word in every configuration. Under the choice, two more costs of the same kind: `Dit` opening a name of three words or more joins the next word into the given name (`Dit Jean Dupont` → given 'Dit Jean'), and a suffix comma after a joined name leaves no family (`Dupont dit Lebrun, Jr.` → given 'Dupont dit Lebrun', a `given-or-family` report; the default reads family 'Lebrun'), as P3 reads any connective there; and case repair writes a hyphenated `-dit-` in lower case (`JEAN DUPONT-DIT-LEBRUN` → 'Jean Dupont-dit-Lebrun'), which the 67-name population, read by a pattern that finds `dit` only between spaces or commas, does not count, the `ctgov-officials` case moves above being of that spelling. The name match under the French choice reads either half of the surname as part of the other (`Jean Dupont dit Lebrun` / `Jean Dupont` and `/ Jean Lebrun`, `part-of-other`) and the hyphenated spelling as `joined`, where the default reads `Jean Dupont` as a conflict; `match_diff.py` parses under `Parser()` and `locales.ES` only, so it moves nothing here by construction.
RECOMPUTE: the diff above with `expr:Parser(lexicon=Lexicon.default().add("dit", "dite", kind="conjunction"))` on master, or `plain:fr` on the branch, `--readings` in each tree; `local_agreement.py orcid-researchers|patentsview-inventors|psc-individuals --base <488ea605>` and `snapshot.py --local ctgov-officials|ctgov-contacts|fec-individuals --base <488ea605>`, run on a tree holding the reading on by default.
64 changes: 62 additions & 2 deletions docs/languages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ subset with its own parser, or pass several packs to ``parser_for``:
The sections below cover Czech, Slovak, Slovenian and Croatian names,
Spanish and Portuguese titles and family names, romanized Indic titles,
Vietnamese, Mongolian and Thai names, Arabic-script names, Maghrebi,
Amazigh, Hebrew and Dutch particles, and Burmese and Malay names. Other languages are described where their mechanism is:
Amazigh, Hebrew and Dutch particles, French ``dit`` names, and Burmese and Malay names. Other languages are described where their mechanism is:

- **East Slavic patronymics** (``ru``): :ref:`east-slavic-patronymics`.
- **Turkic patronymic markers** (``tr_az``):
Expand Down Expand Up @@ -237,7 +237,8 @@ on:
Clair Smith`` reads given ``St``.

A caller whose names also hold the English Saint chooses French too, a
choice that changes no other word:
choice that changes no other word but ``dit`` and ``dite``
(:ref:`french-dit-names`):

.. doctest::

Expand Down Expand Up @@ -1369,6 +1370,65 @@ What the pack costs
>>> parser_for(locales.NL, english).parse("John Smith VD").suffix
'VD'

.. _french-dit-names:

French ``dit`` names
--------------------

``dit`` and its feminine ``dite`` ("called") join two words of a name
in two uses: a hereditary French family name of two parts, one legal
surname in France, Quebec and Switzerland (``Dupont dit Lebrun``), and
a West African alias written beside the given name (``Mamadou dit
Madou``). Choosing French reads either as one part of the name; the
default does not, and reads the first half as a middle name:

.. doctest::

>>> french_names = parser_for(Locale(code="fr", lexicon=Lexicon.empty(),
... languages=frozenset({"fr"})))
>>> parse("Jean Dupont dit Lebrun").family
'Lebrun'
>>> french_names.parse("Jean Dupont dit Lebrun").family
'Dupont dit Lebrun'
>>> french_names.parse("Mamadou dit Madou Traore").given
'Mamadou dit Madou'

It is a choice rather than the default because ``Dit`` and ``Dite`` are
also given names and surnames (a Cantonese and a Latvian given name, and
a surname ``Dite``, among them), and the choice reads the word as a
connective wherever it stands:

- **A name of three words** with the name in the middle is read as one
given name, as ``Juan and Garcia`` is (``Sok Dit Chan`` gives given
``Sok Dit Chan`` and no family name).
- **Opening a name of three words or more**, it joins the next word to
the given name (``Dit Jean Dupont`` gives given ``Dit Jean``).
- **Ending a name**, it joins the word before it to the family name
(``Tran Thi Dit`` gives family ``Thi Dit``).
- **Before a comma and a suffix**, the joined name is read as the given
name and the family is left empty (``Dupont dit Lebrun, Jr.``).
- **Case repair** of a name written in one case writes it in lower
case (``SOK DIT CHAN`` gives ``Sok dit Chan``), and ``initials()``
gives it no initial inside a joined part (``Sok Dit Chan`` gives
``S. C.``), alone in its field it keeps one (``Jean Dit`` gives
``J. D.``).

Written with hyphens (``Dupont-dit-Lebrun``) the name is one word and
its fields read the same either way; case repair writes its ``dit`` in
lower case under the choice (``JEAN DUPONT-DIT-LEBRUN`` gives ``Jean
Dupont-dit-Lebrun``).

The connective joins one word on each side, so a surname whose second
half opens with a particle, in any language, is split unless a family
comma follows it (a suffix comma does not keep it): written given name
first, the particle goes to the middle
name with the first half (``Jean Dupont dit de Lebrun`` gives family
``Lebrun``, ``Karim Haddad dit Abou Nasr`` family ``Nasr``; of a run
such as ``de la`` only the first word), and under a family-first order
the second half leaves the family instead (``Dupont dit de Lebrun
Jean`` gives family ``Dupont dit de``). After a family comma the
surname is read whole (``Dupont dit de Lebrun, Jean``).

.. _burmese-names:

Burmese names
Expand Down
1 change: 1 addition & 0 deletions docs/release_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Release Log

nameparser 3.2 is under development.

- **Add French dit and dite as connectives under a French choice.** With ``languages=frozenset({"fr"})`` chosen, ``Jean Dupont dit Lebrun`` gives family ``Dupont dit Lebrun``, where the default, as 1.4.0 through 3.1.0, gives middle ``Dupont dit``, family ``Lebrun``; a West African alias joins the given name the same way (``Mamadou dit Madou``), and the default is unchanged, ``Dit`` and ``Dite`` being names too. :issue:`1159`
- **Add Brazilian Portuguese familiar forms, found in the names Brazil's election candidates put on the ballot.** With ``familiar-form`` accepted, ``Tião Alves`` / ``Sebastião Alves`` and ``Cida Silva`` / ``Aparecida Silva`` are consistent, where 3.1.0 read a conflict. They are filed under ``pt-BR``, so a strict choice of another language leaves them out, and one name spelled two ways (``Elizangela`` / ``Elisangela``) is not among them. :issue:`1495`
- **Add the Czech and Slovak post-nominals DiS., DrSc. and ArtD. as credentials.** ``parse("Jan Novák, DiS.")`` gives suffix ``DiS.``, where 1.4.0 through 3.1.0 gave title ``DiS.``; DiS., which is also a surname, reads as the credential after a full name and a comma, and written as ``DiS.`` or ``Dis`` it stays a name word at the end of a name of mixed case without one (``Jan Novák DiS.``), while a surname written ``DIS`` there reads as the credential (``Jan DIS``). :issue:`969`
- **Add credentials: BCh, BChir and BMBCh, the Nigerian marks mni, fwc, fsi, fnse, psc and ndc, and the Hong Kong and Singapore honours GBM, GBS, SBS, BBS and BBM.** ``parse("Jane Doe, BCh")`` gives suffix ``BCh``, where 1.4.0 through 3.1.0 gave given ``BCh``, family ``Jane Doe``. A word spelling one of them after a one-word family name and a comma, or ending a name, reads as the credential (``Bello, MNI``). :issue:`1361`, :issue:`1228`, :issue:`1182`
Expand Down
2 changes: 2 additions & 0 deletions nameparser/config/_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,9 @@
('discovery', (('en', 'modifier', ()),)),
('dissident', (('en', 'occupation', ()),)),
('district', (('en', 'modifier', ()),)),
('dit', (('fr', 'conjunction', (('default', False),)),)),
('dita', (('en', 'familiar', (('short_for', ('anindita',)),)), ('pt-BR', 'familiar', (('short_for', ('benedita',)),)))),
('dite', (('fr', 'conjunction', (('default', False),)),)),
('ditinha', (('pt-BR', 'familiar', (('short_for', ('benedita',)),)),)),
('ditinho', (('pt-BR', 'familiar', (('short_for', ('benedito',)),)),)),
('dito', (('pt-BR', 'familiar', (('short_for', ('benedito',)),)),)),
Expand Down
Loading