Skip to content

Read an unlisted mixed-case credential after a comma, such as MRes or AuD - #1517

Merged
derek73 merged 5 commits into
masterfrom
feat/mixed-case-credentials-after-a-comma
Nov 21, 2026
Merged

derek73 merged 5 commits into
masterfrom
feat/mixed-case-credentials-after-a-comma

Conversation

@derek73

@derek73 derek73 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

After a full name and a comma, an unlisted credential written in mixed case is now read the way an all-caps one is, when it opens with two capitals or ends in one (MRes, DClinPsy, AuD, BScN). parse("Jane Smith, MRes") gives given Jane, family Smith, suffix MRes, reported suffix-or-name. 1.4.0 through 3.1.0 gave given MRes, family Jane Smith.

What reads differently

Input Before After
Jane Smith, MRes given MRes, family Jane Smith given Jane, family Smith, suffix MRes
Jane Smith, AuD given AuD, family Jane Smith suffix AuD
Smith, M.B. ChB given M., middle B. ChB suffix M.B. ChB (rules/C16 amended, as Smith, J.P. AUD already read)
Jane Smith, LeBron / McKenzie / PhDc / Pharm-D given unchanged: a capital only inside the word, neither end, or a hyphen
Smith, MRes, JANE SMITH, MRes, , MRes given unchanged: one word before the comma, no case contrast, empty head
Alex Lee ONeill under CapsSuffixes.EVERYWHERE family ONeill unchanged: the mixed-case spelling is read after a comma only

Forced case repair keeps such a word as written (capitalized(force=True) of Jane Smith, MRes keeps MRes). The credentials behind a C16 run of initials now carry the caps shape's marks, so Smith, J.P. AUD and Ashley Knight, M.S. BME keep their capitals when forced (master wrote Aud and Bme).

Where it acts, and where it does not

  • caps_shape_candidate gained a required mixed_case switch.
    • _comma.decide passes True, at C4's count and C6's contrast and at C16's company test.
    • classify's trailing tag passes False, so the positions only EVERYWHERE reads take words in capitals alone. A surname typed without its apostrophe (ONeill, DSouza, OReilly) ends a name there, and about 770 ORCID family boxes hold one alone.
  • The comma's C-level filter asks the word's two ends (t[:2].isupper() or t[-1:].isupper()) beside isupper(). The frame counts of names the change does not read are unchanged against master: Smith, John 98, Smith, Mary McDonald 133, John Smith, McDonald 124.

Measured against master (snapshot.py --local <corpus> --base <master export>)

  • ClinicalTrials.gov officials: 915 of 539,368 moved.
    • 776 gain the credential (AuD, DClinPsy, DNSc, MBBChir, MRes, BMedSci, …).
    • 1 reads MDs where it had read Abd.
    • 138 move only a forced case view or a report's alternative.
  • ClinicalTrials.gov contacts: 652 moved, 580 of them gaining the credential.
  • ORCID researchers: 24 moved, all credentials. Scored against the filers' boxes (local_agreement.py --base): 5 fixed, 0 broken, 2 changed.
  • FEC, GOV.UK people, UK Electoral Commission, DOF signatures, PSC, PatentsView: 0 moved. The PSC and PatentsView agreement scores are unchanged.
  • One wrong name among the moved: LLuís, a Catalan given name typed with a doubled capital, behind a two-word head.

Accepted costs

These are recorded in rules/C6 and rules/C16 and in the dated entry in decisions/C6.

  • A given name in this spelling after a two-word surname reads as the credential, as one in capitals already does (García López, DAndre, John Smith, McDONALD). Narrowing the spelling would cost about 190 of the credentials gained (MScPT, PhDMD, MBBChBAO).
  • Behind a C16 run of initials, such a name is company, so the list loses its given name (Jansen, J.P. IJsbrand), as Jansen, J.P. IJSBRAND already did.
  • How much the costs can reach: given boxes holding a word of the shape number 577 of ORCID's 1.83M records, 55 in PatentsView and 0 in PSC. No fielded corpus composes either listing form.

Docs and records

  • Rules:
    • S9 defines the mixed-case spelling (When, the shapes bullet, Signal). C6 reads it and gains an Accepted section.
    • C16's Accepted bullet is rewritten, and it gains the IJsbrand cost.
    • R4 states the kept spelling and its precedence over R5, and that a word read past a second comma is still repaired (Jane Smith, PhD, MRes forced → Mres).
    • C1 and C4 headings now say the caps shape rather than "all-caps".
  • Decisions:
  • User docs:
    • policy.rst: the All-caps words section and its table row.
    • The missing-credentials recipe from Show how to find the credentials your data uses that the vocabulary lacks #1515, narrowed to the words the shape still misses (PhDc, Pharm-D), with a doctest for MRes's report.
    • The examples that removed phd in languages.rst and locales.rst, now written Phd.
    • customize.rst, usage.rst, and the CapsSuffixes and Policy.unlisted_caps_suffixes docstrings.
    • A release-log bullet.
  • nameparser/AGENTS.md: a new lesson. istitle() passes over a caseless letter, so "neither lower nor title case" is no wider isupper(): the first build dropped XיZ-shaped words, and the ctgov run found one.

