Skip to content

Should Parser.suggest propose two_family_names? A list of Gabriel García Márquez-style names gets no suggestion, and the default reads family Márquez #1452

Open

Description

@derek73

Parser.suggest decides four settings from a list: name_order, patronymic_rules, initials_as_family and capitals_as_family. It has no evidence on two_family_names (rules/O6, two family names), so a caller with a list of Spanish, Portuguese or Croatian names has to know the switch exists. decisions/group-suggestion never weighed it.

What a caller gets today. Measured 2026-11-18 on master c878443, over ORCID holders' own given and family boxes (orcid-researchers, up to 3,000 records a country, records with an empty box left out). Each country's names went to Parser().suggest(), and were scored under the suggested parser with local_agreement.read:

  • 140 of 143 countries get no suggestion.
  • Three get one, none of them this switch: Benin (capitals_as_family, 90.9% to 93.8%), Nepal (initials_as_family, 94.1% to 94.2%), Togo (capitals_as_family, 94.5% to 94.1%).

What the switch is worth, and what it costs. config_diff.py score default --switches two_family_names --cap 3000, all boxes agreeing:

Country off on fixed broken
Peru 14.6% 97.2% 2,439 47
Colombia 26.0% 95.2% 2,135 126
Mexico 34.9% 95.0% 1,861 95
Spain 49.9% 94.5% 1,415 105
Croatia 88.6% 98.7% 329 32
Slovenia 90.6% 97.6% 272 67
DR Congo 56.3% 84.3% 1,180 367
Iran 84.2% 91.8% 433 208
Brazil 50.3% 74.2% 1,046 366
Portugal 72.1% 83.0% 644 324
Cameroon 55.8% 70.1% 1,166 759
Bangladesh 90.8% 47.6% 90 1,100
Kenya 93.6% 69.5% 152 796
Ghana 90.9% 65.8% 226 937
Angola 76.4% 57.0% 469 1,023
Pakistan 92.9% 75.7% 142 542
Vietnam 69.5% 52.6% 558 1,036
Turkey 92.0% 78.8% 219 596

So it cannot be suggested broadly. A wrong suggestion costs 17 to 43 points.

