Skip to content

Read a title written with a slash for its full stop as the title (#1149) - #1502

Merged
derek73 merged 4 commits into
masterfrom
fix/issue-1149-title-slash
Nov 20, 2026
Merged

derek73 merged 4 commits into
masterfrom
fix/issue-1149-title-slash

Conversation

@derek73

@derek73 derek73 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Closes #1149

#1497 left one of #1149's three questions open: question A, the slash. This PR builds the reading it proposed, so all three are now settled.

What changes

New rule T9 (a slash written for a title's full stop). It applies to a listed title that opens the name, or that opens the given part after a family comma, when the title is written with a slash where its full stop would stand. That title now reads as the title, and the slash is a separator that lands in no field. All four writings are covered, in any script:

Text master (e0f698c) this PR
د/ أحمد علي given د/, middle أحمد title د, given أحمد
د/أحمد علي حسن given د/أحمد title د, given أحمد
د / أحمد علي title د, given / title د, given أحمد
Dr /Jane Smith title Dr, given /Jane title Dr, given Jane
Smith, Dr/ Jane given Dr/, middle Jane title Dr, given Jane
أ.د/ أحمد علي title أ.د/ title أ.د

What a title must be. It is a title the vocabulary lists, and not also a suffix (CPO/L, Ms/), a given name (Dean/) or a saint particle (St/). A title listed with a slash of its own (mag/judge) is read whole.

What must follow the slash. One name word in T8's shape (rule T8: a word glued to the next at its full stop), with its full stops set aside so that initials count (Dr/ J. Smith), that no title or suffix reading claims outright. A title or suffix that is also a given name reads as it does after a full stop (Dr/ Dean Smith → given Dean, reported; Dr/ Md. Smith → given Md.).

Why this needs a split rule beside T8, and the narrower forms declined

The slash is cut off and its token dropped in script_segment, ahead of T8's division. Spans still index the original, so every later stage reads Dr Jane Smith.

  • Narrower: list the slashed spellings (د/) as titles, or read X/ as a title in classify. Declined. Either one reads only X/ word, which is 38 of the 86 names. The glued (X/word) and spaced (X / word, X /word) writings need a division all the same, and listing them copies the vocabulary title by title.
  • Wider: fold a slash at a word's edge, as _normalize folds a full stop. Declined. It would read a trailing Dr/ anywhere in a name, and would reach every listed word written with a slash.
  • Drop the slash in group, as C10 drops a suffix delimiter. Declined. Classify and C1's comma decision run before group, so both would read a / word.

What it leaves alone

Each of these has a case row, run against e0f698c, and each reads there as it does here:

  • credentials joined by a slash: MD/PhD, M.D/Ph.D, OTR/L;
  • the Malaysian relations a/l, a/p and s/o, and c/o;
  • A/Prof (A is no listed title), A/S, and a bracketed (UTC/GMT;
  • a title with a slash later in the name, behind another title, or ending the name;
  • two titles joined by a slash (Dr/Mrs), and a title joined to a credential (Dr/MD);
  • a word holding a delimiter or a digit after the slash;
  • a slash with no name after it;
  • a couple's surnames before a family comma (JURIST/KOVAC, DANIEL/KAREN);
  • a slash standing alone before a credential after a comma, which C10 parts.

Measured

tools/differential/measure.py --base was run against a fresh checkout of e0f698c, and re-taken after merging master against de8324a (after #1498, #1499 and #1500): every figure below is the same at both.

The 86, recounted from the merged tree. A listed title written with a slash opens 86 names in the local corpora. By list:

  • Egypt's parliament: 37 (Arabic script)
  • ORCID: 24 Arabic-script and 13 Latin
  • PSC: 7
  • ClinicalTrials.gov: 3 (2 contacts, 1 official)
  • FEC: 2

By the title that opens them: د 33, dr 14, أ.د 9, الدكتور 4, اللواء 4, دكتور 3, م 3, founder 3, prof 2, director 2, لواء 2, and one each of mr, dean, jurist, president, ا, المستشار and دكتورة.

88 snapshot entries move. By list: parliament 37, ORCID 36, ClinicalTrials.gov 9, PSC 6. Nothing else moves: no other local corpus, not the committed snapshot, and not the CLDR, GND or Wikidata records.

  • 77 now read correctly. Each now reads the title the slash stood after.
  • 11 were wrong before and are wrong after. These are two roles joined by a slash in a title box, such as PSC's Director/Owner … (title Director, given Owner, where master gave given Director/Owner), and ClinicalTrials.gov's job descriptions.
  • None became wrong. No name that master read correctly reads incorrectly here.

The scoring moves come from how the boxes were filled in, not from misreadings.

  • ORCID counts 9 records as worse. Each is a holder who typed Dr/ or د/ into the given-name box.
  • PSC counts 1, a forename box holding /James.
  • Parliament's alike view counts 19 members as apart. Each has a short spelling (د/ محمد علي) that now reads a title, beside a full chain of names that reads none.

It settles a cost #1497 recorded. On e0f698c, 23 snapshot entries read / as the given name. The 19 with a listed title before the slash now read the name after it; the 4 with no title before it keep /.

Frames. Measured with sys.setprofile:

  • A name with no slash pays nothing extra: the rule is gated on a C-level "/" in test.
  • A family-comma name that holds a slash elsewhere pays 3 to 5 frames more (Smith, Jane MD/PhD: 142 → 147).
  • Only a listed title at a head pays for the comma's decision (JURIST/KOVAC, …: 127 → 203).

With #1500's bound pairs

A slashed title before an Arabic bound pair reads as its full-stop spelling does, the pair joining the word the slash is cut from: د/ نور الدين محمد علي and د/نور الدين محمد علي give title د, given نور الدين; اللواء/ عبد الله أحمد علي gives given عبد الله; د/ محمد نور الدين gives family نور الدين. Four case rows hold these, each failing on de8324a (given د/ or د/نور الدين).

Reviews

The reviews run:

  • pr-review-toolkit: code-reviewer, pr-test-analyzer, comment-analyzer, code-simplifier;
  • design-docs-reviewer;
  • a code review of each fix commit, three in all, each of which found something.

They found and fixed:

  • Scope, from the first measurement. It caught my first build reading the part before a family comma (the couple above read title JURIST) and title/suffix duals (CPO/L, MS/CCRP). Both were taken out.
  • Code review.
    • A cut word holding a delimiter moved an earlier report off its token. The name after the slash now takes T8's word shape.
    • Given-name titles and suffixes after the slash were refused. They now read as after a full stop.
    • The comma decision was asked for every family-comma name holding a slash. It is now asked only where a head is a site.
  • Design-docs review.
    • A title holding its own slash (mag/judge) was cut at it. It is now cut at its last slash.
    • Several statements were fixed: the family-comma head's spaced writings are now recorded as an accepted cost, the per-title tally and the slash-as-given-name count were corrected, an undated count was removed from the rule, and a precedence bullet with no real contest was removed.
  • Test and comment review.
    • Four boundary rows wrongly claimed 1.4.0 parity. They are now labelled fix(#752), fix(#797) and fix(#889), each traced to the published wheels.
    • Several notes on 1.4.0's readings were corrected.
    • Rows were added to kill every surviving mutant.
    • Two counts were re-taken: the layering control (199 → 212) and the field sweep (2211 → 2217).
  • The fix commits' reviews.
    • Holding the name to T8's word shape also refused every initial and name written short after the slash (Dr/ J. Smith lost its title). Its full stops are now set aside for the shape.
    • Md. (Muhammad written short, also a credential) was refused. A given name written short reads as a name first unless written in capitals, so Dr/MD keeps its word. That fix moved one more corpus name to the right reading (V. Gross, Prof/ md).
    • A glued title and name alone before a suffix comma (Dr/Jane, PhD) is left unread, as on master, and recorded as accepted.
  • Simplification review. It restructured _divide_title_slash and the site code, and confirmed that no shared predicate is hand-copied.

Docs

Checks

All pass on the final tree:

  • the vocabulary build check, ruff and mypy;
  • the full suite, with and without the ja extra;
  • the serial tests;
  • the Sphinx doctests and README;
  • parity_check.py: 0 of 714 parity rows read otherwise under 1.4.0.

🤖 Generated with Claude Code

Add rules/T9: a listed title opening the name, or the given part after a
family comma, written with a slash in place of its full stop (`د/ أحمد`,
`د/أحمد`, `د / أحمد`, `د /أحمد`; `Dr/ Jane Smith`) reads as that title,
the slash's token dropped in script_segment ahead of T8's division. The
name after the slash is one name word in T8's shape, its full stops set
aside, that no title or suffix reading claims outright. A title that is
also a suffix, a given name or a saint particle is none, and the part
before a family comma is not read, a slash there joining two surnames.

Credentials joined by a slash, the Malaysian relations, c/o, A/Prof, A/S,
a title-slash later in a name, and title pairs keep their readings; each
has a case row run against e0f698c. Against e0f698c, measure.py --base
moves 88 snapshot entries, 77 to the title, 11 wrong before and after,
none wrong that read right (decisions/T9).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 20, 2026
@derek73 derek73 added vocabulary Fixed by a word-list entry: per-word vocabulary and language packs titles Titles and honorifics (rules/H) non-latin-script Names written in a script other than Latin (rules/W) labels Nov 20, 2026
@derek73 derek73 self-assigned this Nov 20, 2026
derek73 and others added 3 commits November 20, 2026 11:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 65adf2c into master Nov 20, 2026
14 checks passed
@derek73
derek73 deleted the fix/issue-1149-title-slash branch November 20, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

non-latin-script Names written in a script other than Latin (rules/W) titles Titles and honorifics (rules/H) vocabulary Fixed by a word-list entry: per-word vocabulary and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should د. and the Iraqi academic abbreviations read as titles? (د. أحمد علي حسن gives given 'د.')

1 participant