Skip to content

Read a second name after an alias marker as the nickname - #1504

Merged
derek73 merged 12 commits into
masterfrom
feat/issue-1164-alias-markers
Nov 20, 2026
Merged

derek73 merged 12 commits into
masterfrom
feat/issue-1164-alias-markers

Conversation

@derek73

@derek73 derek73 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Closes #1164

What it does

A second name written after an alias marker is read as the nickname, and the marker is dropped (rules/N4, the alias marker, new).

Input master (and 1.4.0 through 3.1.0) this branch
Rahim @ Jaki bin Osman middle @ Jaki, family bin Osman nickname Jaki, family bin Osman
Ravi Kumar urf Raju middle Kumar urf, family Raju family Kumar, nickname Raju
Tan Wei Keong @ Daniel Tan middle Wei Keong @ Daniel nickname Daniel Tan
Ravi Kumar (urf Raju) nickname urf Raju nickname Raju

The decisions recorded on #1164 (2026-11-20):

  • Default markers: @ (written as a word of its own) and urf are markers by default.
  • Opt-in markers: alias and aka ship written default = false. A caller turns them on with Lexicon.default().add("aka", "alias", kind="alias_marker"), recipe in docs/customize.rst. A choice of English turns them on too.
  • Where an alias ends: at a patronymic particle (bin, binti, a/l, a/p, anak), at another marker of either kind, or at the end of its part. With no such boundary, it ends where M2's maiden clause would: before the trailing post-nominal and title run in the part holding the family name.
  • Where a marker counts: in any part that may hold a name word, the given part after a family comma included (OSMAN, RAHIM @ JAKI).
  • The fork: two or more words after the marker, with no boundary among them, are all taken (Rahim @ Jaki Osman gives nickname Jaki Osman). Whether to report this as an ambiguity is recorded as Open in decisions/N4. No new kind is added; it needs an issue of its own.
  • Left alone: a glued X@Y, an e-mail address and an @handle.
  • Bracketed clause: a clause led by a marker reads as the nickname without the marker, in a maiden pair too.

Mechanism

  • Vocabulary: a new reading kind alias_marker in the relation category compiles to ALIAS_MARKERS, internal set Lexicon._sets.alias_markers. Classify tags the word vocab:alias-marker.
  • Shared take: group's maiden take was split into _clause_take, which asks M2's three questions (where a marker counts, what it takes, the bound trailing run) for either marker. _maiden_take and the new _alias_takes call it with their own role. The alias pass runs first; an alias stops at a maiden marker, so the two read apart in either order.
  • Bracketed clause: extract's _alias_marked and group's clause drop.

Narrower forms declined

  • One word after the marker: right on one-word aliases and wrong on every longer one: 4 two-word aliases in the given part, 10 after the father's name, 17 whole second names.
  • Running to the end, as M2 does: wrong on all 23 aliases written inside the given part before bin.
  • Pairing word counts on either side: no pattern supports it.
  • @Word as a marker: a handle in 13 of 16 uses.
  • Splitting a glued X@Y: 15 aliases against 8 strings that are no name.
  • Default on lower case only: a lower-case alias/aka in a mixed-case name was a marker 29 of 29 times, but most markers are written in capitals.

The counts are hand labels over master e0f698c's local corpora; decisions/N4 says how they were extracted.

Measured (against the merge base de8324a, --base)

Every name the change moved had previously read the marker inside a name field. So nothing that was right became wrong, though in the fork shape the family field empties.

corpus moved right the fork (family lost or unclear) wrong before and after
my-candidates 71 64 5 2
opensanctions-parliaments 3 3 0 0
orcid-researchers 10 8 2 0
nepal-candidates 2 1 1 0
psc-individuals 3 1 2 0
fec-individuals 0
  • my-candidates' 2 wrong before and after:
    • A whole second name holding bin, whose alias stops at the patronymic particle.
    • The unlisted B abbreviation (X @ Y Z B W shape), which the alias runs through.
  • Agreement with the filed boxes:
    • PSC: the 3 urf names count as regressions, because the filers typed the alias into the surname box (Mr Ravi Kumar Urf Raju shape).
    • ORCID: 1 regression, a whole second name whose last word the filer boxed as the family. Its 7 other moves disagree with the boxes both before and after, because the boxes hold the @.
  • Committed snapshot: one name moved (the fork).
  • CLDR, GND and Wikidata agreement: unmoved.
  • Frames:
    • John Smith 91 → 90, Smith, John 99 → 98, a nickname name 146 → 144, Jane Doe nee Smith 143 → 141.
    • The reference stays inside its band (196.72).
    • A new scaling row, alias_markers, guards a part holding many markers. It measured 7.1x before the linearity fix.

Sweeps

  • Comma shapes, all four: no comma, a full name before the comma, one word before it, nothing before it.
  • The three name orders.
  • Capitals, lower case and mixed case.
  • The fullwidth @.
  • Bracketed and quoted clauses.
  • Every case row passes tools/differential/parity_check.py (0 of the parity rows read otherwise under 1.4.0).

Reviews run

  • pr-review-toolkit:code-reviewer
  • pr-review-toolkit:pr-test-analyzer
  • pr-review-toolkit:comment-analyzer
  • design-docs-reviewer
  • Fix commits: code-reviewer, twice. The second round found that the given-part fix traded disagreements with the comma-free twin for others, and that the maiden-marker cut ignored M2's refusals. Both are fixed: every listed shape now reads as its alias-free twin, save a lone roman numeral after a given-part alias (N4's Accepted).

Follow-ups (not in this PR)

  • A suffix value revises wrong: Parser.revise turns a suffix value holding a maiden marker behind an undotted suffix word into a different value. Rahim Osman Jr née Smith revises suffix Jr née Smith to Jr Smith. This is already true on master.
  • The fork report: whether to report the fork (above) needs an issue.

🤖 Generated with Claude Code

derek73 and others added 10 commits November 20, 2026 12:31
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>
N4 states its precedence over N3 and M1, scopes the bare-marker Except,
and names the suffix word that ends an alias before a boundary; the
decisions entry records how its figures were counted and flags the
scope labels' extra one; comments name the shared take.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…out of the alias's view (#1164)

An alias in the given part after a family comma now leaves a trailing
title, a bare salutation and a credential to the part's reading; a
maiden clause before the alias no longer counts as a word to spare for
the alias's trailing run; a nickname clause costs no frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…den-pair clause (#1164)

A marker left a word is no name word for the next marker; the alias
pass leaves the tail-part refusal to the shared take; N4 and the
customize page say a choice of English turns alias and aka on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… out, ask the maiden take (#1164)

The given part after a family comma no longer reads its end through the
clause-free view, which disagreed with the part's own walk; the alias
stops at a suffix word, a title or an ambiguous credential and hands
the rest back. A maiden clause is left out of the alias's count only
where M2's take takes it, and a maiden marker left a word is no name
word for an alias marker behind it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by test_parser's maiden-clause invariant: 'Rahim Osman @ Jaki
Prof. née Smith' took the title into the nickname.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it, stop at a trailing title only (#1164)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 nicknames Nicknames, brackets and quoted names (rules/N) labels Nov 20, 2026
@derek73 derek73 self-assigned this Nov 20, 2026
derek73 and others added 2 commits November 20, 2026 13:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop two branches no input reaches (a clause role other than maiden or
nickname, a joined piece as an alias boundary) and pin a title run
handed back from the given part, which codecov/patch found unrun.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nicknames Nicknames, brackets and quoted names (rules/N) 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 ALIAS, URF and @ mark a second name for the same person? (Ravi Kumar ALIAS Raju gives middle 'Kumar ALIAS', family 'Raju')

1 participant