Tests

  • Case rows for every moved shape, the unchanged twins and the narrower form's refusals: LeBron, McKenzie, DeShawn, PhDc, Pharm-D, MRes/AuD, Kim Jong, UN, one-case and lowercase names, empty and one-word heads, MRes Jones, Smith, Jane MRes, and Smith, J.P. LeBron.
  • Guard rows:
    • John Smith, XיZ holds the isupper() arm.
    • Alex Lee DSouzá under EVERYWHERE holds classify's mixed_case=False. It fails with the guard flipped; it is the only row that can, since only an NFD word reaches that predicate.
  • Unit and render tests: a table for the predicate's mixed arm, and a forced-repair test.
  • Rewritten: three tests that pinned the old reach, which removed phd to stand in for an unlisted word (test_parser, test_config_diff, the cs Jana Malá, MgA row).
  • Sweeps: four comma shapes × three orders × both caps settings × 12 words, against master. Only shape words after a comma behind two or more name words moved. The NFD spelling reads as its NFC twin.
  • Runs: the parallel suite, -m serial, the 3.15 suite in its own environment, sphinx doctest and html, ruff, mypy, and parity_check.py (0 of 772 rows).

Reviews

  • pr-review-toolkit code-reviewer: found the filter's frame cost on McDonald-type words, now fixed. It also found the costs to given names written in the spelling, which are measured and accepted above.
  • pr-test-analyzer: found the untested mixed_case=False guard, flagged two arms no input reached, and listed missing rows (added). The render guard's redundant islower() test was removed.
  • comment-analyzer: found stale prose in the docstrings, customize.rst, usage.rst, languages.rst and locales.rst, and the release-log wording.
  • design-docs-reviewer: found:
    • a cost claim the C16 run disproved;
    • R4/R5 precedence;
    • the shape's signal living in C6 rather than S9;
    • the S9 Standing form;
    • a missing decisions/R4 pointer;
    • C1/C4 headings.
  • A review of the fix commit: found that the other arm, the caps marks behind a generation, is reachable when a title stands before the surname (Dr. Smith Jr., AuD forced gave Aud). The arm is restored, with render rows that fail without it.

🤖 Generated with Claude Code

derek73 and others added 3 commits November 21, 2026 15:17
An unlisted word of letters in mixed case that opens with two capitals
or ends in one is the caps shape after a comma, in C4's count, C6's
contrast and C16's company, so "Jane Smith, MRes" gives suffix MRes and
"Smith, M.B. ChB" suffix "M.B. ChB" (rules/C16's Accepted bullet
amended). A capital only inside the word (LeBron), or a hyphen in it
(Pharm-D), keeps it a name word; the trailing positions under
CapsSuffixes.EVERYWHERE read capitals alone, so "Alex Lee ONeill" keeps
its family name. Case repair keeps such a word as written when forced,
and the company of a C16 run carries the caps shape's marks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comma's filter asks the shape's two ends in C, so a word with a
capital only inside it (McDonald, LeBron) no longer pays the count's
frames. Rules S9 now define the mixed-case spelling and C6 reads it;
C6 and C16 record the accepted costs (DAndre, McDONALD after a two-word
surname, Jansen, J.P. IJsbrand), R4 states its precedence over R5 and
where the kept spelling does not reach, and decisions/C6's cost
paragraph is corrected. Two code arms no input reached are removed, and
the rows the tests review asked for are added, among them the one that
pins classify's mixed_case=False.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 21, 2026
@derek73 derek73 added enhancement suffixes Generational suffixes and credentials (rules/S) labels Nov 21, 2026
@derek73 derek73 self-assigned this Nov 21, 2026
derek73 and others added 2 commits November 21, 2026 15:36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fix review found it reachable: behind a generation with a title
before the surname, C12 reads the word and the count marks nothing, so
'Dr. Smith Jr., AuD' forced gave 'Aud'. Its rows fail without the arm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit efdf0e1 into master Nov 21, 2026
14 checks passed
@derek73
derek73 deleted the feat/mixed-case-credentials-after-a-comma branch November 21, 2026 23:54
derek73 added a commit that referenced this pull request Nov 22, 2026
* Sweep the 3.2 cycle's prose inside the code: docstrings, messages, notes

Release checklist step 0, part B, over what changed since v3.1.0. No
reading moves: comments, docstrings, message text and case-row notes,
plus two tests that run the code two messages offer.

- API docstrings: ParsedName.nickname and Role.NICKNAME name the alias
  marker (#1164); surname1 names the family-comma division and W5's Han
  pair; ReadingSource.SHAPE names the mixed-case credential (#1517),
  and capitalized() its force exception; LexiconReading.category lists
  `familiar` and `spelling`; Policy.two_family_names and Parser.suggest
  name the suggester's two-family vote (#1452).
- Messages: a SettingEvidence row's refused vote offered a mapping, the
  NameEvidence shape, where a row takes a triple; each now offers its
  owner's shape, and a test evaluates both. The empty pair-list refusal
  says what `None` clears to; "a alias_marker" reads "an".
- Citation comments trimmed to quote, clause and pointer in _assign,
  _group, _extract, _vocab, _lexicon and _post_rules; the measurements
  they held are listed in the PR body for decisions/parse-cost.
- tools: suggest_measure's docstring lists the thresholds, populations
  and harness proof it has now; order_names' blocks are plural; the
  CLDR pack list, local_agreement's sources, build.py's three modules
  and two builders' cut --help line.
- tests/v2/cases.py notes: release ranges for notes naming a commit or
  "master", a stale fixture quote, abdul's long_names_only reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Address the review of #1533: unrecorded figures kept, messages per owner

- The three measurements no decisions entry holds yet (group's M1
  bisect, _extract._overlaps, _vocab's script sweeps) stay in their
  comments until part C moves them; the pointers had read as though
  decisions/parse-cost held them.
- A SettingEvidence row that is no triple, and a by_signal that is no
  iterable, are offered a row whose signal votes on the evidence's own
  setting (`_ROW_EXAMPLE`), not always a name_order row, which the
  two_family_names and patronymic_rules settings refuse.
- One article helper (`_lexicon._a`) for every "a {kind}" message, with
  honorific's silent h; the completed_by=None clause says it leaves no
  listed word completing the word, which completes_any can still join.
- Docstrings: surname1's family-comma example is under two_family_names;
  the nickname's alias marker is a listed one, @ and urf by default;
  ReadingSource.SHAPE's mixed-case word stands in a mixed-case name;
  Parser.suggest's two-family vote points at where it is weighed;
  suggest_measure's opening names every switch it suggests.
- Tests: the vote test runs over every signal not voting on the order,
  a new test runs every setting's offered row, the article is checked
  per kind, the completed_by clearing is read in a parse with its
  shipped list asserted first, and the bare-string test round-trips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Address the fix review of #1533: every setting offered code it takes

- A setting no signal votes on (initials_as_family, capitals_as_family,
  any other Policy field) was still offered a name_order row by the
  fallback, which it refuses: it is now told no signal votes on it and
  offered `by_signal=()`, and its by_signal iterable `()`.
- The two remaining "a {kind}" messages (attached on a reading, a phrase
  matching as a kind) take `_a`.
- locales.VI's docstring: CS's fragment removes a reading too (#970).
- Tests: the offered-row test runs both messages over the five settings
  suggest emits, the article test over every kind, the completed_by
  clause's text is pinned, and both signal helpers assert they yield
  rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Sweep the suggester's API docs for #1533: plain signals, rounded figures

From part A's report (#1534):
- Parser.suggest's docstring gives the rounded figures docs/suggest.rst
  shows, with no dates; the dated tables stay in
  decisions/group-suggestion, which it names.
- Signal's members say what each signal is and what it votes on, in a
  reader's words, without issue numbers or private table names.
- NameEvidence's docstring says what a vote holds: the order voted for,
  the PatronymicRule, or True or False, as docs/suggest.rst does.

And from the review of 093a07e: the two newly guarded article sites
(attached on a reading, a phrase matching as a kind) each get a test
over every kind that reaches them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Address the review of 7414f46: the first-surname vote's table and reach

- Signal.FIRST_SURNAME votes True on a surname researchers rarely write
  as a given name, the second of SURNAME's two tables, not on a
  romanized Chinese, Korean or Vietnamese one (`John Wang Smith` casts
  none).
- NameEvidence: a first-surname vote is cast only where
  two_family_names is weighed, not where the base has it on or an East
  Slavic rule is decided.
- Parser.suggest links its figures to the guide's limits section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
derek73 added a commit that referenced this pull request Nov 22, 2026
* Collect what the 3.2 prose sweep's parts left for each other

rules/C6's Then line says the caps shape it has read since #1517, and
the quote in `_comma` moves with it, gaining its clause line and
decisions pointer. Three measurements that lived only in code comments
(M1's clause bisect, `_extract._overlaps`, the compiled script sweep)
move into dated decisions/parse-cost bullets, the comments left as
pointers, and mechanisms.md's growth-guard bullet records that the
control says which unit a ratio is in. Four case rows labelled as fixes
read 1.4.0's fields and are parity rows, noted as #1467's are; two
parity rows note 1.4.0's comma-joined suffix; a duplicate row goes.
CONTRIBUTING.md's corpus count is retaken, and root AGENTS.md notes
locales.MS reading Puan as a title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Give the moved measurements their commits, interpreters and recipes

The script-sweep figure "roughly 70x" was 08026d3's rewording of
a102c86's 89x, its commit message saying 5x and 35x; the bullet now
says so. All three bullets note that no interpreter was recorded, and
the two with a guard say the guard, run against the fix's parent, is
the recipe. C6's mixed-case Then bullet now carries what the widened
Then does not: the spelling is the caps shape's after a comma alone,
and a word the shape refuses stays a name word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Say which guard reproduces which quadratic, and that M1's draft left none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 mentioned this pull request Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement suffixes Generational suffixes and credentials (rules/S)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant