Repository navigation
Add Policy.two_given_names, the compound given name as a rule kind (3.0, 4g) - #954
Merged
Merged
Conversation
derek73
added a commit
that referenced
this pull request
Oct 30, 2026
…ements recipes The design-docs review of #954 found the Because arguing for every given-part word, the FAMILY_FIRST_GIVEN_LAST bullet silent on a family comma (where the part reads given-first and the unit after the given name is taken; now a rule example and a case row), DECLARED-SPAN's contract missing the family-comma arm, and no recompute recipe for the ORCID and PSC figures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73
added a commit
that referenced
this pull request
Oct 30, 2026
The second review of #954 found the switch moving a patronymic particle's run into the given name while the patronymic view still claimed it ("Ahmad bin Ali bin Hassan" gave given "Ahmad bin Ali"): the guard now reads classify's vocab:patronymic tag, R9's vocabulary arm. It adds the untested Turkic arm's row, removes the two edge tests no input reaches (none fired over the committed corpora's 6,428 texts under every order, patronymic rule and O6/O3 setting), states the script-order agreement O6 states, and the nickname exception to DECLARED-SPAN's rendering claim. The PSC table is re-taken through local_agreement.score, the recipe now naming it, and TSE on the final code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73
added a commit
that referenced
this pull request
Oct 30, 2026
The third review of #954 found the guard reading only the unit taken, so a given name that is itself a patronymic particle joined the word after it ("Ahmad, bin Ali" gave given "bin Ali"); the guard now reads the given side too, with rows for the four inputs, each failing on e945790. Relabels three O7 rows against the 1.4.0 wheel: the binti row fix(#604), the script-order row fix(#271), the family-first Turkic row feat(#704). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….0, 4g) rules/O7, the mirror of rules/O6: under the switch the given name takes the middle unit beside it, so "Juan Carlos Pérez" gives given "Juan Carlos". Off by default and a [rules] key (two_given_names = true), no shipped pack turning it on; it reads after two_family_names and before middle_as_family, and a Policy pickled by 2.8 loads with it off (ADDED_IN 3.0.0). No default parse moves: the snapshot gains the rule's example texts only. Docs: rules/O7, decisions/O7 and the vocabulary-model 4g entry, mechanisms.md#DECLARED-SPAN, the RFC's 4g row, customize.rst's "Names with a compound given name", the vocab README's rules table and a release-log bullet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ements recipes The design-docs review of #954 found the Because arguing for every given-part word, the FAMILY_FIRST_GIVEN_LAST bullet silent on a family comma (where the part reads given-first and the unit after the given name is taken; now a rule example and a case row), DECLARED-SPAN's contract missing the family-comma arm, and no recompute recipe for the ORCID and PSC figures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second review of #954 found the switch moving a patronymic particle's run into the given name while the patronymic view still claimed it ("Ahmad bin Ali bin Hassan" gave given "Ahmad bin Ali"): the guard now reads classify's vocab:patronymic tag, R9's vocabulary arm. It adds the untested Turkic arm's row, removes the two edge tests no input reaches (none fired over the committed corpora's 6,428 texts under every order, patronymic rule and O6/O3 setting), states the script-order agreement O6 states, and the nickname exception to DECLARED-SPAN's rendering claim. The PSC table is re-taken through local_agreement.score, the recipe now naming it, and TSE on the final code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The third review of #954 found the guard reading only the unit taken, so a given name that is itself a patronymic particle joined the word after it ("Ahmad, bin Ali" gave given "bin Ali"); the guard now reads the given side too, with rows for the four inputs, each failing on e945790. Relabels three O7 rows against the 1.4.0 wheel: the binti row fix(#604), the script-order row fix(#271), the family-first Turkic row feat(#704). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73
force-pushed
the
feat/v3-4g-compound-given-name
branch
from
October 30, 2026 19:17
2a3bd4e to
775da1e
Compare
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.
3.0 sub-phase 4g of #754: the compound given name as a rule kind (#704). It adds
Policy.two_given_names, rules/O7 (two given names), the mirror of rules/O6 (two family names). It is off by default and no default parse moves.The rule
Under the switch, the given name takes the middle unit beside it:
Juan Carlos PérezJuan, middleCarlosJuan CarlosAna María José PérezAna, middleMaría JoséAna María, middleJoséMaría del Carmen de la VegaMaría, middledel CarmenMaría del CarmenHow it reads:
FAMILY_FIRST_GIVEN_LASTit is the unit before the given name.middle_as_family) reads last. So with both switches on,María José García Lópezreads givenMaría José, familyGarcía López, whileGabriel García Márquezkeeps givenGabriel.It is a rule kind as 4f set one up:
Policyfield withADDED_IN3.0.0, appended aftertwo_family_namesinPolicyandPolicyPatch;flagrow inRULE_KEYS, with its defaultfalserefused;_locale._RULE_VALUES;Design choices for review
two_given_names, aftertwo_family_names, whose shape it mirrors.given2asmiddle. The alternative, every given-part word ingiven, would leavemiddleempty under the switch.ptexample,Maria do Carmo Silva, still reads familydo Carmo Silvawith the switch on. It is the same string shape asJoão da Silva Santos, whose family it is.Carmen,Jesús,los Ángeles,Pilar), and several of them also open family boxes.Measured with the rule on (2026-10-30)
PSC (
psc-individuals, whose form has a middle-name box), the share of records where every box agrees, scored bylocal_agreement.scorewith eachPolicy:local_agreement.py --base: O7 against the default: 550,064 records regress and 1,801 progress. With O6 on in both trees: 22,297 regress and 173 progress. The filers split a compound given name across the form's two boxes.local_agreement.py orcid-researchers --base): "matches the base", both O7 against the default and O6+O7 against O6. Its given box holds the middle names too, so it cannot see this rule.es: 6 → 8 of 8 under O6+O7;pt: 7 of 8 under O6+O7, 5 under O7 alone.snapshot.py --local tse-donors --base, on the final code): 689,057 of 854,531 entries read differently under O7, and 270,169 with O6 on in both trees. The corpus states no fields, so these count how many names the rule reaches, not whether it reads them right.The recipes are in decisions/O7.
Checks
uv run pytest: 33,167 passed.uv run --python 3.15 pytestpasses too; namedivider is absent there, so that run also covers the path without the ja extra.-n0 -m serial: 42 passed on the second run. The first run failed two wall-clock scaling rows, a different pair each time, at load average 30–70. Master's tree failed two such rows under the same load.mypy,ruff,build.py --check,sphinx-build -b doctest,python -m doctest README.rst: all pass.Policy(two_family_names=True)andParser(policy=...)load in the tree withtwo_given_names=False, equal to fresh ones. ThePolicypickle is committed astests/v2/data/policy_v28.pickle, with a test.Open questions
do Carmo,de Fátima,del Pilarbefore a family), and where that knowledge lives. Options:es/ptvocabulary, read by this rule kind;esandptturn the switch on. That is 3g's decision. PSC says no, CLDR'sessays yes, and ORCID cannot tell.DEVIATESfrom the rules (4f's item 6) stays open. This rule has no surface in the name for a pack to declare.🤖 Generated with Claude Code