Skip to content

Render all-caps 2-letter credential initials as all-caps (0.4.2)#22

Open
atalyaalon wants to merge 1 commit into
fix/nonchinese-normalizationfrom
fix/credential-initials-allcaps
Open

Render all-caps 2-letter credential initials as all-caps (0.4.2)#22
atalyaalon wants to merge 1 commit into
fix/nonchinese-normalizationfrom
fix/credential-initials-allcaps

Conversation

@atalyaalon

@atalyaalon atalyaalon commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@sergeyf — one small, final nit on top of the credential fix. Rendering only (no parse change), so it's low-risk; opening it separately so it's easy to review.

What & why

In 0.4.1 the credential fix recovered the surname for all-caps credential-collision initials (MS/MA/MD/…), but the given got re-cased to Title-case (MS Rahman → given Ms), so a kept initials token looked identical to the dropped Ms. honorific. This keeps a 2-letter all-caps given/middle token all-caps, so initials stay initials and no longer collide visually with the honorific.

Casing is (and stays) the discriminator — nothing about the drop logic changes:

  • all-caps MS Rahman = initials → kept (0.4.1 rendered Ms; 0.4.2 renders MS).
  • Title-case Ms Rahman = honorific → dropped (unchanged in both).

So MS Rahman (all-caps) and Ms Rahman (Title-case) are different inputs — 0.4.1 happened to render the kept one as Ms, which is the confusing collision this PR removes.

One-line change in _canonicalize_token (drop the not is_ambiguous_credential exclusion from the 2-letter all-caps branch) + test updates + version bump to 0.4.2.

0.4.0 → 0.4.1 → 0.4.2 by use case (given / middle / surname)

1. Leading initials + surname (the common case). 0.4.0 dropped the leading token and left an empty surname; 0.4.1 recovered the surname but title-cased the initials; 0.4.2 keeps them all-caps.

input 0.4.0 0.4.1 0.4.2
MS Rahman Rahman / — / — (empty surname) Ms / — / Rahman MS / — / Rahman
MA Hassan Ma / — / Hassan Ma / — / Hassan MA / — / Hassan
MD Ohman Ohman / — / — Md / — / Ohman MD / — / Ohman
JD Baum Jd / — / Baum Jd / — / Baum JD / — / Baum

2. Middle-position / non-leading initials. Same rendering fix, mid-name.

input 0.4.1 0.4.2
Miranda MA Whitten Miranda / Ma / Whitten Miranda / MA / Whitten
Sita MA Bierma-Zeinstra Sita / Ma / Bierma-Zeinstra Sita / MA / Bierma-Zeinstra
John MS Bartlett John / Ms / Bartlett John / MS / Bartlett
Gérard MD Ducable Gérard / Md / Ducable Gérard / MD / Ducable

3. Genuine honorifics — still dropped (unchanged). Casing is the signal: all-caps = initials (kept), Title-case = honorific (dropped).

input 0.4.1 0.4.2
Ms Rahman — / — / Rahman (Ms dropped) — / — / Rahman (unchanged)
Ms. Subbulakshmi — / — / Subbulakshmi — / — / Subbulakshmi
Dr Watson — / — / Watson — / — / Watson

4. Degrees — still dropped (unchanged). Trailing/mixed-case degree forms are unaffected.

input 0.4.1 0.4.2
Jane Doe EdD Jane / — / Doe (EdD dropped) unchanged
Robert Jones MD Robert / — / Jones (MD dropped) unchanged

Verification

Ran both 0.4.1 and 0.4.2 on the complete affected population — every corpus name containing an all-caps 2-letter credential token in any position (leading, middle, comma-form): 247,855 names.

  • 31,628 changed100% rendering-only (code-checked: identical tokens in identical slots, differing only by letter case), 0 regressions (no surname / order / accept-reject change vs 0.4.1).
  • Split: 22,718 leading (given) + 8,910 non-leading (middle/comma).
  • Real people are the bulk (MS Rahman = 89 papers with all-initials co-authors; Miranda MA Whitten, John MS Bartlett, …). The set also contains messy multi-credential affiliation strings (MBBS MS FRACS Winy Widjaja) where the rendering is cosmetically applied but the string is junk regardless — a separate reject gap, unchanged here.

Tests: added/updated cases for the all-caps rendering; full suite unchanged otherwise (only the pre-existing Chinese-routing failures remain, 0 new). ruff clean.

@atalyaalon
atalyaalon requested a review from sergeyf July 16, 2026 21:52
0.4.1 recovered the surname for all-caps credential-collision initials (MS/MA/MD...) but re-cased the given to Title-case (MS Rahman -> given Ms), so it read like the Ms. honorific. Keep a 2-letter all-caps given/middle token all-caps so initials stay initials; Title-case honorifics are still dropped. Rendering only: verified across the full affected population (247,855 names with an all-caps 2-char credential in any position) -- 31,628 changed, 100% rendering-only, 0 regressions (no surname/order/accept-reject change). Bump 0.4.2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant