Skip to content

Add locales.ES_AR, Spanish with a given-name list cut for Argentina - #1061

Merged
derek73 merged 7 commits into
masterfrom
claude/country-presets-aecc79
Nov 5, 2026
Merged

derek73 merged 7 commits into
masterfrom
claude/country-presets-aecc79

Conversation

@derek73

@derek73 derek73 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Adds locales.ES_AR, an Argentine Spanish pack: locales.ES with a longer given-name list. Also adds config_diff.py score, the per-country sweep the pack was chosen by.

Why Argentina, and why a list rather than turning two family names off

decisions/O6's 2026-10-27 ORCID table showed two_family_names (rules/O6) taking Argentina from 80.3% to 59.7%. That was the switch without the Spanish given-name list. With the list, as locales.ES ships it, Argentina reads:

Source Records No pack locales.ES locales.ES_AR
ORCID researchers 19,364 83.44% 90.19% 96.13%
PatentsView inventors 3,343 93.81% 86.18% 92.73%
PSC filers 320 81.88% 81.88% 91.25%

(records agreeing in every box with the filer's own split)

  • What ES gets wrong. PatentsView's Argentine inventors mostly write two given names and one surname. O6 then takes the second given name into the family whenever Spain's list lacks it.
  • Why the list lacks those names. INE's 90% bar leaves out names Spain gives but also bears as surnames in a seventh to a quarter of their uses: Nicolás, Matías, Sebastián, Andrés, Ramón.
  • Why not O6 off. Turning the switch off for Argentina reads exactly as the default does, and loses 6.7 points on ORCID.
  • What ES_AR does instead. It keeps the switch on and cuts the same INE tables looser: share ≥ 0.5, 5,000 words, decided in chat.
  • The cost. PatentsView stays 1.1 points below the default.
  • Why not change ES itself. The looser list costs Spain, Mexico and Peru 0.6 to 1.3 points, so ES keeps its own list.

Every other country

config_diff.py score was run over every country or nationality with at least 100 records, under default/pack × every on/off combination of O6 and two_given_names (rules/O7). The measure recorded in decisions/O6: a configuration must beat the country's language pack by at least 2 points in every source holding 300 or more of its records, and beat no pack summed over those sources. Only Argentina passes.

  • Spanish: ES is beaten by no switch combination by more than 0.06 point on ORCID.
  • ES_AR's list elsewhere in Latin America: it beats ES by up to 0.61 point in Chile, Colombia, Venezuela, Uruguay, Paraguay and Central America. That falls short of the 2-point bar, and is recorded as the Open line's lead.
  • two_given_names: it helps nowhere PSC, the one source that can see it, measures it.
  • Portuguese: O6 splits by source (ORCID BR +24.9, PatentsView BR −24.5), so PT keeps waiting for a list.
  • Philippines: the default reads 97–99%.
  • Morocco: O6 alone helps in two sources. That is a lead for 3.1.

Shape

  • The pack: ES_AR = Locale(code="es_ar", lexicon=Lexicon(given_names=...), policy=rules_patch("es"), languages=frozenset({"es-AR"})).
  • No es-AR.toml. A choice of es-AR already selects es.toml by ancestry.
  • No [rules] inheritance. No country measured needs it. It would also need two_family_names = false, which build check 12 refuses, and it would make parser_for(ES, ES_AR) depend on argument order.
  • Stacking is harmless. The new list holds every word of ES's, so parser_for(ES, ES_AR) reads as ES_AR.
  • No separate preset API.
  • The list is generated by tools/es_given_names.py --list es-AR from INE's tables (CC BY 4.0).

Changes

  • New: nameparser/locales/es_ar.py, _es_ar_given_names.py, and the registry entry.
  • tools/es_given_names.py: writes either list (a LISTS table, --list).
  • config_diff.py score: scores configurations against the filed boxes, per country. --switches and an @field=0|1 suffix on any configuration read it under each on/off combination of named Policy switches. It refuses a group or language that selects nothing.
  • Docs:
    • decisions/O6: a 2026-11-04 entry, a Standing line, a head note on phase 3g, and an updated Open line;
    • one sentence in mechanisms.md's LOCALE-PACKS-PURE-DATA;
    • docs/locales.rst: a table row, a section and doctests;
    • the README's available() output;
    • a release-log bullet;
    • AGENTS.md, vocab/README.md and build.py comments on which packs read es.toml's [rules].
  • AGENTS.md also records a hazard this PR's review hit: a probe that plants a fixture corpus outside a test module's cache fixture overwrites the shared local corpus. It replaced psc-individuals with one record during review, and it has been restored byte for byte.

Checks

  • Tests: full suite green; the touched modules also pass on Python 3.15.
  • Lint, types, docs: ruff and mypy clean; Sphinx doctests and README doctest pass.
  • Committed corpus: 120 names move between ES and ES_AR, each a listed word staying in the middle name. Comma shapes don't move. Under the family-first orders the list's veto acts symmetrically, as decisions/O6 records.
  • Reviews: a design-docs review and a code review, then a review of the fix commit, which found three defects in the fixes; all are addressed in c22b3a7.

🤖 Generated with Claude Code

derek73 and others added 5 commits November 4, 2026 13:33
…py score)