The names it breaks. Nearly all are one shape: a given box of two words and a family box of one, where the switch takes the second given name as a first surname (Spain 98 of 106 broken, Peru 45 of 49, Croatia 31 of 32; same records, the breaks counted against the default).

  • Where the switch is right for the list, the taken words are ordinary second given names (Spain: Teresa, Angel, José, Luis, Carlos, Isabel). The given-name veto the Spanish packs carry removes most of them, at a small cost in fixes:

    Country bare switch, fixed / broken locales.ES locales.ES_AR
    Peru 2,439 / 47 2,413 / 20 2,366 / 12
    Colombia 2,135 / 126 2,123 / 34 2,108 / 20
    Mexico 1,861 / 95 1,848 / 32 1,821 / 18
    Spain 1,415 / 105 1,403 / 42 1,378 / 29
    Portugal 644 / 324 632 / 162 608 / 96
    Brazil 1,046 / 366 1,016 / 235 979 / 167
  • Where the switch is wrong for the list, the same shape is the convention itself: a second given name (Ghana's day names Kofi, Kwame, Kwaku, Yaw; Kenya's Otieno, Wambui) or a name that is given and family both (Bangladesh's Islam, Rahman, Hasan, Kumar). No list of given names repairs that; the suggestion has to stay off.

A signal a list carries. A double surname leaves no mark on one name. Across a list it does: the same word ends some names and stands second-to-last in others. One crude form, tried on the same records: the share of names whose second-to-last word ends at least two other names of the list, and ends names more than twice as often as it opens them.

  • Over 128 countries of 2,000 records or more, it correlates 0.84 with the switch's gain, and 0.95 with the share of family boxes holding two words or more.
  • At 22% and above it flags 19 countries, all Spanish- or Portuguese-speaking, and all gain (Brazil +24 points, Peru +83).
  • Bangladesh reads 20% and loses 43 points: Md, Kumar and Rahman stand in both places. Pakistan reads 13.5%, Vietnam 13.0%, Ghana 10.9%.
  • It misses DR Congo, Iran, Cameroon, Croatia and Slovenia, which gain 5 points or more and read under 10%.

This is one afternoon's heuristic, counted on names composed given-first from the boxes, at one group size. It shows that a list carries evidence, not what the rule should be.

Questions.

  1. Should suggest decide two_family_names at all, or should the docs carry a per-country recommendation and leave the switch to the caller?
  2. If it decides: what is the evidence? The repeated-surname share above is evidence of the whole list, where every other setting tallies one vote a name. Does SettingEvidence take a list-level figure, or does each name vote by whether its second-to-last word ends other names?
  3. What keeps Bangladesh out? Candidates: a wider margin, the given-name table (COMMON_GIVEN_NAMES) refusing a word that is also a given name, or the family-share figures tools/vocab/order_names.py already computes.
  4. The breaks above say the bare switch is the weaker suggestion. Does suggest carry a given-name veto of its own (its COMMON_GIVEN_NAMES table, which is no Lexicon list), name a pack, or suggest the bare switch and report the names it expects to break?
  5. How small a group can decide it? The signal needs repeats, so it is weak on 2 to 20 names, where suggest's other settings must still hold the 95% same-order bar.
  6. Under a family-first base the surnames open the name. Does the signal mirror, and does suggest decide the order first?

Measuring it. tools/differential/suggest_measure.py draws groups of known order; it has no population of known surname span. ORCID's boxes give one, by country. A change here would need that population added, at the default sizes and the long ones, with Bangladesh, Ghana, Kenya and Vietnam as the rows that must not move.

The wider aim. suggest exists so that a caller need not know a setting exists, so each setting a list can give evidence on is a candidate. This issue is the first past the four; two_given_names has the same gap and wants its own measurement. Iran, DR Congo and Cameroon, whose pairs the signal above does not see, are not answered here.

Activity

  1. added this to the 3.2 milestone on Nov 18, 2026
  2. self-assigned this
    on Nov 18, 2026
  3. added
    name-orderName order, family-first and two family names (rules/O)
    suggesterThe group suggester: Parser.suggest() and its signals
    on Nov 18, 2026
  4. derek73 commented on Nov 18, 2026

    @derek73
    OwnerAuthor

    The candidate settings, decided 2026-11-18: two_family_names, two_given_names and middle_as_family. lone_name_word is not to be suggested, and script_orders is left out.

    Why middle_as_family is one. The surnames view (middle names and family name together) already gives a two-surname family where a person has one given name, and reading given with surnames is the same split middle_as_family makes. Measured 2026-11-18 on master c878443, ORCID holders' own boxes (orcid-researchers, the first 3,000 records a country with both boxes filled), the share where the given box and the family box both equal the pair read:

    Country default, given_names + family given + surnames, which is middle_as_family two_family_names locales.ES
    Peru 14.5% 31.5% 97.2% 97.3%
    Colombia 25.7% 35.2% 95.2% 98.0%
    Spain 50.0% 77.6% 94.4% 96.2%
    Mexico 35.0% 47.9% 95.2% 96.8%
    Portugal 71.9% 74.0% 82.8% 87.9%
    Brazil 48.8% 66.3% 72.6% 76.0%
    Croatia 88.5% 98.5% 98.6% 98.9%
    Iran 84.1% 90.9% 91.7% 91.9%
    DR Congo 56.0% 81.6% 83.5% 84.2%
    Ghana 89.4% 61.6% 64.4% 65.3%
    Bangladesh 88.9% 44.4% 46.2% 46.6%
    United States 95.5% 90.3% 93.0% 94.0%

    The view pair and a parse under Policy(middle_as_family=True) agreed to within one record in every row.

    • Where one given name is the rule (Croatia, Iran, DR Congo), "the first word, then the rest" is nearly as good as two_family_names. These are three of the five countries the repeated-surname signal above did not see.
    • Where two given names are common (Peru, Colombia, Mexico), it is not: the second given name lands in the surname, and two_family_names with a given-name veto is what reads them.
    • It costs Ghana, Bangladesh and the United States as the other switch does, so it needs the same refusal.

    So the two switches answer one question, where the family begins, two ways: after the first word, or one name word before the last. Which fits is a property of how many given names a list's people write, and a design here could decide between them from the same evidence. What two_family_names adds beyond the split is the surname1 and surname2 views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

name-orderName order, family-first and two family names (rules/O)questionsuggesterThe group suggester: Parser.suggest() and its signals

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions