Skip to content

Read MD before a name word in a name of one case as Muhammad written short (#1394) - #1466

Merged
derek73 merged 2 commits into
masterfrom
claude/issue-1394-md-in-capitals-7dfc92
Nov 19, 2026
Merged

derek73 merged 2 commits into
masterfrom
claude/issue-1394-md-in-capitals-7dfc92

Conversation

@derek73

@derek73 derek73 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

MD inside a name written wholly in one case now reads as Muhammad written short when a name word follows it, as Md in mixed case already did. It no longer reads as the medical degree taking the rest of the name. The decline reports suffix-or-name, with the degree as the other reading.

Closes #1394

The fix

Input 3175314 (master) this branch
SITI NORA MD YUSRI family 'NORA', suffix 'MD YUSRI' middle 'NORA MD', family 'YUSRI'
SITI NORA MD. YUSRI, SITI NORA MD.YUSRI suffix 'MD. YUSRI' middle 'NORA MD.', family 'YUSRI'
siti nora md yusri suffix 'md yusri' middle 'nora md', family 'yusri'
AHMAD BIN MD RAHMAN family 'BIN', suffix 'MD RAHMAN' family 'BIN MD RAHMAN'
BIN MD RAHMAN, AHMAD family 'BIN RAHMAN', suffix 'MD' family 'BIN MD RAHMAN'
  • Each of these reports suffix-or-name with the credential as the alternative, save BIN MD RAHMAN, AHMAD (see below). Master reported the run's absorbed word on all but that one too.
  • 1.4.0 through 2.3.0 read SITI NORA MD YUSRI as this branch does; 2.4.0 through 3.1.0 read the run (wheels run outside the tree).
  • Names in this description are invented, of the shape the corpora hold.

How: rules/S8 (the credential's trailing run) gains a clause in "What is a credential here". Where no family comma divides the name, in a name written wholly in one case, a credential that is also a given name written short (md) with a name word behind it does not start the run. Its case is the name's and says nothing, so it reads as its Title case does (#1019).

The clause is _pieces.short_given_name_in_one_case, a fourth writing in declined_by_the_name_behind. So the run start, P2's chain stop and assign's family-part pass ask one predicate.

What stays the credential

Input Reading
JOHN SMITH MD, JOHN SMITH MD PHD, JOHN SMITH MD JR suffix (no name word behind)
John Smith MD Jones suffix 'MD Jones' (mixed case: the capitals speak)
JOHN SMITH M.D. JONES suffix 'M.D. JONES' (the periods are the degree's writing)
SMITH, JOHN MD JONES suffix 'MD JONES' (after a family comma the cue does not reach, as for Md)
JOHN SMITH MD NÉE JONES suffix, as on master (a maiden marker is no name word)
JOHN SMITH MD VI JONES suffix (a numeral S10 reads as the generation is no name word)
محمد علي MD حسن suffix (a word of no cased script behind: a Latin MD there shares no case with the name)
JOHN SMITH née Ann Lee MD Jones suffix (a word in a maiden clause asks the whole name's case, rules/S6)

ma, the other given name written short that is a credential, is an ambiguous member and starts no run in a name of one case already. No other shipped word is reached.

Accepted, recorded in rules/S8 and decisions/S8

  • The degree in capitals before a family name now reads as a name word, reported: JOHN SMITH MD JONES → middle 'SMITH MD', family 'JONES'. In one case it cannot be told from Muhammad written short.
  • A title in capitals behind it becomes the family name, as behind a Title-case Md: JOHN SMITH MD MR → family 'MR'. JOHN SMITH MD PROF. keeps the title, since H5 takes it first.

Two neighbouring moves the review found

  • A shape-only numeral behind any of the declining writings is no name word now. John Smith Md VI Jones and John Smith MA VI Jones read suffix '… VI Jones', where master read family 'Md' / 'MA'. Both have rows.
  • The first build made the lower-case widening for one-case names reachable from the Title-case arm inside a mixed-case clause. It is now passed for the new writing alone.

Measured (against 3175314)

Run with tools/differential/measure.py --base <checkout of 3175314d> over every fetched local corpus, and local_agreement.py orcid-researchers --base … --list 100. Each step's moves were read by name.

Corpus Moved Fixed Broken Notes
orcid-researchers (snapshot) 68 68 0 every one a Malay or Bengali name with MD/MD. for Muhammad before a name word
orcid-researchers (field agreement) 55 2 into agreement 0 out 2 into agreement are BD. 53 move between disagreements: 50 MY, 1 BD, 1 AE, 1 with no country. Each now holds the filed given box whole and the family box's last word; the filers put MD X in the family box, which no positional reading gives. US: 0 moved
ctgov-contacts 2 2 (family) 2 (degree) each now has the right family name (the last surname); the MD, the degree there, is now a middle word, reported
ctgov-officials 0
nepal-candidates 0
every other local corpus 0 fec, psc, patentsview, cz, tse, tw, ukec, govuk, dof, jrc, opensanctions, uit, vn
committed snapshot 8 new the new rules examples only; no existing name moved (re-recorded)
CLDR / GND agreement 0

Per country in ORCID's agreement table, MY, BD and US move by at most 2 records each, so their rates are unchanged at one decimal.

Tests

  • tests/v2/cases.py gains 29 rows: the fix rows, the boundaries above under the comma shapes and three orders, and the review's shapes.
    • Run against 3175314, every intended row fails (9 in the first set, plus the review's) and every boundary row passes.
    • parity_check.py: 0 of 639 parity rows read otherwise under 1.4.0. Three rows 1.4.0 reads differently were relabelled fix(#1394).
  • The Read a Title-case credential acronym before a name word as a name word (rules/S8) #1019 row BADRUL AKMAL HISHAM MD YUSOFF (suffix 'MD YUSOFF') is reversed and renamed. It pinned Read a Title-case credential acronym before a name word as a name word (rules/S8) #1019's boundary from before Should Mohd Rahman match Mohammad Rahman? #1383 gave md its given reading.
  • One mutant per clause, each failing at least one test:
    • the one-case gate, the tag, the cased letter, the maiden marker;
    • the arm-only lower case, the own-words/clause split, the numeral;
    • the report's emission and its recording.
  • Recorded counts re-taken:
    • field sweep 2107 → 2187;
    • alternative sweep (598, 477) → (603, 494);
    • _STAND_IN_REREADS gains the rows where a name word in the stand-in's place makes MD Muhammad;
    • the _UNGUARDED_EFFECT twin control stays 11;
    • test_vocab's _MD_KEEPS_ITS_CREDENTIAL control: 9 of 10, the glued row having moved to the case table.
  • Frames: ordinary names unchanged (John Smith 90, Smith, John 98, the reference row 229, John Smith MD 127). The rare shape pays the whole-name case test (JOHN SMITH MD JONES 150 → 178).

Docs

  • docs/design/rules/S8: the clause, examples, a What-reports bullet and an Accepted bullet.
  • docs/design/decisions/S8: a Standing bullet and a 2026-11-18 Log entry, with head notes on the superseded Read a Title-case credential acronym before a name word as a name word (rules/S8) #1019 entry and on decisions/vocabulary-model and decisions/indic-honorifics, which had recorded the glued MD.NOOR shape as left wrong.
  • docs/release_log.rst: one bullet.
  • docs/customize.rst: the "Keeping Md. a title" recipe notes that it also restores this run.
  • Root AGENTS.md, nameparser/AGENTS.md, and the tag's comments in _classify.py and _state.py: the new reader of vocab:given-abbreviation.

Not done here

  • BT (binti) and UD in capitals. SITI HAJAR BT KHALIT still reads suffix 'BT KHALIT'. These words have no given reading, so this clause does not reach them. Worth its own issue.
  • The decline inside assign's family-part pass reports nothing. BIN MD RAHMAN, AHMAD reads right, unreported; master reported nothing there either.
  • John Smith Md née Jones loses its maiden clause on master and here, in the Title-case arm. Not touched.

Checks

  • uv run pytest, uv run pytest -n0 -m serial, uv run mypy, uv run ruff check
  • sphinx-build -b doctest, python -m doctest README.rst
  • tools/vocab/build.py --check, snapshot.py --record after reading every move

Review aspects run

  • code (twice, the second on the fix round)
  • tests
  • comments, plus the design-docs reviewer on docs/design/
  • silent failures

All findings were fixed or recorded above.

🤖 Generated with Claude Code

…short (#1394)

In a name written wholly in one case, a credential that is also a given
name written short (`md`) with a name word behind it no longer starts
rules/S8's credential run: its case is the name's and says nothing, so it
reads as its Title case does (#1019). `SITI NORA MD YUSRI` gives middle
'NORA MD', family 'YUSRI', as 1.4.0 through 2.3.0 did, where 2.4.0
through 3.1.0 gave suffix 'MD YUSRI'. The decline reports
`suffix-or-name`, the credential the reading not taken.

`_pieces.short_given_name_in_one_case` is a fourth writing in
`declined_by_the_name_behind`, so the run start, P2's chain stop and
assign's family-part pass ask one predicate. It keeps the run before a
word of no cased script and a maiden marker; a word in a maiden clause
or brackets asks the whole name's case (S6). `run_start` records the
decline in `Peel.declined` for assign to report. A numeral S10 reads as
the generation is no name word behind any declining writing (`John
Smith Md VI Jones` keeps the run).

Rules S8 amended, decisions/S8 entry with measurements, release-log
bullet, case rows, snapshot re-recorded for the new rules examples.

Closes #1394

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@derek73 derek73 added this to the 3.2 milestone Nov 19, 2026
@derek73 derek73 added bug suffixes Generational suffixes and credentials (rules/S) labels Nov 19, 2026
@derek73 derek73 self-assigned this Nov 19, 2026
short_given_name_in_one_case opened by refusing a token without the
given-abbreviation tag or a name not of one case, which both callers
test inline ahead of the call; the guard and its one_case parameter go,
the docstring stating the precondition. Assign's report loop asked that
a declined word hold a name role, which it always does: run_start walks
front to back and returns the first start, so a word it declines stands
in the name core. An assert in its place held over 2,757,102 parses
(19 words, 3 to 5 long, every comma position, three orders).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug suffixes Generational suffixes and credentials (rules/S)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MD inside a name in capitals reads as the degree and takes the father's name (MARIAM HAFIZAH MD MOKHTAR gives suffix 'MD MOKHTAR')

1 participant