Repository navigation
Suggest two_family_names from a list's common surnames - #1499
Merged
Merged
Conversation
Parser.suggest now decides rules/O6's two_family_names. A new signal, Signal.FIRST_SURNAME, reads each name under the suggested reader with the switch off and on: a common surname (COMMON_SURNAMES) where the switch would take a first surname votes True, a father's name there votes False and disagrees with a decided switch, and a common given name casts no vote. The switch is turned on, the bare switch and never a pack, where at least three names, more than 30% of every name it would change and more than the votes against carry the surname; it is weighed only under a given-first order, with the East Slavic rule neither decided nor on the base and the base's switch off, and a group never turns it off. Each Signal member votes on one setting, named in one table (_SETTING_OF) the deciding sites read. The shared second-to-last word the issue also proposed is not built: measured, it decides Vietnamese, Pakistani and Bangladeshi lists. No must-not-move country (BD, GH, KE, PK, VN, AO, MZ, TR) gets the switch at any size from 2 to 2,000 names; Spanish, Mexican, Colombian and Peruvian lists get it from 10 to 20 names. suggest_measure.py gains the orcid-span-CC populations and the two_family, whole and switch rows; the docs, a decisions entry and a release-log bullet record the measurement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #1452
What changes
Parser.suggestcan now suggesttwo_family_names(rules/O6, two family names: the word before the last joins the family).One new signal,
Signal.FIRST_SURNAME. It casts one vote a name, read from the parse itself:COMMON_SURNAMESvotesTrue(GarcíainGabriel García Márquez).False. A name with one disagrees with a decided switch.MaríainAna María López).When it is decided. Three conditions, all required:
When it is not weighed. A note in the report says why. The switch is not weighed:
A group never turns the switch off.
The bare switch, never a pack. The docs say
locales.ES,locales.PT_BRorlocales.PT_PTreads a list better when its language is known.Signal → settingtable._SETTING_OFis read by_order_ends,_checked_voteand_setting_of, and by_disagreesthrough_order_ends.NameEvidence.votesmay now holdTrueorFalse._checked_voterefuses any other value for this signal.Docs:
Parser.suggest's docstring, docs/suggest.rst (a new "Lists that give two family names" section, with doctests), docs/getting-started.rst, docs/policy.rst, a decisions entry (decisions/group-suggestion, 2026-11-19 ShouldParser.suggestproposetwo_family_names? A list ofGabriel García Márquez-style names gets no suggestion, and the default reads familyMárquez#1452) with Standing and Open lines, one release-log bullet, AGENTS.md, and tools/differential/README.md.tools/differential/suggest_measure.pygains:orcid-span-CCpopulations, ORCID holders per country, whose two boxes say which words are the family;two_familyrow per population;whole) and under the bare switch (switch);two_family_names.The issue's questions
The two proposed signals.
FIRST_SURNAME.Must-not-move countries (BD, GH, KE, PK, VN, AO, MZ, TR): 0% of groups get the switch, at every size from 2 to 2,000 names, under either base.
Spanish-language lists. Lists written given first, under a given-first base:
AR, BR and PT.
Whole names right, written given first under a given-first base. Suggestion against base, at 2 / 5 / 10 / 20 / 200 names:
config_diff.py score default --switches two_family_names) moves ES 49.6 → 94.8% and PE 14.7 → 97.3%. It moves BD 92.3 → 48.8% and MZ 85.4 → 50.4%; the decisions entry holds every country, ORCID and PatentsView.Existing rows. Same-order rows, rows written against their base, and the
east_slavic,lettersandcapitalsrows are identical to master's, at both size sets. Parliaments: no list of the 28 decides the switch under any base, and nothing else in a list's suggestion moves.Harness proof. With every vote count set out of reach, 138 rows read 0% and 138 read 100% over 69 populations. No group and no parliament decides
two_family_names.Base order × switches sweep. 9 made-up lists × 3 bases × 5 base switches: 36 of 135 cases move against master. Each is a Spanish list written given first that gets the switch.
capitals_as_familyorinitials_as_family, the switch is suggested alongside, and each reads its own names.Left out of this version: Croatia, Slovenia, Iran, DR Congo and Cameroon. The bare switch reads their ORCID holders better and their PatentsView inventors a little worse, and nothing proposed here reaches them.
middle_as_familyandtwo_given_namesas suggested settings are each a later issue (Open in the decisions entry).Measured at seed 20261110, 300 groups a size, with the default sizes and
--sizes 2,…,2000. Branch and master were compared on 667828a. After the rebase onto 34771e2, both were taken again at the default sizes. Outsidetwo_family_namesthey are identical. Against the 667828a run, one decision cell moved, by one group in 300.After master's #1497 was merged in (e0f698c), the default sizes were taken again: no decision cell moves, nor any must-not-move or same-order row. One count moves: whole names read right in
orcid-span-PK, by 6 of 60,000 at 200 names and 1 of 15,000 at 50, alike under the base and the suggestion. That is #1497's parse change, and it moves no figure quoted here.Pickle note
A
NameEvidenceorSuggestionholdingSignal.FIRST_SURNAMEdoes not unpickle under 3.1, which does not know the enum value. That is for the release's pickle-break bullet. A test holds that one round-trips under this release.Cost
Where the switch is weighed, each name is parsed twice more. On a loaded machine,
suggesttook 0.65 s over 2,000 three-word names written given first, and 0.21 s over 2,000 two-word names; master takes 0.04 s for either. The docs advise a few hundred names, which take a tenth of that or less.Checks
On the branch with master merged in (e0f698c), every check passes:
uv run pytest: 52,659 passeduv run pytest -n0 -m serial: 38 passeduv run mypyanduv run ruff check: cleansphinx-build -b doctest docs: 1,432 tests, 0 failurespython -m doctest README.rst: passesThere are 53 new tests in tests/v2/test_suggest.py. Each fails on master or on the pre-fix code. A mutation that reads the base instead of the reader fails the three gate tests.
Review
These reviewers ran:
_checked_vote.The findings fixed:
Not run:
Vote, went to silent-failure-hunter._suggest.py.Follow-ups found in review, outside this change:
has_patronymic_endingmatches surnames such asRabinovich, so a name likeAna Rabinovich Lópezvotes against the switch, and now lists among the names disagreeing with it. This is the rule rules/O1 reads too.initials_as_family's note names whichever of two tied runs comes first in the list (B KorK C). The setting decided is the same either way.🤖 Generated with Claude Code