Skip to content

Keep Cheikh and Sultan as given names under a strict Arabic or Malay choice - #1521

Merged
derek73 merged 3 commits into
masterfrom
feat/strict-cheikh-sultan-1463
Nov 22, 2026
Merged

derek73 merged 3 commits into
masterfrom
feat/strict-cheikh-sultan-1463

Conversation

@derek73

@derek73 derek73 commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Relates to #1463

A strict choice reads only the chosen languages' files. cheikh's only name readings sat in fr.toml and sultan's in ar.toml and tr.toml, so strict ar and strict ms kept the chosen file's title reading and lost the rules/H9 (the title phrase) gate: Cheikh Kaddari under strict ar read title Cheikh, given Kaddari, and Sultan Zulkarnain under strict ms read title Sultan, family Zulkarnain, in 3.0.0 through 3.1.0.

This gives cheikh given and family readings in ar.toml and sultan the same in ms.toml, each with the counts it was read from, and takes both words off STRICT_UNGATED in tests/v2/test_reading_index.py. The family readings follow the 2026-11-03 batch F precedent for sultan in ar.toml: they move no role, and they name the file in Reading.languages.

Counted first (the issue's third question)

tools/name_usage.py cheikh sultan --boxes with --country for the Maghreb, Egypt, Mauritania, Senegal, Saudi Arabia and Malaysia, 2026-11-21:

Word ORCID given boxes ORCID family boxes
cheikh Mauritania 13 (3.79%), Algeria 9, Morocco 4, Tunisia 1, Egypt 0 Tunisia 17, Algeria 14, Morocco 11, Mauritania 7
sultan Malaysia 7 of 62,996 (PatentsView 1) Malaysia 19, mostly bin Sultan (PatentsView 1)

Senegal's 81 cheikh given boxes are fr.toml's readings, Wolof names written in French.

What moves

Measured on master 81a24221, strict against strict with the given reading added, scored against the filed boxes (config_diff.py score):

Strict choice Groups Fixed Broken
ar ORCID Algeria, Morocco, Tunisia, Egypt, Mauritania; PatentsView Egypt, Morocco, Tunisia 12 (Algeria 7, Morocco 1, Mauritania 4) 0
ms ORCID and PatentsView Malaysia 1 0

That reproduces the issue's 8 records for ar in its four countries; Mauritania, which the issue did not sample, adds 4. The score's titled filter cannot hide any of these records: it counts a title as listed only where the default's titles holds it, and by default both words are in titles_ambiguous (rules/H9). So the 12 and the 1 cover every record the score reads: 63 ORCID records holding cheikh, and 8 ORCID and 2 PatentsView records holding sultan.

Across trees, the readings of 3,567 local and committed names holding either word under default, plain:ar, plain:ms, plain:MS, plain:fr, strict:ar, strict:ms, strict:ar+en and strict:ms+en, compared line by line between master and this branch:

Configuration Names moved
default, and the four plain choices 0
strict:ar, strict:ar+en 196 each, every one losing the title Cheikh
strict:ms 742: 733 losing the title Sultan, 8 reading a credential after X Sultan, as the suffix, 1 report only (Sultan II)
strict:ms+en 737

nameparser/config/_compiled.py is unchanged, and tests/v2/test_snapshot.py passes without a re-record.

Reading.languages of a given or family Cheikh gains ar beside fr, and of a given or family Sultan gains ms beside ar and tr. That is by default and under every choice that keeps the file.

locales.MS since #1514

#1514's honours don't touch sultan. locales.MS already read Sultan Zulkarnain as given Sultan, and strict ms now reads it the same way. A ruler's style opening a name (Sultan Rahmat ibni Sultan Kamil) reads given Sultan under strict ms, as it does by default and under the pack. Behind a style it stays the title where the style words are chosen (His Majesty Sultan Rahmat under strict ms + en).

What stays open on #1463

  • Its first question. gd, hr, sk, sl and hi, and marquis, marquise, tho, st and sushri, are not measured here. Nor are the nl, fr, ca and ga pairs (0 of 822 records moved in the issue's table), pt and pt-PT, or my's ranks (Should Ra be a name by default as well as a credential and a title? (Kim Ra gives suffix Ra; Korean and Burmese names) #1483). They stay in STRICT_UNGATED, and the decisions entry does not record them as wanted.
  • Its second question, Bin. I re-took the pairs the issue measured, with their gates restored: ben 62, bin 6, it 7, fil 2, pt-BR 1, 0 broken.
    • Nearly all are family-first names filed with the boxes that way round. Strict and the gate both misread them.
    • Bin opening a Chinese given name in a Malaysian list (Bin Qiaoyu) is recorded as a cost accepted under strict's premise. docs/locales.rst already states that premise: strict is "for data you know to be of one origin".
    • A Philippine given name La Reina under strict fil is a cost the premise does not answer. It is left with the pair.
    • If the premise should not decide Bin, that bullet of the decisions entry is the one to change.

Docs

Tests

test_a_strict_choice_reads_a_regated_word_as_its_plain_choice_does compares strict with plain, field by field and report by report. It covers:

  • bare ar, ms, ar+en and ms+en choices and the shipped locales.MS, under all three name orders
  • each comma shape: one word, a full name, and nothing before a family comma, plus a suffix comma
  • three case spellings
  • a salutation, Dr. and Haji in front
  • a nickname head and an inner nickname
  • Jr., II, and a credential strict does not list after a comma
  • the title phrases the gate's other half reads (Grand Cheikh, His Majesty Sultan, Sultan of Johor)

Negative control: with either TOML file reverted and the index rebuilt, that word's rows fail, along with the reviewed-table test.

Local runs, all passing:

  • the full suite, serial included
  • 3.15
  • ruff, mypy, build.py --check
  • parity_check.py (0 of 774)
  • the sphinx and README doctests

Review

Review-toolkit aspects run on the first commit: code (pr-review-toolkit:code-reviewer), tests and comments (pr-review-toolkit:pr-test-analyzer), design docs (design-docs-reviewer). Both fix commits were reviewed again: the review of the first fix found six more problems, which the second fix answers.

🤖 Generated with Claude Code

derek73 and others added 3 commits November 21, 2026 19:42
…choice (#1463)

ar.toml gives cheikh a given reading and ms.toml gives sultan one, each
with the counts it was read from, so a strict ar or ms choice keeps the
rules/H9 gate that fr.toml's, ar.toml's and tr.toml's name readings give
every other choice. Both words leave STRICT_UNGATED. The default and
every plain choice move nothing: _compiled.py is unchanged and the
snapshot holds; Reading.languages of a given Cheikh gains ar, of a given
Sultan ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cope (#1463)

Give cheikh and sultan a family reading beside the given one, as batch F
gave sultan in ar.toml, so Reading.languages names the file under strict.
Widen the test to a full name before a family comma, Dr. and Haji in
front, nicknames, Jr., the en-joined strict choices with their title
phrases, and the shipped MS pack, pinning the one report strict and plain
read differently. Narrow the decisions entry to the pairs it measured,
state how strict reads a family-first name, count the score's dropped
records directly, and run the AGENTS control in a scratch copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1463)

The score's titled filter cannot drop a Cheikh or Sultan record, both
words being in titles_ambiguous by default, so the entry says so and
gives the score's own populations (63 and 8 + 2). The re-taken pairs'
lead names only them, the unsupported "bin Sultan" leaves the note and
the entry, and the AGENTS lesson limits the remove() shortcut to a word
no other kept file holds a reading of that kind on. A test holds the
family readings' purpose, the file Reading.languages names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 22, 2026
@derek73 derek73 added enhancement vocabulary Fixed by a word-list entry: per-word vocabulary and language packs locale-packs Locale packs and language choices (nameparser.locales) labels Nov 22, 2026
@derek73 derek73 self-assigned this Nov 22, 2026
@derek73
derek73 merged commit c3ece6d into master Nov 22, 2026
14 checks passed
@derek73
derek73 deleted the feat/strict-cheikh-sultan-1463 branch November 22, 2026 04:20
derek73 added a commit that referenced this pull request Nov 22, 2026
Both release-log bullets kept, and STRICT_UNGATED's comment keeps both
additions (#1463's cheikh and sultan, #1483's ra). The compiled files
were regenerated with tools/vocab/build.py and were byte-identical to the
merge.

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

enhancement locale-packs Locale packs and language choices (nameparser.locales) vocabulary Fixed by a word-list entry: per-word vocabulary and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant