Skip to content

Read two family names under locales.HR and locales.SL, as CS and SK do - #1524

Merged
derek73 merged 5 commits into
masterfrom
feat/issue-1190-hr-sl-two-family-names
Nov 22, 2026
Merged

derek73 merged 5 commits into
masterfrom
feat/issue-1190-hr-sl-two-family-names

Conversation

@derek73

@derek73 derek73 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #1190

locales.HR and locales.SL now read two family names (two_family_names, rules/O6), as locales.CS and locales.SK do. A married double surname written without a hyphen stays whole; the default parse is unchanged.

Input Pack master (6ff048f) this PR
Ana Puž Kukuljan HR middle Puž, family Kukuljan family Puž Kukuljan
Elena Zavadlav Ušaj SL middle Zavadlav, family Ušaj family Zavadlav Ušaj
Janez Jože Novak (the cost) SL middle Jože, family Novak family Jože Novak
Novak, Janez Jože SL middle Jože middle Jože (O6 stands down after a family comma)
Ana M. Kukuljan HR middle M. middle M.

What changes

  • hr.toml and sl.toml each gain a [rules] table with two_family_names = true. It compiles into nameparser/config/_rules.py, and PACK_RULES in tools/vocab/build.py gains hr and sl.
  • Both packs take policy=rules_patch(...) and declare DEVIATES = deviates_by_two_family_names, the declaration CS, SK and ES share.
  • No given-name veto list. This ships as CS and SK do, and the cost is recorded in decisions/O6 as accepted, with the list left open.
  • The issue's second question: the two parliaments plus ORCID are enough.

Measured

All runs used a checkout of master 6ff048f. I wrote nothing into the shared tool cache: a scratch NAMEPARSER_TOOLS_CACHE linked the corpus files and held the kept records.

config_diff.py score plain:HR 'plain:HR@two_family_names=1' plain:SL 'plain:SL@two_family_names=1' plain:CS --group HR --group SI --group Croatian --group Slovenian --cap 20000, records with all boxes agreeing:

Population Records switch off → on fixed / broken
ORCID HR 15,547 88.44% → 98.46% 1,757 / 200
ORCID SI 7,801 90.45% → 97.63% 723 / 163
PatentsView HR 879 92.04% → 91.58% 20 / 24
PatentsView SI 1,752 88.24% → 87.39% 22 / 37
PSC Croatian 479 97.49% → 97.29% 11 / 12
PSC Slovenian 277 95.31% → 95.67% 10 / 9

HR, SL and CS score the same on every row, so the switch alone moves them.

ORCID's name is composed from its two boxes, given name first. A two-word family box therefore always reaches the parser as two trailing words, so the ORCID gain reflects the boxes' own split, not how people write their names.

The parliaments are the independent check: display names as each chamber writes them (opensanctions-parliaments). Every three-word name in either chamber moves, and I judged each one by hand.

Chamber Members family right, off → on fixed / broken
Croatian Sabor (hr_sabor) 149 140 → 148 9 / 1
Slovenian National Assembly (si_dz_rs) 90 84 → 89 6 / 1

The one break in each chamber is a member with two given names. The PatentsView dip is mostly something else: read by hand, about 17 of HR's 24 broken records and 11 of SI's 37 are double surnames the filer split, putting the first surname in the given-names box, which the switch reads as intended, and SI's other 16 breaks were not classified. A Croatian given-name list would therefore recover little of Croatia's dip; what a Slovenian one would recover is not known. Every two-word or hyphenated name reads the same either way. These match the issue's table from 2026-11-08.

local_agreement.py --locale hr / sl with --base: HR and SL score identically.

  • ORCID: 97.1% of the HR country's 15,867 records and 96.4% of SI's 7,962 agree under the pack, the same picture as the score table. That table caps at 20,000 records and counts a little differently.

  • Whole corpora: applied to every record, mostly names neither pack is for, the pack moves what the switch always moves:

    Corpus fixed broken
    ORCID 251,806 210,004
    PatentsView 26,114 131,344
    PSC 21,996 532,131

    PSC's filers type a separate middle name, which two family names takes into the family. This is the switch's known cost on given-first names with a middle name, the same under CS and SK, and why it is a pack's switch and not the default's.

CLDR (cldr_agreement.py). The per-pack record is re-recorded: 4 hr and 8 sl renderings move. Each takes a second word into the family (a second given name in a given-first rendering, the first given name in a family-first one), and none agrees afterwards. CLDR's fictional renderings are the population that loses here, as they did for CS and SK. No other record moves.

Other checks:

  • The committed snapshot does not move, since the default is unchanged.
  • CLDR detail: 11 of the 12 CLDR moves are losses. One is a partial gain: sl/nativeFull/surnameFirst's given_names now agrees.
  • The non-interference gate in tests/v2/test_locales.py passes with the new DEVIATES.
  • Under a strict choice of either pack the patch is on too. Strict changes other readings as it does for any pack: it drops de's and la's particle readings, so Juan de la Vega reads family la Vega.
  • A 3.1.0 pickle of locales.HR, and of a parser built from locales.SL, loads and still reads one family name, as migrate.rst says.

Sweep

I compared HR and SL with CS on 25 shapes under all three name_orders, 75 rows in all. The shapes: no comma; a full name, one word and nothing before a comma; a hyphenated pair; a particle; a suffix (bare and after a comma); a title; three and four words; an initial in the middle; a bracketed nickname.

