Repository navigation
Read Md., Mohd and Moh as Muhammad written short, MD still the degree - #1395
Merged
Merged
Conversation
`md` gains a given reading carrying `same_as`, so a leading `Md.` is the given name (`Md. Abdul Karim` gives given 'Md.', middle 'Abdul', where 1.4.0 through 3.0.1 gave title 'Md.'). A given reading carrying `same_as`, a name written short, now marks no clash with a suffix reading, so the medical degree stays an unambiguous credential (`John Smith, MD`, `AGAPE, MD`, `John Smith Md`); on the shipped vocabulary the rule reaches `md` alone, `ma` keeping its plain name readings and its ambiguity. A `same_as` may be a list, in the files and in `Lexicon.add`, kept as its text where it names one word. `md`, `mohd` and `moh` list the long spellings written where each is (muhammad, mohammad, mohammed, mohamed, and for mohd and moh mohamad), so the name match reads `Mohd Rahman` / `Mohammad Rahman` as `listed-spelling` by default. Closes #1383 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The review of 0cbe551 found `Lexicon.words(kind="given", same_as="muhammad")` dropping `mohd` and `moh` once each listed several long spellings: a reading's `same_as` is now carried where every word asked is among the words it names. docs/customize.rst says a list is taken and that a given name written short takes a credential's doubt away (`Smith Jd` under a caller's `jd` edit); docs/matching.rst no longer overstates how the long spellings agree; nameparser/vocab/AGENTS.md's `md` example says the abbreviation is now recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1390's capitals rule meets `MD`, now a listed short form of Muhammad: `MD Rahman` / `Mohammad Dewan Rahman` reads its listed spelling before the rule is asked, so its `_CAPITALS` row moves to the already-consistent group and the recorded control from 16 rows to 15. A test pins both readings of `MD`, and the decisions entry records the interplay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… of #1383 #1393: rules/C13 gains an Except. A credential that is also a given name written short (`md`) opens the given part after a family comma, behind no whole name, where it is written with a lower-case letter in a name of mixed case or a name word follows it (`Rahman, Md`, `RAHMAN, MD ABDUL` -> given 'Md'); in capitals alone, before a credential or half of one, or behind a whole name it stays the degree. rules/H2 gains the matching Except. The review's items: - `md`'s credential moves to mul.toml beside its given reading, so a strict choice keeps the degree (`John Smith, MD.` read given 'MD.' under every strict pack); measured over every pack, plain and strict. - one predicate, `ReadingProperties.marks_a_clash`, for the suffix markers, check 11's agnomen clause and `Lexicon._check_pool`: a given name written short gates no agnomen; its title and particle limit is pinned with its reason. - `same_as` errors follow the taxonomy, each message offering code a test runs; a row kills the `_heads` last-head mutant. - `add("md", kind="given")` is documented with the `same_as=None` and `remove` recipes as doctests; the pickle bullet covers 3.0.x. - decisions: indic-honorifics, C3, C13, vocabulary-model and name-matching record what this reverses and why, the recipes corrected and re-run, the counts dated; made-up names throughout. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…xcept The Except asks the first word behind the part's titles; a part whose every word is a title asks none. No shipped word reaches that path, so codecov/patch counted the line uncovered: a caller's word that is a title, a particle and a given name written short does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The second review of a7755a4: - a lone Md behind a title after a family comma read the title as the given name; it keeps master's reading, title and suffix 'Md', the Except firing there only where a name word follows - the Except reports suffix-or-name, the credential as its alternative, as `ma` does in the same slot - narrowed to the record: the lower-case arm reads a word alone in the part, and a name word carries no suffix or title tag of any kind (one prefix test), so `Smith, Md PhD`, `Smith, Md XYZ` and `SMITH, MD DEAN` stay the degree; the arm compares the word with its credential's case mask; each clause has a row only it refuses, mutation-checked - `md` lists `muhammed` (decided 2026-11-14); the mul move recorded as decided - rules C8 and H2 point at the Except, C13's Signal line names what it reads; the docs' stale strict, before-reading, count and attribution passages corrected, each count with its recipe and date Co-Authored-By: Claude Opus 5.5 <[email protected]>
The closing review of 1e2103d. The rule's code changes by two lines: an initial behind `Md` is counted in letters (`composed_len`), so `Rahman, Md É` reads alike composed and decomposed; and a conjunction behind it is no name word (`Rahman, Md and Karim` reads as on master). The alone arm's lower-case test is pinned (`Smith, PHD`). Recorded as Accepted, each with a rule example, a case row and a dated line: a mixed-case Md before a title that may be a name, before a name in capitals (a move under strict bn), and a lone Md behind a title (the match reads Md. Rahman / Rahman, Mr Md one-sided). The docs restating the Except before its narrowing point at rules/C13; the measured figures are re-taken once and stated alike; the AmbiguityKind docstring names the new report; a real official's name is replaced. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 15, 2026
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.
Md.,MohdandMohread as Muhammad written short, and the medical degreeMDkeeps its reading.Mdopening the given part after a family comma reads as the given name where its writing says so (#1393). This is #1383's shape (a), with the two parts decided after measurement (#1383's amendment comment). It reverses the 2026-10-27 ruling that kept a leadingMd.a title (decided for this PR).What changes
A leading
Md.is the given name.mdgains agivenreading carryingsame_as, in mul.toml, aswmandchashave.parse("Md. Abdul Karim")gives givenMd., middleAbdul. 1.4.0 through 3.0.1 gave titleMd.(wheels run outside the tree).Mdafter a family comma (#1393, rules/C13's new Except). Where the part opens, behind any titles, with an unambiguous credential that is also a given name written short, and no whole name stands before the comma (C3's count, a title counting as a word), it opens the given part:Rahman, Md,Rahman, Md.).Rahman, Md Abdul,RAHMAN, MD ABDUL,Uddin, Mr Md Karim,Smith, MD J). A name word is no conjunction and has no suffix or title reading of any kind. It is no half of a split credential, and it holds a letter. In a name of mixed case it is no word in capitals, but an initial counts, counted in letters soRahman, Md Éreads alike composed and decomposed.RAHMAN, MD,rahman, md.,Smith, MD PhD,Smith, Md PhD,Smith, Md XYZ,SMITH, MD DEAN,SMITH, MD SHEIKH,RAHMAN, MD 2,Rahman, Md and Karim,Dr. Rahman, Md,Rahman Khan, Md Abdul.Smith, Dr. Md,Uddin, Mr Md,Rahman, Mr. Md.).suffix-or-name, the credential as the alternative, asmareports in the same slot.md's credential moves to mul.toml beside its given reading (decided 2026-11-14). A strict choice keeps only its languages' files and mul.toml. So with the credential in en.toml and the given reading in mul.toml, every strict pack readJohn Smith, MD.as given 'MD.'; master's strict packs readJohn Smith, MDas given 'MD' already. This reverses, in part, the 2026-11-02 #1005 decision that keptmdin en.toml. That decision's reason, strictbnreadingRahman, Mdas a credential, is answered by #1393.A given name written short makes no acronym ambiguous (decided in #1383's amendment), and, as an implementation choice, no suffix word either.
ReadingProperties.marks_a_clash, is read by the compile, the build andLexicon.mdalone;makeeps its ambiguity.same_asmay be a list.compile_readings, andLexicon.add(same_as=[...])(a single word is kept as its text).words(same_as=...)matches a reading by any word it names.TypeErrorfor a wrong type,ValueErrorfor a list or text naming no word.same_as=""raisedTypeErrorthrough 3.0.1, which the release log notes.add("md", kind="given")changes nothing now:addupdates only the properties it is given. docs/customize.rst gives the working calls as doctests:same_as=Nonefor 3.0's plain given reading;remove("md", kind="given")for 3.0'sMd.title.Pickles: a 3.1 pickle does not load under 3.0.x, and did not before this PR (master's fail on 3.0.1 on its title readings'
same_asand its newPolicyPatchfields). The pickle bullet says so.The lists, by the first word of ORCID's given boxes, recounted 2026-11-14 (recipe in decisions/vocabulary-model):
mdmuhammad,mohammad,mohammed,muhammed,mohamedmohdmuhammad,mohamad,mohammad,mohammed,mohamedmohmdaddingmuhammedwas decided 2026-11-14. Whethermohdandmohlist it (12 and 4 there; Turkey writes it 2,544 times) is not decided, and they don't.What moved
Snapshot (re-recorded after every entry was read):
Md. Abdul Karimtitle → given;Uddin, Mr Md Karimsuffix → title, given, middle, reportingsuffix-or-name;suffix-or-name;John Smith, MD MEngandjohn smith, md maalternative sourceposition→declared;The CLDR and Wikidata agreement records match.
Corpus names holding
mdafter a comma (,[^,]*\bmd\b, case-insensitive, this branch against 3dadc26):Mohd RahmanmatchMohammad Rahman? #1383's leadingMd.; 14 areMdafter a family comma reads as the degree and takes the given name with it (Rahman, Md Abdulgives suffix 'Md Abdul') #1393's comma (FEC 9, PSC 3, ORCID 2), 13 of them right. The one wrong is the degree written before a given name (SMITH, MD JANEshape), recorded as Accepted.Every pack, plain and strict (160,441 names holding
md,mohdormoh, this branch against 3dadc26):Md./Mohd.title → given; 279 to 281 gluedMd.Worddivides; 21 or 22 #1393; 1 other (improved)VIplainMd.)Anna Weber, MD: given 'MD' → suffix 'MD')RU, TR_AZ and ZH refuse
strict=True.match_diff.py --base <checkout of merge base aad9ca8e>(NAMEPARSER_TOOLS_CACHEa folder of its own): 31,376 pairs under 22 settings. The key guarantee holds. 10,074 of 690,272 rows move, every one a pair holdingMd.,Md,MohdorMoh.Md Rahman/Muhammed Rahmanamong them), the name written both ways round a commaMd. Rahman/RAHMAN, MD(16), aMohammed.title (17)Mdis now a given name on both sides, conflicting with another given name (J. R./Dr. Md. Rahman)-folded(Md.againstMd),-one-side(the middle name on one side)Accepted, recorded
MDin capitals alone after a family comma stays the degree:RAHMAN, MDcannot be told fromNOVAK, MD, which 107 ClinicalTrials.gov officials write.Mdbehind a title after a family comma stays the credential (master's reading). SoMd. Rahman/Rahman, Mr Md(andMrs Md,Dr. Md) isgiven-one-sidewith no shared key, consistent only under+given-one-side. Master read it consistent because neither side had a given name. The (title, given 'Md') reading that would make it consistent needs a change in assign's given-part walk, not built. Recorded in rules/C13's Accepted section and decisions/name-matching.Mdbefore a title that may be a name stays the credential (Rahman, Md Sheikh Karim,Rahman, Md Dean): no local corpus writes the shape (,\s*Md\.?\s+(Sheikh|Dean|King|Shekh|Prince|Sheik|Shaikh)\b, case-sensitive, 0 matches).Mdbefore a name in capitals stays the credential (Rahman, Md KARIM):,\s*Md\.?\s+[A-Z]{2,}in a name not wholly in capitals matches 5 ctgov entries, every one the degree before another credential behind a whole name. Under strictbnthis moves from master's given 'Md', middle 'KARIM' to the suffix, as the default reads it;Rahman, Md Karimreads given there.SMITH, MD JANE), 1 of FEC's 9 such movers.Dr. Rahman, Md,Rahman Khan, Md Abdul).Mohammed. Rahman): 10 of 22,986 ORCID names opening with a long spelling write it.Mohammad Rahman~Md Rahman~Muhammad Rahman.mstkeeps its cost (Begum, Mst Amina→ suffix), having no given reading.MDinside a name in capitals reads as the degree and takes the father's name (MARIAM HAFIZAH MD MOKHTARgives suffix 'MD MOKHTAR') #1394 (SITI AMINAH MD.NOOR) and ReadAbat the head of a name as a given name, Abdul written short (MalayAb Hamid Mohd Nazahargives titleAb) #1178.Tests and controls
Smith, Wm Jonesreports nothing), the letter test, the whole-name guard, the report, the title loop.fix(#1393)row, C13's examples, the property test (66 pairs) and both sweep counts fail._MD_KEEPS_ITS_CREDENTIAL(11 rows): 10 move withmdambiguous again. The agnomen clause, the_headslast-head mutant and the title/particle limit each have their row.Smith, Md XYZunder three orders;SMITH, MD DEANandSMITH, MD SHEIKHjoin_STAND_IN_REREADS, asSmith, MD Pharm DandSMITH, MD MBA, JANEdid last round).Should the Except be its own rule? (open follow-up, not decided)
I recommend it, in a follow-up. It now has its own When (a credential that is also a given name written short), its own signal (the word's writing and the word behind it), and C3's count as a precondition. C8 and H2 both point at it, and C13 is left holding an Except larger than its Then. Splitting it would give it a When / Then / Because of its own and let C13 return to the credential run alone. Not done here.
Merged with #1390
MDin capitals is both Muhammad written short and #1351's capitals word. #1351's rule is asked only where a pair is not otherwise consistent, soMD Rahman/Mohammad Dewan Rahmanreadslisted-spelling._CAPITALS' control moves from 16 rows to 15.Checks
uv run pytest: 48,424 passed.uv run pytest -n0 -m serial: 38 passed.namedivider-python, and on Python 3.15, each in its own environment: 48,424 passed each.uv run mypyanduv run ruff check.sphinx-build -b doctest: 912 tests, 0 failures.python -m doctest README.rst.tools/vocab/build.py --check,snapshot.py --recordafter reading every move,cldr_agreement.py.match_diff.py --base, the pack sweep and the corpus comparison, as above.Review aspects run
pr-review-toolkit:code-revieweron 0cbe551: findings fixed in a8f932f.muhammed): 1e2103d, with ce5b824 (coverage).Closes #1383
Closes #1393
🤖 Generated with Claude Code