Render all-caps 2-letter credential initials as all-caps (0.4.2)#22
Open
atalyaalon wants to merge 1 commit into
Open
Render all-caps 2-letter credential initials as all-caps (0.4.2)#22atalyaalon wants to merge 1 commit into
atalyaalon wants to merge 1 commit into
Conversation
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.
atalyaalon
force-pushed
the
fix/credential-initials-allcaps
branch
from
July 17, 2026 00:07
af3d661 to
b715ff0
Compare
This was referenced Jul 17, 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.
@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→ givenMs), so a kept initials token looked identical to the droppedMs.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:
MS Rahman= initials → kept (0.4.1 renderedMs; 0.4.2 rendersMS).Ms Rahman= honorific → dropped (unchanged in both).So
MS Rahman(all-caps) andMs Rahman(Title-case) are different inputs — 0.4.1 happened to render the kept one asMs, which is the confusing collision this PR removes.One-line change in
_canonicalize_token(drop thenot is_ambiguous_credentialexclusion 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.
MS RahmanRahman / — / —(empty surname)Ms / — / RahmanMS / — / RahmanMA HassanMa / — / HassanMa / — / HassanMA / — / HassanMD OhmanOhman / — / —Md / — / OhmanMD / — / OhmanJD BaumJd / — / BaumJd / — / BaumJD / — / Baum2. Middle-position / non-leading initials. Same rendering fix, mid-name.
Miranda MA WhittenMiranda / Ma / WhittenMiranda / MA / WhittenSita MA Bierma-ZeinstraSita / Ma / Bierma-ZeinstraSita / MA / Bierma-ZeinstraJohn MS BartlettJohn / Ms / BartlettJohn / MS / BartlettGérard MD DucableGérard / Md / DucableGérard / MD / Ducable3. Genuine honorifics — still dropped (unchanged). Casing is the signal: all-caps = initials (kept), Title-case = honorific (dropped).
Ms Rahman— / — / Rahman(Ms dropped)— / — / Rahman(unchanged)Ms. Subbulakshmi— / — / Subbulakshmi— / — / SubbulakshmiDr Watson— / — / Watson— / — / Watson4. Degrees — still dropped (unchanged). Trailing/mixed-case degree forms are unaffected.
Jane Doe EdDJane / — / Doe(EdD dropped)Robert Jones MDRobert / — / Jones(MD dropped)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.
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).
ruffclean.