HR, SL and CS read all 75 rows the same, so the two packs differ from CS only through vocabulary, the generations ml. and st.. Ana M. Kukuljan keeps middle M. given-first. Under the two family-first orders it reads as the default does.

Docs

  • Decisions:
  • User docs:
    • docs/languages.rst (the pack table, Double surnames with HR doctests, and Measured effect);
    • docs/locales.rst (the pack index row);
    • docs/migrate.rst (a 3.2 entry with doctests);
    • a release-log bullet, plus HR and SL added to the list of packs that turn two_family_names on in the surname-views bullet.
  • AGENTS.md: the list of files holding a [rules] table.
  • rules/O6 names no packs, so it is unchanged.

Tests

  • test_locales.py:
    • pinned default-vs-pack rows for both packs: the double surname, behind a title with a generation, family first, the middle initial, the hyphenated pair, the cost, and a family comma in both directions;
    • the pack-contents test now holds HR and SL to the patch and the shared declaration;
    • rotators for the patch.
  • The ml rotators became Horvat ml. and Novak ml.. The three-word forms are moved by the patch alone, which test_a_choice_word_rotator_is_moved_by_the_choice_alone refuses. CS has the same shape.
  • test_vocab.py: a fixture that named hr.toml without a table now names sr.toml, and the roster message lists the two files.

Reviews

Run on the first push: pr-review-toolkit code-reviewer, pr-test-analyzer, comment-analyzer and code-simplifier, and design-docs-reviewer. Then a code-reviewer pass on the two fix commits (ec373d8, 2b7c440) alone.

What they found, all fixed:

  • Stale pack lists outside the first diff (code and comment review). Five places still named only the earlier O6 packs:

    • locales.rst's pack-parts table, which put hr and sl under "no policy fields";
    • locales.rst's DEVIATES scope;
    • the surname views in usage.rst and migrate.rst;
    • deviates_by_two_family_names's docstring.

    A sixth was a hand-written parametrize list in a test. That list is now derived from the registry (_O6_PACKS), and a test pins it.

  • Shapes not pinned (test analysis): FAMILY_FIRST_GIVEN_LAST, a family-first row for HR, a suffix comma, a credential after a comma, and an empty head. Rows were added. The analysis also broke the change several ways (no patch, no rules table, a narrowed or missing DEVIATES), and each break failed a test.

  • Decisions prose (design docs):

    • the PatentsView dip was blamed on two given names; it is mostly split double surnames;
    • one CLDR move is a partial gain;
    • "strict reads as plain" was too broad;
    • the phase 3f head entry needed a forward pointer;
    • the recipe needed --json.
  • Docs: languages.rst now gives the PSC figures and says only that no given-name list was looked for.

  • Simplification: nothing worth changing. The test keeps its name because a dated decisions entry cites it.

The fix-commit review found two overstatements, both fixed in the last commit:

  • A test comment claimed es_ar, pt_br and pt_pt were held to the shared declaration elsewhere. Pt_br was not. All eight O6 packs are now in the pack-contents loop.
  • The decisions entry's claim that a given-name list would recover little of the PatentsView dip covered only Croatia's counts. It is now scoped to Croatia.

Checks

All pass:

  • ruff, mypy and the vocabulary build check;
  • the full suite (57,062 passed);
  • the Sphinx doctests and README.

🤖 Generated with Claude Code

derek73 and others added 2 commits November 21, 2026 22:19
#1190)

hr.toml and sl.toml gain a [rules] table turning on two_family_names
(rules/O6), compiled into each pack's policy patch, and each pack
declares DEVIATES through the shared two-family-names declaration. The
default does not move. With no given-name list, a second given name is
read as a family name, as under CS and SK (decisions/O6, 2026-11-21).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 22, 2026
@derek73 derek73 added enhancement locale-packs Locale packs and language choices (nameparser.locales) name-order Name order, family-first and two family names (rules/O) labels Nov 22, 2026
@derek73 derek73 self-assigned this Nov 22, 2026
derek73 and others added 3 commits November 21, 2026 22:29
…t's list (#1190)

Review found five places outside the first diff still naming only the
earlier packs: the pack-parts table and DEVIATES scope in locales.rst,
the surname views in usage.rst and migrate.rst, and the shared
declaration's docstring. The parametrized twice-counting test now reads
its packs off the registry. languages.rst names the PSC figures, and
the given-name-list claim is scoped to what was looked for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isions entry's cost and CLDR claims (#1190)

The test review asked for FAMILY_FIRST_GIVEN_LAST, a suffix comma, a
credential after one and an empty head. The design-docs review found
the PatentsView dip is mostly double surnames the filer split, not two
given names; one CLDR move is a partial gain; a strict choice changes
other readings; the phase 3f head entry needed a forward pointer; and
the recipe needs --json for the counts the text output leaves out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iew conclusion to Croatia (#1190)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 9ec1fcb into master Nov 22, 2026
14 checks passed
@derek73
derek73 deleted the feat/issue-1190-hr-sl-two-family-names branch November 22, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement locale-packs Locale packs and language choices (nameparser.locales) name-order Name order, family-first and two family names (rules/O)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read two unhyphenated family names under locales.HR and locales.SL, as CS and SK do (Ana Puž Kukuljan gives middle Puž under locales.HR)

1 participant