Skip to content

Read Arabic titles written short, and give Arabic script no initials (#1149) - #1497

Merged
derek73 merged 1 commit into
masterfrom
fix/issue-1149-arabic-titles
Nov 20, 2026
Merged

derek73 merged 1 commit into
masterfrom
fix/issue-1149-arabic-titles

Conversation

@derek73

@derek73 derek73 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Relates to #1149 (question A, the slash, is measured here and left open)

What changes

د. أحمد علي حسن      → title 'د.', given 'أحمد', middle 'علي', family 'حسن'
                       (1.4.0 through 3.1.0: given 'د.')
أحمد علي حسن          → initials() ''   (1.4.0 through 3.1.0: 'أ. ع. ح.')

The names are invented, of the shapes read.

  • The Arabic script writes no initials. It takes a row in the script-property table (_policy._SCRIPT_PROPERTIES, Umbrella: one table of which scripts have case and which write initials (ကြည် ကြည် ဌေး gave initials() က. က. ဌ.) #1256), as Thai and Burmese have. A letter with a full stop is no initial to the parse (rules/T5's veto), initials() gives nothing for an Arabic-script word (rules/R7), and the name match reads a single letter as a word. The row covers Persian and Urdu, a row being per script.
  • The titles written short. د., أ. and م. are listed in ar.toml, with أ.د., أ.م.د., م.د. and م.م., and the alif without its hamza (ا., ا.د., ا.م.د.), replacing the excluded:academic entry for د. They read written with or without the full stop, glued to the name (rules/T8), and with their letters spaced (أ. م. د.).
  • The ranks and offices Egypt's parliament writes, each measured alone, every move to the title and none from a name:
    • اللواء 4 and لواء 2 (military);
    • المستشار 1, المستشارة 1 and السفيرة 1 (office);
    • الاستاذ (الأستاذ without the hamza) 1 in the parliament list and 10 in ORCID.
  • NFD and the joiners. rules/T8 counts an Arabic letter's combining marks with it, in the gate it asks first and on both sides of the stop, so a decomposed أ.محمد divides as the composed one does. The name after the stop admits a zero-width non-joiner or joiner between two letters, as Persian spells a name (د.محمد‌رضا).
  • The twin test (tests/v2/test_script_properties.py) took Arabic as its caseless script with no row. It now takes Hebrew, and its recorded control (11) holds.

Arabic script and initials: decided from usage, against CLDR

CLDR, by the Standing recipe (cldr c0b65ae3, the Arabic comma added to the copy test's commas):

locale authored with an initial equal to en's
ar 42 8 2 of 8
fa 39 7 6 of 7
ur 42 8 4 of 8

The lists measured say the opposite:

list Arabic-script names one-letter words read as
ORCID (orcid-researchers) 6,291 221 opening the name with a full stop (د. 190, أ. 15, م. 11, ا. 5), 23 later; 42 bare letters opening it titles, at most 2 initials
Wikidata native corpus 212 (ar 150, fa 30, ur 32) 0 —
jrc-names 17,101 25 lone letters about 6 initials, all transliterated Western names
Egypt's House of Representatives 1,182 25 all titles

Measured usage decides where it contradicts CLDR's patterns (decided 2026-11-19); decisions/script-properties' Standing line is amended to say so. Persian and Urdu rest on thin evidence and are an Open line there.

The costs, recorded in decisions/script-properties:

  • A transliterated Western name written in Arabic script with an initial gets no initials, and و., which is also the connective "and", joins its neighbours: جورج و. بوش → given 'جورج و. بوش', reported given-or-family. No list writes that shape (0); a case row pins it.
  • A dotted run of letters holding a listed title letter reads as a title (علي ح.م. → title 'ح.م.', where master read given 'علي'); one holding none stays a name word.
  • A slash written apart after a newly listed title (اللواء / X) leaves / as the given name, where master read the title word as the given name. Both readings are wrong; 14 of the parliament's names and 1 of ORCID's read so now. Proposal A would take the slash out.
  • A joiner ending a word glued to a title (د.محمد‌ رضا) leaves the word whole as the title, as Dr.Jean‌ Smith read on master; a case row pins it.
  • The order report on letters ending a name is not made for Arabic letters, as for Thai.

The three open questions, measured

A — the slash: measured, not built. A listed title written with a slash for its full stop stays the given name today (د/ منى أحمد → given 'د/'; Dr/ John Smith → given 'Dr/').

Where it opens a name, by list:

list X/ word X/word X / word or X /word total
Egypt's parliament (Arabic) 16 5 16 37
ORCID (Arabic) 14 7 3 24
ORCID (Latin) 7 6 0 13
PSC (Latin) 1 4 2 7
ClinicalTrials.gov (Latin) 0 3 0 3
FEC (Latin) 0 2 0 2
  • The titles written so: د 34, dr 18, prof 17, أ.د 9, دكتور 5, الدكتور 4, اللواء 4, م 3, لواء 2.
  • A title-slash later in a name (ClinicalTrials.gov's job descriptions after a comma, Nepal's Lama/ inside a name) would not move under a reading confined to the opening title run.
  • What else a slash joins, which such a reading must leave alone: credential pairs (MD/PhD, M.D/Ph.D; 1,468 in ClinicalTrials.gov), OTR/L, the Malaysian a/l, a/p and s/o (173 across the lists, which Should a/l, a/p and anak open the family name as bin does? (KUMAR A/L RAJAN NAIDU gives middle A/L RAJAN) #1468 reads), c/o, A/Prof, A/S, and (UTC/GMT labels.
  • Proposed: a listed title opening a name, or opening the given part after a family comma, written with a slash in place of its full stop (X/, X/word, X / word) reads as that title, the slash dropped as a separator.
    • It moves those 86 names.
    • It reaches none of the shapes above: none opens with a listed title, and A/Prof opens with A.
    • It needs a tokenize rule beside rules/T8, which is not a vocabulary change.

B — the bare letter: settled by the listing. The fold leaves the bare letter, so listing د. lists د. Every bare Arabic letter opening a name is a title: ORCID 51 (names and credit lines), the parliament list 16. The only others are jrc-names' 5 cut-off د آل خليفة, which are not names either way.

C — glued: settled by rules/T8. Dr.John Smith already reads title Dr. (T8). د.أحمد divides once د is listed, since T8 reads a listed one-letter title of a script without case. ORCID writes the Arabic glued form 217 times and the Latin one 1,348.

Measured against master 667828ae (measure.py --base)

  • The committed snapshot: 333 initials() views move and no parse field; the CLDR, GND and Wikidata native records do not move.
  • orcid-researchers: 7,018 entries move, 6,203 in initials() alone, 814 reading a title and 1 an ambiguity alone.
    • Its agreement scores 423 records as regressions and 211 as changed. These are holders who typed the title into the given-name box: 629 records open that box with a newly listed title.
  • The parliaments: 1,181 entries move, 38 reading a title. Their alike view reads 35 people apart, each spelled once with a title it now reads and once without; the title field alone differs.
  • jrc-names: 17,070 entries move, 5 reading a title (the cut-off fragments).
  • ClinicalTrials.gov: 9 initials() views. Every other local corpus moves nothing.
  • match_diff.py --base: 0 of 690,426 rows move; its draw holds no Arabic-script pair with a letter and a full stop, so tests/v2/test_match.py holds the match's move (فؤاد علي against ف. علي now conflicts).
  • suggest_measure.py --base: no cell moves; a group of Arabic names each a word and a letter, which suggested family-first on master, suggests no change (decisions/group-suggestion).
  • Re-measured after the fix commits, on the committed tree: identical figures.

Also changed

  • Rules R7, T8, O6 and O8 name the Arabic script; T8 gains Arabic examples.
  • Decisions:
    • script-properties: the Standing lines, an Open line for Persian and Urdu, and the 2026-11-19 entry with every table above.
    • vocabulary-exclusions, R7, H2 and T8: pointers to it.
  • docs/languages.rst gains an "Arabic-script names" section with doctests.
  • docs/migrate.rst gains a 3.2 entry with the removal recipe.
  • docs/locales.rst no longer names د. among the held-back entries.
  • The release log has a bullet, and root AGENTS.md's initial-veto note names the Arabic script.
  • Records the row made false are brought in line: rules/R3's Arabic example, decisions/initials-repertoire's Standing line, decisions/vocabulary-exclusions' per-word argument, decisions/script-properties' Should Georgian script count as caseless? (ჯეკ MA gives family '' and suffix 'MA', where محمد MA gives family 'MA') #1222 bullets (head notes).
  • The twin test in tests/v2/test_script_properties.py takes Hebrew as its caseless script with no row, and _OTHER_QUESTIONS names _ARABIC_MARKS.

Checks

  • uv run pytest passes on the rebased tree (52,638), and so does uv run pytest -n0 -m serial.
  • The suite also passes without the ja extra (52,606).
  • uv run mypy and uv run ruff check pass.
  • sphinx-build -b doctest docs, sphinx-build -W -b html docs and python -m doctest README.rst pass.
  • tools/vocab/build.py --check reports the compiled files current.
  • parity_check.py: 0 of 683 rows read otherwise under 1.4.0.
  • Every fix(#1149) row fails on master; the parity rows hold under 1.4.0.
  • Sweeps (nameparser/AGENTS.md): comma shapes (ASCII and Arabic comma, empty head, family comma), the three orders, NFD on both sides of the stop, a hamza below, vowel marks, a presentation form, tatweel, and the joiners.

Reviews

The branch was reviewed as four commits, then squashed to one and rebased on master (34771e2d, #1494 and #1496), the conflicts resolved by keeping both sides and the compiled vocabulary, rules corpus and snapshot regenerated:

  • The first commit: pr-review-toolkit's code-reviewer, pr-test-analyzer, comment-analyzer and silent-failure-hunter, and the design-docs-reviewer. They found:

    • the NFD gate defect (a decomposed أ. glued to a name swallowed it into the title);
    • the joiner gap;
    • count and population errors, and a wrong account of the spaced slash;
    • the records the row made false (R3, initials-repertoire, vocabulary-exclusions);
    • the costs to record, and missing tests (the name match, the row's pin, single-spelling paths).

    The first fix commit applied them.

  • The first fix commit: code-reviewer. Its three findings (the dotted-run mechanism, a pin of the row's period column, the joiner cost) were applied in a second fix commit.

  • The second fix commit: code-reviewer. Its one wording finding was applied in its own suggested words.

  • The rebase resolution: code-reviewer.

  • type-design-analyzer was not run: the change adds no type.

🤖 Generated with Claude Code

…1149)

The Arabic script takes a row in the script-property table writing no
initials, decided from usage against CLDR ar's patterns: ORCID's 6,291
Arabic-script names write every opening letter with a full stop as a
title. د., أ., م., أ.د., أ.م.د., م.د. and م.م. are listed as titles in
ar.toml (the alif without its hamza too), replacing the exclusion that
refused د. as a letter swallowing initials, with the ranks Egypt's
parliament writes (اللواء, لواء, المستشار, المستشارة, السفيرة) and
الاستاذ. initials() gives nothing for an Arabic-script word and the name
match reads its letter as a word, as for Thai and Burmese. rules/T8
counts an Arabic letter's combining marks, in its gate and on both sides
of the stop, and a joiner between two letters of the name after it.

The slash (د/) is measured and left open; the bare letter and the glued
form follow from the listing. decisions/script-properties records the
CLDR table, the lists, the moves and the costs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 20, 2026
@derek73 derek73 added vocabulary Fixed by a word-list entry: per-word vocabulary and language packs titles Titles and honorifics (rules/H) non-latin-script Names written in a script other than Latin (rules/W) labels Nov 20, 2026
@derek73 derek73 self-assigned this Nov 20, 2026
@derek73
derek73 merged commit e0f698c into master Nov 20, 2026
14 checks passed
@derek73
derek73 deleted the fix/issue-1149-arabic-titles branch November 20, 2026 10:50
derek73 added a commit that referenced this pull request Nov 20, 2026
Both branches added a 3.2 section to docs/migrate.rst; both are kept.
ar.toml merged cleanly, and a fresh vocabulary build was byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73 added a commit that referenced this pull request Nov 20, 2026
Both conflicts were entries added at the same place, the release log's
bullet and the group-suggestion decisions entry; both sides kept.

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

non-latin-script Names written in a script other than Latin (rules/W) titles Titles and honorifics (rules/H) 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