Skip to content

List each Spanish given name written with ñ again with n (#1081) - #1082

Merged
derek73 merged 3 commits into
masterfrom
fix/issue-1081-ntilde-n-spelling
Nov 5, 2026
Merged

derek73 merged 3 commits into
masterfrom
fix/issue-1081-ntilde-n-spelling

Conversation

@derek73

@derek73 derek73 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Under locales.ES and locales.ES_AR, rules/O6's given-name veto matched María Begoña López but not Maria Begona Lopez. An accent folds when the list is matched; ñ does not. Data from systems without the letter writes Begona, so the veto missed it.

The change is in the data. tools/es_given_names.py now writes a second tuple, _N_SPELLINGS, beside _RANKED:

  • It holds each listed word written with ñ, again with n.
  • A spelling is kept only where it passes the list's own share test, with given and surname uses summed over every spelling the n stands for.
  • ES gains begona, inaki, benat and zurine. ES_AR gains those plus inigo, garbine, enaut, argine, eguzkine and ekine.
  • martiño's n spelling is refused by construction: martino is 24.0% given once summed, against ES_AR's 50% share, because Martino is mostly a surname.

Neither the list's matching (given_name_key) nor _normalize changes. The fold therefore runs one way: a surname written with ñ (Oña, Mariño, Niño) never matches an entry written with n.

parser_for(...) before after
ES, Maria Begona Lopez family Begona Lopez middle Begona, family Lopez
ES_AR, Jon Inigo Perez family Inigo Perez middle Inigo, family Perez
ES, Juan Oña Pérez family Oña Pérez unchanged (ona is listed, oña is not)
ES_AR, Luis Martino Gil family Martino Gil unchanged (refused by the share test)

Measured

Measured against master 2d91f6b, under default, plain:ES and plain:ES_AR, with config_diff.py diff --readings compared line by line between the two trees:

  • All 13 local corpora, restricted to names that could move (those holding ñ, an n spelling, or a salutation word the declined fold would reach): 12 names move, each an n spelling leaving the family: 2 under ES, 10 under ES_AR, none by default.
  • Checked against the filers' boxes: 6 land in a given box; 3 are Inigo filed as a surname. Iñigo is also a surname, but it passes ES_AR's share at 78.8%, and ES lists no iñigo.
  • No other change: the committed corpora, every cldr_agreement.py view, and the full runs of tse-donors, dof-signatures, ukec-individuals and ORCID's six Spanish-speaking countries are all unchanged.
  • Score: config_diff.py score over ORCID and PatentsView in those six countries fixes one PatentsView Spain record under ES and moves nothing else.
  • Same as the prototype: the built change gives readings byte-identical to the prototype measured before the decision.

Declined, with numbers in decisions/O6:

  • Folding ñ in _normalize. Senor and Senora become titles by default. Under ES and ES_AR, Dona becomes a title too, which pt.toml refuses because it is a given name: 258 names a pack. es.toml's spellings have to be rewritten, and 3.0 pickles holding an ñ edit stop loading.
  • A two-way list fold. It moves 28 (ES) and 149 (ES_AR) surnames written with ñ out of the family, plus 20 Martino; in ORCID, 135 of the 162 moved words are filed in the family box, 27 in a given box. Its fixes are the same as this change's.

Docs

  • rules/O6: one clause in the "What is taken must be one name word…" bullet, plus two examples. tests/v2/rules_budget.json is re-recorded for it (870 → 903 words); the clause reads no new signal, only the list it already read.
  • decisions/O6: the Open line becomes a Standing line, with a dated entry holding the Declined and Excluded items and a recompute recipe. The tool's new --words flag, and the n rows it prints with summed uses, produce every quoted figure.
  • User docs: a locales.rst paragraph with doctests, a sentence in customize.rst, and a sentence plus :issue: link in the release log's ES bullet. It goes there rather than in a bullet of its own because both packs are new in 3.0.
  • Corpus files: the rules corpus and snapshot gain the two example names.

Checks

  • Suites on 3.11 and 3.15, the serial benchmarks, mypy and ruff.
  • sphinx-build -b doctest, -W -b html, and python -m doctest README.rst.
  • A design-docs review and a code review of the first commit. Their findings are fixed in the second commit: the share condition is added to the rule clause, the tool's tallies replace raw INE counts, and a test covers the given-side sum. A review of that fix commit found three more problems, fixed in the third: the ona/rene shares are restated per list, --words gives the remaining counts, and refused rows go to stderr. All figures in the third commit were re-checked by running the commands it adds.

Closes #1081

🤖 Generated with Claude Code

derek73 and others added 3 commits November 5, 2026 02:18
Data from systems without the letter writes Begoña as "Begona", so
locales.ES read "Maria Begona Lopez" family "Begona Lopez" where
"María Begoña López" reads middle "Begoña". tools/es_given_names.py now
writes each listed word written with ñ again with n (_N_SPELLINGS),
where that spelling passes the list's own share over every spelling it
stands for: ES gains begona, inaki, benat and zurine, ES_AR those and
six more, and martiño's n spelling fails (Martino is mostly a surname).

The fold runs one way and lives in the data: the list's matching and
_normalize are unchanged, so a surname written with ñ (Oña, Mariño,
Niño) never matches an entry written with n. rules/O6 gains the clause,
decisions/O6 the entry with the declined _normalize and two-way folds.

Closes #1081

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rules/O6: the clause names the share condition, so martiño's refused
  n spelling no longer contradicts it.
- tools/es_given_names.py prints every candidate n spelling with its
  summed given and surname uses, its share and whether it is kept, so
  decisions/O6's figures have a recipe; the entry now quotes the tool's
  tallies (martino 24.0%, not the raw table's 21%; Oña 3,569 uses).
- A test the given-side sum must pass (zuriñe/zurine).
- customize.rst says a name written with ñ is listed with n too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- es_given_names.py --words prints any words' tallied uses, the counts
  decisions/O6 quotes for Oña, Reñe, Mariño, Niño, Nuño and Martino.
- A refused n spelling is reported on stderr, so stdout stays the list
  the docstring's awk recipe cuts.
- decisions/O6: ona and rene fall under ES's share once their ñ
  surnames are summed in, not ES_AR's; the two-way fold matches them
  whatever the share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.0 milestone Nov 5, 2026
@derek73 derek73 added enhancement vocabulary Per-word vocabulary model and language packs labels Nov 5, 2026
@derek73 derek73 self-assigned this Nov 5, 2026
@derek73
derek73 merged commit 5138879 into master Nov 5, 2026
13 checks passed
@derek73
derek73 deleted the fix/issue-1081-ntilde-n-spelling branch November 5, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement vocabulary Per-word vocabulary model and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should "Maria Begona Lopez" under locales.ES keep Begona out of the family, as "María Begoña López" does?

1 participant