Skip to content

Add salutations, offices and ranks in other languages to TITLES - #608

Open
derek73 wants to merge 2 commits into
masterfrom
feat/issue-606-salutation-titles
Open

derek73 wants to merge 2 commits into
masterfrom
feat/issue-606-salutation-titles

Conversation

@derek73

@derek73 derek73 commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Closes #606.

What changes

41 words join TITLES, grouped by language in nameparser/config/titles.py. They cover salutations (Mr / Mrs / Miss) and ranks ("Count") in Finnish, Estonian, Romanian, Croatian/Serbian, Icelandic, Dutch, Czech, Polish, Lithuanian, Swedish, Malay, Filipino and Georgian, plus Danish/Norwegian/German familie and the English offices commissioner, counsel and administrator. knt (Knight) joins SUFFIX_ACRONYMS beside kt, with a Knt case mask.

input 2.3.0 (also 1.4.0) this PR
Herra Väinö Johansson given Herra, middle Väinö title Herra, given Väinö
Familie Hansen given Familie title Familie, family Hansen
Police Commissioner James Gordon title Police, given Commissioner title Police Commissioner, given James
Sir John Smith Knt middle Smith, family Knt family Smith, suffix Knt
John Smith, Knt. title Knt. suffix Knt.

The graf class: borne as names, shipped anyway (decided)

The issue proposed shipping greve, graaf and knight, all borne as surnames, on the precedent of graf, which already ships though Steffi Graf exists. The spot-check the issue asked for (forebears.io, 2026-10-04) found ten more of its words borne as names: herra, batoni, ponas, counsel, ponia, ginoo, ginang, binibini, hrabia and kreivi. Most of them are surnames written last; a few have small given-name or surname-first counts. All thirteen ship by decision, and each is marked # borne.

  • Who is unaffected: bearers who write the word last or before a family comma. Gladys Knight and Knight, Gladys keep family Knight.
  • The cost: a name that BEGINS with the word gives that word to the title, as Graf Steffi already did. Greve Anna gives title Greve, family Anna, and Herra Wijaya loses its given name the same way. Declaring a family-first order does not help; a comma does.
  • Where it's recorded: the cost is stated in a new Accepted clause in rules.md#H1. decisions.md#salutation-titles records the counts and that this is an exception to #vocabulary-collisions C-i, scoped to TITLES and these words. C-i itself carries a dated pointer to it.
  • The line is partly unmeasured. The excluded side (thiru, puan, pan, rodina, ông/bà) was judged without counts, and the entry says so.

Excluded

Recorded in decisions.md's Excluded (TITLES) block:

  • Vietnamese ông/bà: Ông is a surname and Vietnamese names lead with it. A case row pins this under FAMILY_FIRST_GIVEN_LAST.
  • thiru and puan: given names.
  • pan: the Chinese surname Pan, which leads.
  • rodina: a Russian surname, often written surname-first.
  • gróf: unverified.
  • cik, paron, tikin, Latin janab: unverified.
  • marshal and justice: given names.

gravos was dropped rather than excluded, because it couldn't be confirmed as the Greek word for "Count". The Greek word itself, κόμης, is not added and not excluded; it is left as an open decision.

Measurement

  • No existing name moves. Over the corpus glob, none of the 1,809 lines moved before the rules.md examples were added.
  • One new example moves. The single mover is the new H1 example Greve Anna. It is classified in all five ledgers; three comma rules' recorded claims grow by Greve, Anna (reach only).
  • How to recompute: the recipe is in the decisions entry.
  • Gate: exits 0 at 1.4.0, 2.0.0, 2.1.0, 2.2.0 and 2.3.0.
  • Old readings: the release log's "before" readings were checked against the 1.4.0 and 2.3.0 wheels.

Review

Two design-docs-reviewer rounds ran. The first round's five findings are fixed in the first commit: the class described too narrowly, the given-name cost not stated, a moot Fru argument, an ambiguous recipe, and the H5 trailing period. The second round's two findings are fixed in the second commit: the exception framed against the wrong part of C-i, and the uncounted excluded side.

Test plan

  • uv run pytest: 11294 passed, 336 skipped, 3 xfailed
  • uv run mypy, uv run ruff check
  • sphinx-build -b doctest docs
  • Differential gate at every ledger baseline, exit 0

🤖 Generated with Claude Code

derek73 and others added 2 commits October 4, 2026 03:05
TITLES had no salutation for Finnish, Estonian, Romanian,
Croatian/Serbian, Icelandic, Czech, Lithuanian, Malay, Filipino,
Georgian and others, so "Herra Väinö Johansson" read given 'Herra'.
41 words join TITLES, grouped by language in titles.py, and knt
(Knight) joins SUFFIX_ACRONYMS beside kt with a 'Knt' case mask.

Thirteen of the words are borne as names, though rarely as the first
word of one (greve, graaf, knight, herra, hrabia, ...). They ship on
the graf precedent (Derek's call): a name that begins with one gives
it to the title, as "Graf Steffi" already did. rules.md#H1 gains an
Accepted clause for that cost, and decisions.md#salutation-titles
records the per-word counts plus the Excluded (TITLES) rows (ông/bà,
thiru, puan, pan, rodina, gróf, marshal, justice, ...).

The one corpus mover is the new H1 example "Greve Anna", classified
in all five ledgers; three comma rules' claims grow by "Greve, Anna".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Second review round: the class overrides C-i's position test for
measured leading-position bearers, not its uncertainty fallback, so
C-i's entry now carries a dated pointer to the one exception and its
scope (TITLES, these words). The entry also says the excluded side of
the line was judged without counts, so the line is not reproducible
from the record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 2.4 milestone Oct 4, 2026
@derek73 derek73 self-assigned this Oct 4, 2026
@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.98%. Comparing base (aab5fa9) to head (c789c9e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #608   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files          45       45           
  Lines        4241     4241           
=======================================
  Hits         4198     4198           
  Misses         43       43           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Salutations and titles in other languages read as given names: Herra Väinö Johansson gives given Herra

1 participant