Repository navigation
Add surname1, surname1_particles and surname1_base, the first of two family names (#1022) - #1047
Merged
Merged
Conversation
…family names (#1022) Where rules/O6 (two family names) reads the family as two units, the new views read the first: `Juan Pérez de la Vega` under `two_family_names` gives surname1 'Pérez' and surname1_base 'Pérez', where family_base, unchanged, is 'Pérez Vega'; `Juan de la Vega del Valle` gives 'de la Vega' / 'de la' / 'Vega'. A family read as one unit is its own first surname. Decided in four questions (decisions/R11): the surname1 trio beside unchanged family views; the first unit O6 read, so a middle O3 folds in is in neither unit and a particle P6 attached is in the first; initials() unchanged; render keys, out of as_dict/--json/comparison_key/repr and the snapshot. O6 marks the first unit's words as it marks the second's, carried out on Reading.first_surname (ADDED_IN 3.0.0, not compared). New rule rules/R11 and decisions/R11; cldr_agreement scores CLDR's surname-prefix and surname-core against the first unit's views where a surname2 is stated, as roles of their own beside the merged base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A fold's middles are left out of surname1 where O6 read one unit too (decided in chat as a follow-up to question 2): where O6 marked no units, O3 marks the family it folds into before folding, so `Ana María García López` under middle_as_family gives surname1 'López'. - A first unit of nothing but particles is its own base, as R2 reads an all-particle part (`van Gogh Vincent` family-first gives surname1_base 'van'). - Tests for both patronymic re-readings in assemble, the fold without two units, and the all-particle unit; a duplicate row removed. - cldr_agreement prints the surname1 roles in its summary and says what they score; records re-recorded. - The RFC's output-model, API-changes table and render-pattern prose name the new views; decisions/R11's recipe is re-run on the shipped views (Wikidata 264 against 227, CLDR core 9 against 0, as stated). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Back out reading a lone-particle first unit as its own base: it broke the units' partition of the family's particles and base, and lowered CLDR's surname1_particles agreement under ES from 165 to 134 of 369. rules/R11's Accepted records the empty base instead, and an empty-family fold (`, John Paul`), where nothing is marked. - Test rows for middle_as_family with nothing to fold, a family comma, and replace() on a folded parse. - rules/R11's When, Because and Signal, the tag comments, post_rules' Produces line, the RFC and usage.rst name O3 as the other rule that marks the first unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73
force-pushed
the
feat/1022-surname1
branch
from
November 4, 2026 03:23
0035f66 to
f956639
Compare
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1022.
Where rules/O6 (
two_family_names) reads the family as two surnames, the new views read the first one:two_family_names)Juan Pérez de la VegaJuan de la Vega del ValleGabriel García MárquezA family read as one unit is its own first surname, so for the default parse the views equal
family,family_particlesandfamily_base. CLDR patterns fillsurname-prefix/surname-core/surname2fromsurname1_particles/surname1_base/surname2.Decided (four questions plus one follow-up, recorded in decisions/R11)
surname2.family_particlesandfamily_basekeep reading the whole family, so rules/R2 is unchanged. Rejected alternatives: the namesurname, which sits next to the unrelatedsurnames, and narrowing the family views.middle_as_family) folds in is in neither unit, whether O6 read one unit or two. A particle P6 attached is in the first unit.middle_as_familyon, against 227 for "family minus surname2".surname-coreis right in 9 against 0.initials()is unchanged. It still initials the whole family's base; a monogram is a render pattern's job.render()keys and in rule examples. Likesurname2, they stay out ofas_dict(),--json,comparison_key()and the repr. Unlikesurname2, they stay out of the snapshot too, since under the default policy they always equal the family views.Mechanism
Reading.first_surname(ADDED_IN3.0.0, not compared, so 2.8 pickles load).FOLDED_TAG, and P6's own tag is dropped at assemble.Docs and tools
cldr_agreement.pyscores CLDR's prefix and core against the first unit's views as roles of their own, only where asurname2is stated. The merged base keeps the second surname in, so the default parse, which reads one unit, isn't counted twice.Accepted costs (rules/R11)
van Gogh Vincent; reading the particle as the base was tried and backed out, because it broke the partition., John Paul, nothing is marked.Review
Three passes: code and design docs on the first commit, then one on the fix commit. Fixed:
Checks:
uv run pytest: 36,092 passed. Ruff and mypy clean. Sphinx doctests pass.🤖 Generated with Claude Code