The per-country sweep the country presets are measured by: each
configuration's share of records agreeing in every box, a row per
country or nationality of orcid-researchers, patentsview-inventors and
psc-individuals, with the best configuration's fixes and breaks against
the first. --switches reads every configuration under every combination
of named bool Policy fields, written as an @ suffix any SPEC may carry
(plain:ES@two_family_names=0), set last over the packs' patches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
decisions/O6's 2026-10-27 figures showed the two-family-names switch
costing Argentina, but that was the switch without the Spanish list;
with it, locales.ES raises ORCID's Argentine researchers and loses only
on PatentsView's inventors, who mostly write one surname behind a
second given name that Spain bears mostly as a surname (Nicolás,
Matías, Sebastián), and which INE's 90% bar leaves off ES's list.
ES_AR keeps the switch on and carries the same tables cut at a share of
0.5, 5,000 words: ORCID AR 90.19% -> 96.13%, PatentsView AR 86.18% ->
92.73% (the default 93.81%), PSC Argentine 81.88% -> 91.25%.

The pack chooses es-AR, which selects es.toml by ancestry, and names
es.toml's [rules] (rules_patch("es")); no [rules] table inherits
another's. tools/es_given_names.py writes either list (--list es-AR).
The decisions entry holds the per-country sweep, the measure the pack
was chosen by and the recompute recipe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code review: score refuses a --group no record holds and a --languages
tag no country writes, as diff refuses its --group; a second @ suffix,
and --switches over an expr: or a suffixed SPEC, are refused with the
cause named; --min takes a count of 1 or more; score's empty-box drop
says why gaps differs; tests hold the filters, the floor and each
refusal (the refusal rows fail on the pre-fix code, the filter row
once the filter is removed).

Design-docs review: Nicolás, Matías, Sebastián, Andrés and Ramón are
given names in 76% to 85% of Spain's uses, missing ES's 90% bar, not
words Spain bears mostly as surnames, which five sites said; the
measure's "beats no pack" clause said the opposite of its intent;
"within 0.1 point" now says what it compares; the phase 3g entry and
its Standing line note ES_AR; the recipe's list expression runs as
written; the two sets of Argentine figures say why they differ.

AGENTS.md records how a probe outside a module's cache fixture writes
the shared local corpus, which happened to psc-individuals during this
review, and how to restore it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ramón is a surname in 15% of Spain's uses, so the decisions entry's
range is a seventh to a quarter, and the user docs' words, 19% to 24%,
a fifth to a quarter. --switches over an expr: names the fix that runs
(the expression's own Policy), and the docs no longer say any SPEC may
carry a suffix under --switches. AGENTS.md's cache note names the
fixture that sets the variable rather than one module's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.0 milestone Nov 4, 2026
@derek73 derek73 added enhancement tooling design vocabulary Per-word vocabulary model and language packs labels Nov 4, 2026
@derek73 derek73 self-assigned this Nov 4, 2026
derek73 and others added 2 commits November 4, 2026 14:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A name with two family names whose first is on the list (Carlos Santiago
López) reads the first as a middle name under es_ar, where es keeps both;
the countries where the longer list reads fewer names right are named.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit fad581a into master Nov 5, 2026
13 checks passed
@derek73
derek73 deleted the claude/country-presets-aecc79 branch November 5, 2026 00:08
derek73 added a commit that referenced this pull request Nov 5, 2026
A dated entry answers the question the #961 review and the #1061 entry
left Open above, on the figures those entries already record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73 added a commit that referenced this pull request Nov 5, 2026
* Sweep migrate.rst and README for 3.0: the 1.4 readings 3.0 moved, 2.8.2's warnings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Sweep the 3.0 docs, docstrings, stage headers, case notes and design docs for stale prose

User docs, autodoc docstrings and messages, the pipeline stages'
Consumes/Produces/Reads lines and ParseState's ownership map, the notes
in tests/v2/cases.py, docs/design/ and the AGENTS.md files and vocab
README, each read against the 3.0 tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the design-docs review's findings on the sweep

H9's Precedence modifier clause in 3.0 terms (a caller's other title
reading), decisions/H9's pointers to the entries that hold its claims,
and vocabulary-model's phase 3 line in the shipped tense. H9's budget
record re-recorded, 778 -> 784 words: the clause reads no new signal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Apply the decisions on #1079's open items

Translate a 2.x removal without rewriting another file's reading (ma's
Filipino same_as) and offer a bare Lexicon() call's fix on a lexicon it
names, each with a test that runs the offered code; retarget the .pyi
stub and the reserved vocabulary names to unbuilt, 3.x; give the API
reference's undocumented members docstrings and mark every 3.0 member
'Added in 3.0.'; state locales.rst's promise as the gate tests it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Track P9's deviation as #1080, O6's ñ question as #1081, and phase 2's pool as built piecemeal

P9 gains its fenced example with a deviates marker (#886 moved the
reading in 2.7); O6's Open line carries the ñ question alone; the
vocabulary-model Standing line no longer reads phase 2's one pool as
pending. Also a test of a 2.x replace on an edited lexicon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Record the 3.x retargets as dated entries and fix the reviews' findings

Log entries for the .pyi stub (3-0-reevaluations) and the reserved
vocabulary names (vocabulary-model), with the Standing lines and the
RFC pointed at them; P9's one-case shape fenced under #1080 too; the
phase 2 pool line restated to match the entries that record it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add P9's two new examples to the rules corpus and the snapshot

Two names new to the corpus, no reading moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Decline a per-region list or selection rule for Peru (decisions/O6)

A dated entry answers the question the #961 review and the #1061 entry
left Open above, on the figures those entries already record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the review's findings on the Peru decline (decisions/O6)

Name the three passages that point at the Open line, say what cut it,
add the one per-region list figure on record, and scope the measure
bullet to the switches it measured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Widen the 2026-11-05 decline to every Spanish-speaking country but Argentina (decisions/O6)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the review's findings on the widened decline (decisions/O6)

The switch figure is the maximum over every Spanish group, Peru's; the
per-country-list finding is cited; the measured population is stated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design enhancement tooling vocabulary Per-word vocabulary model and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant