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
8 changes: 7 additions & 1 deletion docs/design/decisions/group-suggestion.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
- A capitals word of two or three letters ending a name that holds a lowercase letter casts no surname vote of its own, and where it is itself a listed surname (`Zhou NG`) the name casts no surname vote; otherwise the word in front votes as before; its capitals vote stays silent — 2026-11-14 #1397.
- That rule's reach as implemented, the opening word standing alone: a run of capitals words in front votes as before, whatever its first word (`DE SOUZA Maria`) — 2026-11-14 #1355.
- A name word in a script that writes no initials followed by a letter of it casts no trailing-initial vote, since no byline writes such a name before an initial, as rules/T5 and the order report read it: a group of Thai or Burmese names, each a word and a letter, suggests nothing — 2026-11-12 #1256.
- A caller with a large list is told to give a sample of a few hundred names from each source, not the whole list: nearly every kind of list measured is read right from 200 names, and a longer list is rarely better (bylines written given first under a family-first base are the one kind measured that kept improving) and can be worse where few of its names vote — 2026-11-16 #1442.

Open: a group gate for the short capitals words, under which one votes where another name of the list writes a longer capitals word at the same end, measured and not taken for 3.1 (2026-11-14 #1355, its Declined bullet), to weigh beside #1402. For a list mixing East Slavic and Turkic patronymics (uz_senate, kz_senate), suggesting both rules, and reading the Kazakh `-uly` and `-kyzy` endings as a Turkic signal, are not taken for 3.1 and not decided against (2026-11-15 #1356, its Not taken bullet). `_MIN_PATRONYMIC_VOTES`, five names, was set to keep small Russian groups written family first from moving a family-first base to given-first (2026-11-10 THRESHOLDS); since 2026-11-15 #1356 a `FAMILY_FIRST` base keeps its order on such a group, and that entry measured what relaxing the count does now: no same-order cell moves, and groups written given-first move a family-first base sooner. The threshold is unchanged and has no issue. #1308, the tracking issue, is closed; its other open item, the given names the given-name table's family-share filter drops, was #1357, settled for `John`, `David` and `Robert` by 2026-11-15 #1357, which leaves `James`, `Paul`, `George`, `Charles`, `Thomas` and `Martin` out. #1364, a surname table for names outside zh, ko and vi, is open for 3.2: 2026-11-15 #1357 holds what a gate measured for it (a dated snapshot), the cost no population of the tool shows (a list whose given names are listed surnames) and the sources no entry of decisions/shipped-data-licences clears. Not measured, and without an issue: the table's 20-use floor (`MIN_USES`), and a family share between 10% and 15%.
Open: [#1442](https://github.com/derek73/python-nameparser/issues/1442), whether deciding needs a floor on votes as a share of the whole list (two stray votes decide a list of any length). A group gate for the short capitals words, under which one votes where another name of the list writes a longer capitals word at the same end, measured and not taken for 3.1 (2026-11-14 #1355, its Declined bullet), to weigh beside #1402. For a list mixing East Slavic and Turkic patronymics (uz_senate, kz_senate), suggesting both rules, and reading the Kazakh `-uly` and `-kyzy` endings as a Turkic signal, are not taken for 3.1 and not decided against (2026-11-15 #1356, its Not taken bullet). `_MIN_PATRONYMIC_VOTES`, five names, was set to keep small Russian groups written family first from moving a family-first base to given-first (2026-11-10 THRESHOLDS); since 2026-11-15 #1356 a `FAMILY_FIRST` base keeps its order on such a group, and that entry measured what relaxing the count does now: no same-order cell moves, and groups written given-first move a family-first base sooner. The threshold is unchanged and has no issue. #1308, the tracking issue, is closed; its other open item, the given names the given-name table's family-share filter drops, was #1357, settled for `John`, `David` and `Robert` by 2026-11-15 #1357, which leaves `James`, `Paul`, `George`, `Charles`, `Thomas` and `Martin` out. #1364, a surname table for names outside zh, ko and vi, is open for 3.2: 2026-11-15 #1357 holds what a gate measured for it (a dated snapshot), the cost no population of the tool shows (a list whose given names are listed surnames) and the sources no entry of decisions/shipped-data-licences clears. Not measured, and without an issue: the table's 20-use floor (`MIN_USES`), and a family share between 10% and 15%.

## Log

Expand Down Expand Up @@ -443,3 +444,8 @@ Open: a group gate for the short capitals words, under which one votes where ano
- The twelve Standing statements, each by the entry it points at: the parser never detects language and the suggester may over a declared group (2026-11-10 SCOPE); the given-name table derived from ORCID's public data file (2026-11-12 GIVEN NAMES FROM ORCID); the table's size, the rest of its filter and the hand-kept surname lists (2026-11-10 TABLES and GIVEN NAMES FROM ORCID); the evidence declined (2026-11-10 DECLINED); a comma name does not vote on order (2026-11-10 SIGNALS); an East Slavic group gets the rule with a given-first order, save the case 2026-11-15 #1356 keeps (SIGNALS and 2026-11-10 FIX WAVE); a patronymic votes only where the pipeline's rule reads one (FIX WAVE); the order and patronymic thresholds (2026-11-10 THRESHOLDS); the trailing-initial gate (2026-11-11 TRAILING INITIAL); `initials_as_family` (2026-11-11 LETTER RUNS); `capitals_as_family` (2026-11-12 CAPITALS); and the reach of the opening-word rule (2026-11-14 #1355), which that entry called implementation and record, not decision: what the Standing statement words (the opening word standing alone, a run of capitals words in front voting as before) is a decision now, and a change to it takes an entry; the rest of that entry's reach bullet stays record, as later entries have amended it.
- Eleven entry heads carried the marker: ten of the eleven entries those statements point at, #1355's head carrying none, and 2026-11-10 TURKIC, which no Standing statement points at (a Turkic group gets the rule alone, its order decided by its names' own votes); each head now points here, TURKIC decided with the rest. The entries' bodies are as written, save SCOPE's closing sentence, which said the rest of the file "is proposed" and now says it was.
- Unchanged: `_MIN_PATRONYMIC_VOTES` stays five, and the Open paragraph's note on it stands as written. What the Open paragraph and the Not taken bullets leave open stays open.
- **2026-11-16 #1442 — THE TABLE READ PAST 200 NAMES: MOST LISTS SETTLE BY 50, AND ONE SAME-ORDER ROW FALLS AS THE LIST GROWS.** Measured for docs/suggest.rst's "How many names to give it" with `uv run python tools/differential/suggest_measure.py --sizes 5,10,20,50,100,200,500,1000,2000 --trials 200` on master 05689a4c (2026-11-16; seed 20261110; a population smaller than a size prints no cell there).
- The size from which a row of the order table is right in every trial at every larger size, over its 120 rows (30 populations, each written both ways under both bases): 5 names for 63 rows, 10 for 21 more, 20 for 11, 50 for 10, 100 for 3, 200 for 2, 500 for 2, and never for 8. So 105 of 120 are settled by 50 names and 110 by 200.
- The eight that never settle: `orcid-givcaps`' four rows and `orcid-byline-joined` written given first under a family-first base, the kinds docs/suggest.rst's "Where it stops" names; `orcid-byline` written given first under a family-first base, which reads 57% at 200 names and 99% only at 2,000, the one row a longer list kept helping; and `pv-RU-patronymic` written family first, both rows. The two that settle at 500 are the same-order rows `orcid-byline` (99% at 200) and `orcid-byline-joined` (94 / 92 / 96% at 50 / 100 / 200, its 100-name cell a size no earlier table printed, and its 500 a draw from a population of 644), each written given first under a given-first base.
- `pv-RU-patronymic` written family first under a family-first base, a same-order row, reads 100 / 100 / 100 / 100 / 99 / 100 / 94 / 84 / 88% at those sizes: under 95% from 500 names, where every earlier table stopped at 200. About 3 of its names in 1,000 cast a wrong given-name vote (a surname that is also a given name, written first) and about 1 in 1,000 a right order vote, from the capitals and surname signals (the given-name signal casts no right vote there), and `_MIN_VOTES` and `_MIN_SHARE` count only the names that voted, so two stray votes decide a list of any length. #1442 holds the reproduction with made-up names and what a fix has to keep; one run of 200 groups a size, so 84% and 88% are not told apart.
- Decided for the docs: the user page advises a sample of a few hundred names per source, which is true before and after any fix to #1442. Not decided: a floor on votes as a share of the whole list.
6 changes: 3 additions & 3 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ suggestion either:
>>> Parser().suggest(["Smith J", "Jones M", "Brown K"]).patch
PolicyPatch(name_order=FAMILY_FIRST)

:ref:`suggest-limits` says how many names each kind of list took to be
read right, and :doc:`suggest` has the full rules and the evidence it
reports.
:ref:`suggest-how-many` says how many names to give it, a few hundred
from each source being enough, and :doc:`suggest` has the full rules and
the evidence it reports.

Names from several sources: ``matching``
----------------------------------------
Expand Down
41 changes: 41 additions & 0 deletions docs/suggest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,47 @@ decided the same way, each by its own evidence: a patronymic rule
(:ref:`suggest-capitals`). Every setting the votes do not decide keeps
the base parser's value.

.. _suggest-how-many:

How many names to give it
-------------------------

Give it names from one source, written one way, and a few hundred of
them at most:

- **Under five names** often gets no suggestion. That is safe: a list
short of evidence keeps the parser it was given.
- **Fifty names** settles most kinds of list.
- **A few hundred** settles nearly every kind measured. More rarely
helps, and can hurt.

For a large dataset, take a sample from each source instead of passing
everything:

.. doctest::

>>> import random
>>> registry = ["Kim Minjun", "Wang Xiaoming", "Nguyen Anh",
... "Garcia Emily", "Taylor Morgan"] * 20_000
>>> sample = random.Random(0).sample(registry, k=300)
>>> Parser().suggest(sample).patch
PolicyPatch(name_order=FAMILY_FIRST)

A sample is quicker, a suggestion costing about what parsing the same
names does, but that is not the main reason. A very long list can be
read less well than a sample of it, because the order is decided among
the names that vote, and in a list where few names vote a handful of
stray votes weigh more the longer the list is.

The one kind of list measured that more names kept helping is bylines
written initials first (``AM Hoy``) under a family-first base, where
so few names vote that a sample of a few hundred often decides nothing.
Where you know how such a list is written, set ``name_order`` yourself.

A list that mixes sources written differently works against itself.
Split it by source and ask once for each. :ref:`suggest-limits` gives
the sizes measured for each kind of list.

.. _suggest-report:

Reading the result
Expand Down
Loading