Repository navigation
Divide a family of two surnames by its own words, behind a comma too (#1456, #1479) - #1485
Merged
Merged
Conversation
…1456, #1479) Under two_family_names the surname1/surname2 views now divide a family of two surnames however it was read: before a family comma, where a particle chain made it, behind a given name a particle completes (rules/P10), and the family O9's capitals named. One function, _post_rules._divide_family, decides for every path, O6's take included: P1's fold units over the family in written order, a bound given-name word counted with the word it completes, exactly two marked, a first unit of particles alone, a connective, a shared name and a Turkic father's name with its marker left whole. No field moves; nothing moves with the switch off. rules/O6, R10, R11, P10, O7 and O9 amended, with dated decisions entries; the connective and the one-word hyphen question stays open in decisions/R10. Case rows gain an optional views mapping. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… them (#1456, #1479) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…479-surname-views-96f3a0 # Conflicts: # docs/release_log.rst
The capitals family is divided, the moves the issues did not ask for are accepted, a lone particle ending a family stays the second unit, and the connective and the one-word hyphen stay open; decided 2026-11-19. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#1456, #1479) The review of the decision commit found the lone particle ending a family decided only in a Log item, the rule's wording predicting a division for Smith van der, Juan, which the code leaves whole. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 #1456
Closes #1479
Under
Policy.two_family_names, thesurname1/surname2views now divide a family of two surnames however the family was read. The switch is on inlocales.ES,ES_AR,CS,SK,PT_BRandPT_PT. Covered: before a family comma, a family that opens with a particle, and a family behind a given name a particle completes (rules/P10). No field moves, and nothing moves with the switch off.The design: one division, one place
_post_rules._divide_familyis the one place O6 (two family names) divides a family. It runs:_divide_comma_family, for the part before a family comma. That part must hold the family's words alone (none joined from after the comma by P1's fold or P6's attachment), and its script must set no order other than the declared one (W4).How the units are counted. They are P1's fold units over the family in written order (
unit_ends(chain=False)): a particle run with the one name word it attaches to, a bound given-name word with the word it completes, or a plain word. Exactly two get marked.What stays whole:
shared(Kaur, Singh);Father uuluas the family? (Бекмырза Чолпонбай уулуgives familyуулу) #1187).A particle P6 attached at the end goes with the first unit. The view code is unchanged.
Why P10's family was never divided (#1479's fourth question): it was a consequence, not a decision. P2's chain
del Carmen García Lópezmade the family; P10 moveddel Carmenout, leaving a family of two words. O6 counted two, took nothing, and so marked nothing. rules/P10's Accepted clause recorded that result, and no decisions entry gave a reason to want it.The particle-led rule, and what it gets wrong
Rule: the particles and the one word they attach to, then the next word. This is the cut rules/O6 and P1 already make under a family-first order.
Measured before choosing. I used Spanish-speaking ORCID holders: 276,027 records in 20 countries with both boxes filled, under
parser_for(locales.ES). #1479's counts reproduce to within 4: P10 3,204 against 3,200, particle-led two-word 1,756 exactly, three or four words 37 against 36.What the hand-read found. I read 250 random records of the 1,756 by hand. None is one surname of three words; every one is a particle surname plus a second surname (
de la Cruz171,de León120,da Silva54). The vocabulary chainssantaandsan, soSanta CruzandSan Martínstay one unit. A compound place surname such asde la Torre Ugartereadsde la Torre|Ugarte; that is the one thing the rule gets wrong (rules/R10 Accepted), and none appeared in the sample.#1479's four questions:
Measured
The tree against master, 296,151 names. That is every committed corpus name, every
cases.pytext, and the Spanish-speaking ORCID names and credit names. I parsed them under 13 configurations: the default, plus the bare switch,locales.ES, the switch withcapitals_as_family, and the switch withmiddle_as_family, each in all three orders.No field, ambiguity report or
str()moved in any configuration, and nothing moved under the default. The views moved:locales.ESThe Portuguese packs (after rebasing onto #1481). I compared against
d12af9d6, underPT_BRandPT_PT, over the committed names plus the ORCID names of PT, BR, AO, MZ and CV. No field moved. The views moved for 9,553 names under each pack:A. Manuel de Oliveira Duarte→de Oliveira|Duarte);ORCID, Spanish-speaking holders,
locales.ES:Of those 59, the parser does not read the comma as a family comma in some (
González Ruiz, MAreadsMAas a credential), and the head is one unit in the others (Dos Santos, Priscila).Seven ORCID families with a hyphen now divide, because a hyphenated word beside a plain word is a unit of its own, as the take always counted it (
Sánchez-Cid Torres). One of them is cut where its writer probably meant two hyphen-joined surnames:De la cruz-La rosa. A one-word hyphenated family (García-López) stays whole.Other checks:
local_agreement.py orcid-researchers --base(default parser): matches the base, 1,831,533 records.cldr_agreement.py: every default view matches. Under the ES pack, two CLDRsortingrenderings now agree (von Miller Jones, Prof. Dr. Mary Sue Marie,Pablo Pérez, Sr. Miguel Ángel Juan Antonio), and the record was re-recorded.test_snapshot.py: the snapshot parses the default policy, so it cannot see these views. It shows only the new rule-example names, now recorded. I measured the views directly, as above.Frames (
sys.setprofilecalls, warm parse, py3.11). The default is unchanged (reference row 196,Smith, John98,Gabriel García Márquez159), so_CALL_BASELINE's band holds. Underlocales.ES:Gabriel García MárquezGarcía Márquez, GabrielJuan de la Vega RuizMaría del Carmen García LópezSmith, JohnThe comma path's W4 check is a C-level test,
max(text) >= "Ѐ", because every keyed script is written from U+0400 up. That saves the script walk on accented Latin.Tests
test_both_writings_of_one_family_read_the_same_unitsholds the principle. For every head whose family is the same in both writings,X Y, Givenand the comma-less writing give the same views. The grid:عبد الله حسن,Abu Bakr Siddiq,abdul Rahman Khan),bin Abd Rahman, one word;locales.ES, in all three orders.1,659 same-family pairs, and 0 disagree. The recorded negative control (comma division off) gives 1,241; master gives 941.
test_each_head_divides_as_recorded_in_both_writingspins each head's units._COMMA_HEAD_ROWSpins the comma path's refusals, which the grid cannot see because their two writings read different families:script_orders;locales.MN) and an unkeyed one;Every one of the six mutations the test review found surviving now fails a row (I ran each).
Case rows:
Casegains an optionalviews, asserted bytest_case. I ran the new rows on master: the 8 new-behavior rows fail there, and the 3 left-whole rows pass.test_types.py's view rows: values changed, and a''row is kept for every shape still refused.Moves the issues did not ask for
Every path now goes through the one function. As a result, a family the take built that does not count as two units reads whole. Under
locales.ES, that is 62 names given-first and 93 under each family-first order. Every one was a wrong division on master:Del Piero Ortega,Van Gogh Ana María). rules/O6 and R11 had accepted this as an error; their Accepted clauses are reworded or deleted;Carod i Rovira);Abd El Kader Haddou);Ali Ahmad Vali Hasan ogluwith the Turkic rule):Hasan ogluis now one unit, as O2's three-word reading is.Two moves go the other way, from whole to divided:
abdul Rahman Khan, Ali→abdul Rahman|Khan);Abd El Kader Haddounow readsEl Kader|Haddou.All of these are recorded in decisions/O6's entry, items 8–10.
Decided (2026-11-19, recorded on #1456 and in decisions/O6 and O9)
capitals_as_family+two_family_names(Ana GARCÍA LÓPEZ→GARCÍA|LÓPEZ), given names O9 misreads as the family included (536 names beyond the bare switch's moves). Kept.Beethoven van, Ludwig,Juan García de).Docs
ParsedName.surname2,Policy.two_family_namesand the unit tags' comments are updated.nameparser/AGENTS.mdgains the lesson: a rule that marks something a view reads is compared across both writings.Review
Reviewed with
pr-review-toolkit: code-reviewer, pr-test-analyzer, comment-analyzer and code-simplifier, plus design-docs-reviewer. Every fix commit was reviewed again, a code-reviewer and a design-docs-reviewer on the fixes, and the findings of that round are fixed too. Skipped as inapplicable: silent-failure-hunter (no error handling added) and type-design-analyzer (no new public type;Case.viewsis a test-table field).Checks:
uv run pytest(51,049 passed),uv run pytest -n0 -m serial,uv run mypy,uv run ruff check,sphinx-build -b doctest docs(0 failures),python -m doctest README.rst, the suite without thejaextra, and the changed modules on Python 3.15.🤖 Generated with Claude Code