Skip to content

Read a Spanish compound given name written with a particle as a middle name by default (#704) - #1058

Merged
derek73 merged 3 commits into
masterfrom
feat/704-default-particle-given
Nov 4, 2026
Merged

derek73 merged 3 commits into
masterfrom
feat/704-default-particle-given

Conversation

@derek73

@derek73 derek73 commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Part of #704: the default reading the first PR (#1057) left open. This moves default parses.

What changes

New rule P10 (a given name a particle completes). Behind a one-word given name read given-first, a particle chain that opens with a particle run and a word whose given reading is written after_particle reads that run and word as a middle name, and the chain's other words as the family.

Name 1.4.0 – 2.8.0 / master Now
María del Carmen García family del Carmen García middle del Carmen, family García
María de los Ángeles López Pérez family de los Ángeles López Pérez middle de los Ángeles, family López Pérez
Maria do Carmo Silva family do Carmo Silva unchanged (carmo not marked)
Domingo Santa María González family Santa María González unchanged (saint clause)
María del Carmen family del Carmen unchanged (no word left for the family)
  • Saint clause, decided in chat: a run holding a saint particle (san, santa, st, ste) never forms a phrase. Santa María is a surname: in ORCID, a saint particle stands before a marked word in 0 given boxes and 7 family boxes. The saint kind now compiles into an internal SAINT_PARTICLES set, the way PATRONYMIC_PARTICLES does. This keeps the de María given phrases, which dropping maría from the list would have lost.
  • O7 (two given names) now takes the phrase through its ordinary middle path, so the phrase path Read a particle phrase as the second given name; leave Kaur and Singh to neither two-name switch (#704) #1057 added is gone. So are its vocabulary clause and its "split candidate" note. Under the switches, only the saint clause moves a corpus name: 2 of 26,576 readings across every order and switch pairing, both Domingo Santa María González.
  • Ambiguity alternative fix: a word behind a particle chain now names the field of the chain's last word, where the word would join. P10 moves the chain's first word to the middle, so the old anchor, the first word, gave the wrong field. Example: Jairo do Valle Cardoso Filho reported Filho as "name as middle"; it now reports "name as family". The TSE run found this.
  • Parse cost: a name holding no marked word leaves the new rule after one plain loop. The first draft added 25 frames per parse, which the benchmark band caught.

Measurements (2026-11-04, against master 3b293777 with --base)

Population Fixed Broken Changed
PSC (local_agreement.py psc-individuals --base) 90 8 7
ORCID (local_agreement.py orcid-researchers --base) 3,881 46 164
  • TSE (snapshot.py --local tse-donors --base): 1,561 of 854,531 Brazilian names move, in family and middle only (for example ADRIANA DO SOCORRO MARTINS XAVIER). That corpus has no fields, so this measures reach, not agreement.
  • What breaks is the marked words borne as surnames: ORCID del Valle 18, del Rosario 12, de Jesús 5, de Fátima 4. P10's Accepted section records this.
  • Snapshot: 5 names move. CLDR records: gain one Wikidata rendering, María del Pilar Hurtado Montaño, re-recorded.

Review round 1 (four reviewers; fixed in 280179d)

  • shared now affects a default parse. P10 never completes a shared name, so Kaur del Carmen García keeps family del Carmen García by default. Every doc that said shared moves nothing with the switches off now names P10.
  • The reach is mostly Portuguese. The 1,561 TSE moves are mostly de Lourdes 519, do Socorro 491 and de Fátima 228. ORCID's Portuguese-speaking countries: 53 fixed, 6 broken. The release bullet, rule and decisions now say so.
  • P10's Signal line now names its saint and given-name lookups, and its patronymic clauses cite R9. The family-first example was replaced, since it showed the outcome P10's Then predicts.
  • Alternative anchor: O6's family-first cut splits a chain the other way, so naming the field from the chain's last word was wrong there. See round 2.
  • New test rows: O6 over a family a saint particle opens, and P10's guards under the default policy (a family comma, a patronymic, a mark).

Review round 2 (9598f27)

  • Alternative anchor fixed rather than accepted. The second review found 42 rows that the first fix newly got wrong, where master had them right (FAMILY_FIRST + two_family_names + middle_as_family). Beside now carries both ends of the chain. Assemble names the last word's field only where that word stayed in the family under a head that left it, which is P10's split. A last word P6 attached to the family keeps the head's field.
    • On the review's grid of particle chains, 132 alternatives move against master, each to the right field.
    • Across every committed corpus name, under every order and switch pairing (66,470 readings), no alternative moves.
  • Docs: stale O7 lines in decisions/O6 and O7; the Catalan dels question reopened under decisions/P10 (its old reason is void now that P10 reads the phrase by default); recipe filters stated; the singh note; ste added to the saint lists; P10's Signal line and its P3 citation; and the pipeline AGENTS.md lesson restated for both split directions.

Docs

  • New: rules/P10 and decisions/P10.
  • Amended rules: O7 (When and Then restored, phrase clause folded into the unit bullet, Signal), O6 (Except now cites P10), P2 (new bullet), and mechanisms.md (UNIT-PARTITION's list of chain cuts, DECLARED-SPAN).
  • Decisions: decisions/O7 gets a new entry, plus a head note on the 2026-11-03 entry it supersedes in part.
  • User and vocab docs: vocab README (saint row, after_particle row), AGENTS.md compiled-set bullet, nameparser/_pipeline/AGENTS.md (the Beside lesson), customize.rst (doctested), and a release-log Behavior Changes bullet.
  • Budget: rules_budget.json re-recorded (P10 new; O7 shrinks).

Checks: full suite, serial benchmarks, mypy, ruff and sphinx doctest pass.

🤖 Generated with Claude Code

…e name by default (#704)

rules/P10 (a given name a particle completes): behind a one-word given
name read given-first, a particle chain opening with a particle run
and a word written after_particle reads that run and word as a middle
name, so "María del Carmen García" gives middle 'del Carmen', family
'García' (1.4.0 through 2.8.0: family 'del Carmen García'). A run
holding a saint particle (san, santa, st) is never such a phrase,
"Domingo Santa María González" keeping family 'Santa María González';
the saint kind compiles into an internal SAINT_PARTICLES.

O7 takes the phrase as it takes any middle unit, so its own phrase
path goes. An ambiguity's alternative behind a particle chain now
names the field of the chain's last word, which P10 leaves the family.

Measured against master 3b29377: PSC 90 fixed, 8 broken; ORCID
3,881 fixed, 46 broken; under the switches only the saint clause
moves a corpus name.

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 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 12:53
… reach, P10's signals and examples, the O6 cut the alternative anchor does not follow

- shared now keeps a given name P10 would complete (Kaur del Carmen
  García), so the README, AGENTS.md, mul.toml and the code comments
  name P10 beside O6 and O7 and drop "moves nothing by default".
- P10: its Signal line names the saint and given-name lookups, its
  patronymic clauses cite R9, the family-first example shows the
  exception, a connective-joined unit and the Portuguese reach get rows.
- decisions/P10: the TSE moves are mostly Portuguese phrases (ORCID
  Portuguese-speaking countries 53 fixed, 6 broken); the de María and
  run counts restated by their filters; the Wikidata record and the
  changed PSC records described as they are; O6's family-first cut
  recorded as the one split the alternative anchor does not follow.
- Test rows: O6 over a saint-opened family, and P10's guards under the
  default policy (a family comma, a patronymic, a mark).
- usage.rst's particle row and the release bullet name the reading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only where P10 split it, and the remaining doc fixes

The first fix named the alternative from a chain's last word always,
which rules/O6's family-first cut (laying the tail out by the order)
turned wrong: 42 rows of the review grid newly named 'given' under
FAMILY_FIRST with two_family_names and middle_as_family, where master
named the right family. Beside now carries both ends, and assemble
names the last word's field only where it stayed the family under a
head that left it, not where P6 attached it. On the review's grid 132
alternatives move against master, each to the right field; across every
committed corpus name under every order and switch pairing none moves.

Docs: decisions/O6's and O7's stale O7 and dels lines, the dels
question reopened under decisions/P10, recipe filters stated, the singh
note, ste in the saint lists, P10's Signal line and P3 citation, and the
pipeline AGENTS.md lesson restated for both splits.

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 vocabulary Per-word vocabulary model and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant