Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ The compiled sets, read by `Lexicon` (mostly as the `_sets` field of the same na
- names a given name's second half reads — `PARTICLE_GIVEN_NAMES` (#704, a `given` reading written `after_particle`: "carmen", "ángeles", "lurdes", "graças", the Spanish and Portuguese words a compound given name writes behind a particle, which rules/P10 reads as a middle name in `María del Carmen García`, by default, and "piedade" only under a Portuguese choice, #1118, #1122), `SAINT_PARTICLES` (the `saint` kind, `san`, `santa`, `st`, `ste`, `sta`, `sto`, whose run P10 refuses, `Santa María` being a surname) and `SHARED_NAMES` (#704, a name reading written `shared`: Sikh "kaur", "singh", which rules/O6 and O7 neither take nor complete and P10 does not complete, `Kaur del Carmen García`), private; each is read through classify's tags or the lexicon in `_post_rules`
- conjunctions — `CONJUNCTIONS` (e.g. "and", "of") used to chain multi-word titles and to join name parts (rules/P3), plus `CONJUNCTIONS_AMBIGUOUS` (#383/#479, rules/P8, `may_be_initial`, refused by the build on anything but a cased single letter), the subset of single cased letters that read as an INITIAL in a name written wholly in one case — a marker set
- maiden markers — `MAIDEN_MARKERS` (`birth_marker` readings, e.g. "née", "geb.") routing the following name to `maiden`; with an `addresses = "given"` title, the one kind a phrase may be (`z domu`)
- alias markers — `ALIAS_MARKERS` (`alias_marker` readings, `@` and `urf`; `alias` and `aka` written `default = false`), private, routing the following words to `nickname` up to a patronymic particle, another marker, a comma or the trailing post-nominal run (rules/N4, #1164); classify tags the word `vocab:alias-marker`, and group's alias take shares `_clause_take` with the maiden take
- `config/_ko_surnames.py`, private since 3.0 (`config/surnames.py` through 2.x, 2.8.2 warning of the move) and read as `Lexicon.default().surnames` — `KOREAN_SURNAMES`, the census list the 2.0 API splits unspaced hangul on (#271), still written in Python with an import-time `assert_normalized`: a segmentation list, outside the per-word model, like the locale packs' lists.
- the views' kinds — `GENERATION_WORDS`, `CREDENTIAL_WORDS` (a credential written as a word), `HONORIFIC_WORDS` and `PATRONYMIC_PARTICLES` (3.0's 4b and 4c), private: the kinds the other sets do not record, which classify reads to tag a word for the `generation`, `credentials`, `honorifics` and `patronymic` views (rules/R8, rules/R9)
- case masks — `CAPITALIZATION_EXCEPTIONS` mapping of case MASKS (e.g. `{'phd': 'PhD'}`), compiled from the `cased` property, at most one per word: each value is its key's own letters and digits recased, laid over the word as written, so `ph.d.` repairs to `Ph.D.` and repair never writes the value's own punctuation into the word (#459); `Lexicon` raises `ValueError` on a value that spells anything else; and `CAPITALIZED_PARTICLES` (the `saint` and `rank` kinds, private), the particles case repair writes with a capital rather than in lowercase, keyed on the kind so a word needs no mask of its own (rules/R4, #1069), and `CAPITAL_OPENING_PARTICLES` (the particle readings written `capital_opening`, `ter` and `der`, private), the particles case repair writes with a capital where the word before it in the family name is no particle, nor, where it opens the family name, the word written right before it in any role (`Levon Ter Petrosyan`, but `Jan van der Berg` and `Van der Walt`), keyed on a property because `der`'s kind, `article`, is `de`'s and `la`'s too (rules/R12)
Expand Down
34 changes: 32 additions & 2 deletions docs/customize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ A kind belongs to a category, which decides what the reading does:
added in 3.2 (`Bound given names`_).
- ``bound_second``
* - relation
- The name after the word is the maiden name (``née``).
- ``birth_marker``
- The name after the word is the maiden name (``née``), or a
second name the person is known by, read as the nickname
(``@``, ``urf``; added in 3.2, `Alias markers`_).
- ``birth_marker``, ``alias_marker``
* - name
- The word is borne as a name. With no property it moves a parse
only beside another reading of the word (`Name readings`_).
Expand Down Expand Up @@ -512,6 +514,34 @@ credential is reachable as its component words:
>>> parse("John Smith, MD PhD").suffix
'MD PhD'

Alias markers
^^^^^^^^^^^^^

An ``alias_marker`` reading makes a word announce a second name the
person is known by, which is read as the nickname, the marker dropped.
``@`` written as a word of its own and ``urf`` are read so by default.
The English ``alias`` and ``aka`` ship turned off, because each is a
given name or a surname more often than a marker (``Aka`` is a Turkish
and an Ivorian surname); a choice of English (``languages={"en"}``)
turns them on with the rest of English's readings that are off by
default. If your records write them as markers, add just them:

.. doctest::

>>> fec = Parser(lexicon=Lexicon.default().add(
... "aka", "alias", kind="alias_marker"))
>>> boscia = fec.parse("BOSCIA, FRANK AKA FRANCIS")
>>> boscia.given, boscia.nickname
('FRANK', 'FRANCIS')
>>> parse("BOSCIA, FRANK AKA FRANCIS").middle
'AKA FRANCIS'

The alias runs to a patronymic particle (``bin``, ``a/l``), another
marker or a comma, and otherwise to the end of the name, less any
trailing suffixes and titles. So two words after the marker are both taken, which
is right for a whole second name and wrong for a one-word alias before
the family name.

.. _title-detection-off:

Turning title detection off
Expand Down
27 changes: 27 additions & 0 deletions docs/design/decisions/N4-alias-marker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# N4 — the alias marker

## Standing

- A word the vocabulary reads as an alias marker (the `alias_marker` kind), written as a word of its own with a name word before it, takes the words after it as the nickname and is dropped; the alias runs to the first patronymic particle or marker of either kind in its part, or with none to the end of the part as far as M2's clause would, and a bracketed or quoted clause led by a marker is the nickname without it — 2026-11-20 #1164.

- `@` and `urf` are markers by default; `alias` and `aka` ship written `default = false` and are turned on by a caller's `Lexicon.add(word, kind="alias_marker")` — 2026-11-20 #1164.

- A glued `X@Y`, an e-mail address and an `@handle` stay one word — 2026-11-20 #1164.

- One name word beside an alias keeps O5's reading, and N3 counts a delimited nickname only; a clause in a maiden pair led by an alias marker is the nickname — 2026-11-20 #1164, THE NEIGHBOURING RULES.

Open: reporting the fork as an ambiguity, left open by the decision on #1164; it needs an issue of its own.

## Log

- 2026-11-20 #1164 — THE ALIAS MARKER TAKES THE WORDS AFTER IT AS THE NICKNAME. Measured first on master e0f698c8 over the local corpora (each occurrence labelled marker, name or unclear by hand): the spaced `X @ Y` is an alias marker in all 109 of its uses and a name in none; `urf` a marker in 3 of 3 (all PSC; the 2024 Lok Sabha candidates' list, no local corpus, writes it 21 times); `alias` a marker in 43 and a name in 97 (a Malay given name and father's name, a Kerala name, a US surname, FEC's `ALIAS, FRED` shape seven times); `aka` a marker in 38 and a name in 90 (an Ivorian, Turkish and Nepali given name and surname). So `@` and `urf` ship on and `alias` and `aka` off, each written with `default = false` so its vetting stays on the word. A narrower default keyed on case was declined: a lower-case `alias` or `aka` in a mixed-case name was a marker in 29 of 29, but it misses every list written in capitals, where most markers stand.
HOW IT WAS COUNTED: every whitespace word of every local corpus's `corpus.jsonl` (all 18, under the tools' cache) equal to `@`, `urf`, `alias`, `aka`, `a.k.a.` or `a/k/a` after stripping brackets and commas, case-folded, and every word holding `@`, sorted by how the `@` is written; each match labelled marker, name or unclear by hand, and the labels not kept, so the figures are a dated hand judgment over that extraction. The Lok Sabha figures are #1164's own comment, from a list no local corpus holds.
THE MECHANISM is M2's take, shared rather than copied: `_group._clause_take` asks M2's three questions (where a marker counts, what it takes, the bound trailing run) for either marker, `_maiden_take` and `_alias_takes` calling it with their own role. What differs is where the alias stops: the scopes labelled over the spaced uses were 23 inside the given part ended by a patronymic particle (`X @ Y bin Z`), 31 after the father's name to the end, 26 one word to the end, 1 one word then a comma, and 29 of two or more words with no patronymic particle (110 labels for 109 uses: one label too many, which the unkept labels cannot settle). M2's clause runs to the end, which would have read all 23 given-part aliases wrong, so the alias also stops at a patronymic particle, at another marker of either kind and at a comma. And it counts in the given part after a family comma too, where FEC writes `FAMILY, GIVEN AKA OTHER`, which M2's marker never reaches.
DECLINED: taking one word after the marker, right on the one-word aliases and wrong on every longer one: the two-word aliases in the given part (4), the two- and three-word aliases after the father's name (10) and the whole second names of the fork below (17), and in the Indian `alias` uses the whole-name aliases (about 9); taking to the end as M2 does (the 23 given-part aliases); pairing word counts on either side of the marker, which no pattern supports (`Lau Chi Keong @ Thomas Lau`); reading `@Word` after a name word as a marker, which is a handle in 13 of 16 such uses; and splitting a glued `X@Y` at tokenize, an alias in 15 uses and no name in 8 (an e-mail address that lost its dot, a team code).
THE FORK: with two or more words after the marker and no boundary among them, the alias takes them all: 17 of the spaced uses are a whole second name (`Tan Wei Keong @ Daniel Tan`) and 10 a one-word alias before the family name, and in the Indian `alias` uses about 9 against 2. The one-word reading loses its family name to the nickname (N4's Accepted). Reporting it is left Open.
THE NEIGHBOURING RULES: N3 reads a lone word beside a delimited nickname as the family name, and an alias leaves it to O5 instead (`Osman @ Jaki` given 'Osman', reported; `Osman (Jaki)` family 'Osman'): N3's premise, a person set down by surname, does not hold of the Malay and Indian names that write an alias marker, which mostly hold no family name. And a clause led by an alias marker in a pair the caller declared maiden reads as the nickname, the marker saying which field it means, as M3's marker overrides a nickname pair.
THE GIVEN PART AFTER A FAMILY COMMA (code review, then its fix's review): the alias first stopped there at the first suffix word, so a trailing title, a bare salutation (H8), a member of the ambiguous class and a numeral its comma-free twin reads out stayed in the nickname (`Smith, John @ Jack Prof.`, `Doe, Jane @ Janey Mrs`, `Osman, Rahim @ Jaki V`). The first fix read the part's end through the clause-free view as the part holding the family name does; its review found that trading three disagreements for others (`Osman, Rahim @ Jaki Mc` read the suffix where the twin reads family `Mc Osman`, `Jaki PhD Ali` went whole into the nickname, a `KC` lost its report), the disagreement between `tail_reading` and the given part's walk that the root AGENTS.md's gotcha records. So the alias there stops instead at the first word that part's own reading may take out of the name (a suffix word, a title opening the part's trailing run, a member of the ambiguous credential class) and hands the rest back to that reading, which then reads it as it reads the same words with no alias: every shape both reviews listed reads as its twin, reports included, save a lone roman numeral. Handed back, `V` was reported with its initial reading in the middle name, while an initial written there (`Osman, Rahim @ Jaki Q`) is the alias's, which `tests/v2/test_cases.py`'s alternative check refused; so the numeral stays in the alias, as the initial it is shaped like does (N4's Accepted). The cost is a word handed back that the reading keeps a name word, read where the twin reads it (`Osman, Rahim @ Jaki St.` gives family `St. Osman`, N4's Accepted).
THE MAIDEN CLAUSE BEFORE THE ALIAS (same reviews): it is left out of the words the alias's trailing run counts against only where M2's take would take it, which is asked of the take itself over the words before the alias: `Jane née Jones @ JJ V` keeps `V` in the nickname, reported, as `Jane née Jones V` keeps it in the maiden name, and a marker M2 refuses (`Dr née Jones @ JJ V`, behind a title) leaves its words counted. A marker of either kind left a word is no name word for an alias marker behind it (`Jane Smith née @ JJ` reads maiden `@ JJ`, as master does).
THE SECOND FIX REVIEW: an alias ended by a maiden marker reads its end over the words before that marker (`Rahim Osman @ Jaki Prof. née Smith` gives title `Prof.`, as its twin does; found by `test_a_maiden_clause_changes_nothing_else`), but only where M2 takes the marker: behind a suffix word or with nothing after it the marker is a word, and its twin's suffix run keeps it (`Rahim Osman @ Jaki Jr. née Smith` gives suffix `Jr. née Smith`). And in the given part a title stops the alias only where it opens the part's trailing run: inside the part the walk keeps it a name word (`Osman, Rahim @ Jaki Dr Ali` gives nickname `Jaki Dr Ali`). Each reading compared with the same name written without the alias under the three name orders.
ORDER: the alias takes run before the maiden take, the alias stopping at a maiden marker, so `Jane Smith @ Janey née Jones` and `Jane Smith née Jones @ JJ` both read nickname and maiden apart.
MEASURED 2026-11-20 against the merge base de8324a8 (a `git archive` export), with `uv run python tools/differential/snapshot.py --local <corpus> --base <export>` and `local_agreement.py <corpus> --base <export>`: every moved name had read the marker inside a name field before (`middle '@ Jaki'`), so no field the change moved had been right; what each now reads, by hand: my-candidates 71 moves, 64 right, 5 the fork with no family left (one-word alias before a surname or a whole second name, unclear which), 2 wrong as before (a whole second name holding `bin`, which ends the alias at the patronymic; and the unlisted `B` abbreviation, which the alias runs through); opensanctions-parliaments 3 right; orcid-researchers 10, 8 right and 2 the fork; nepal-candidates 2, 1 right and 1 the fork; psc-individuals 3, the `urf` names, 1 right and 2 the fork; fec-individuals none (`aka` is off). The committed snapshot moved one name, the fork. Scored against the filed boxes, PSC's 3 count as regressions (the filers typed the alias into the surname box, `Mr Ghulam Ali Urf Adeel` shape) and ORCID's 1 (a whole second name whose last word the filer boxed as the family), its 7 other moves disagreeing with the boxes before and after (the boxes hold the `@`).
1 change: 1 addition & 0 deletions docs/design/decisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Entry conventions:
- [N1 — the default delimiter pairs](N1-default-delimiter-pairs.md)
- [N2 — same-character quotes and shared-character conventions](N2-same-character-quotes-and-shared-character-conventions.md)
- [N3 — the lone-word nickname rule](N3-lone-word-nickname-rule.md)
- [N4 — the alias marker](N4-alias-marker.md)

## Maiden names (M)

Expand Down
Loading