Skip to content

Document FAMILY_FIRST_GIVEN_LAST, and fix the name-order example it exposed - #347

Merged
derek73 merged 2 commits into
masterfrom
docs/family-first-given-last
Aug 7, 2026
Merged

Document FAMILY_FIRST_GIVEN_LAST, and fix the name-order example it exposed#347
derek73 merged 2 commits into
masterfrom
docs/family-first-given-last

Conversation

@derek73

@derek73 derek73 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

FAMILY_FIRST_GIVEN_LAST appeared in the docs only as reference-table entries — the API entry in modules.rst, one clause in the Policy field table, and a changelog bullet. Nothing showed what it does to a name. Since it is keyed to no script and has no locale pack, an explicit Policy is the only way to reach it, so the guide was the one place a reader could have found it.

Writing that up surfaced a problem in the example already there.

The old example was inert

customize.rst demonstrated FAMILY_FIRST with "Nguyen Van Minh" — a Vietnamese name, while modules.rst names Vietnamese as the exemplar for FAMILY_FIRST_GIVEN_LAST. The two pages disagreed on the same name.

It also could not distinguish the two constants:

Nguyen Van Minh
  FAMILY_FIRST     family='Nguyen'  middle=''  given='Van Minh'
  FF_GIVEN_LAST    family='Nguyen'  middle=''  given='Van Minh'

Van collides with the Dutch particle van in particles_ambiguous, so the vocabulary layer joins it forward before the positional layer ever sees three tokens. The doctest passed, but it was exercising particle-joining rather than name_order, and reported the Vietnamese given name as "Van Minh" rather than "Minh".

Remove the collision and the constants separate:

Tran Quoc Toan
  FAMILY_FIRST     family='Tran'  middle='Toan'  given='Quoc'
  FF_GIVEN_LAST    family='Tran'  middle='Quoc'  given='Toan'   ← correct Vietnamese

Changes

  1. FAMILY_FIRST moves to a Hungarian name — what modules.rst already claims for the constant, and free of the collision. The middle field is now shown so the assignment order is visible.
  2. FAMILY_FIRST_GIVEN_LAST gets the Vietnamese name, contrasted against FAMILY_FIRST on that single name, with a sentence of naming background first and a note that the order is keyed to no script (Latin carries none) and has no vn pack yet (Wrong parsing of vietnamese names #146).
  3. The collision is recorded as prose plus a unit test rather than a second doctest block, per the lean-docs rule.

It extends the existing name-order section rather than adding a sibling — the constant only means anything in contrast with FAMILY_FIRST, and a separate section would duplicate the comma-precedence paragraph that follows.

Verification

  • uv run pytest — 3066 passed, 20 skipped, 11 xfailed
  • uv run sphinx-build -b doctest docs — 223 tests, 0 failures (up from 218; +5 matches the new block's 5 statements)
  • uv run sphinx-build -b html -W --keep-going docs — build succeeded, so the internal section link resolves
  • The doctest harness was checked against a deliberately wrong expected value first, and reported the failure — the passing run is not inert

🤖 Generated with Claude Code

derek73 and others added 2 commits August 7, 2026 02:53
The example used "Nguyen Van Minh", which could not distinguish
FAMILY_FIRST from FAMILY_FIRST_GIVEN_LAST: "Van" collides with the
Dutch particle "van", so the vocabulary layer joins it forward before
the positional layer sees three tokens, and both orders return
family='Nguyen' given='Van Minh' with an empty middle. The block was
demonstrating particle-joining rather than name_order, and reported
the Vietnamese given name as "Van Minh" rather than "Minh".

It also contradicted modules.rst, which names Vietnamese as the
exemplar for FAMILY_FIRST_GIVEN_LAST rather than for FAMILY_FIRST.

Switch to a Hungarian name, which is what modules.rst claims for this
constant and which has no ambiguous-particle collision, and show the
middle field so the assignment order is visible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The constant was exported and reference-documented in modules.rst, but
nothing in the guide showed what it does to a name -- the only worked
examples lived in the test suite. Since it is keyed to no script and
has no locale pack, an explicit Policy is the only way to reach it,
which makes the guide the one place a reader could have found it.

Extend the existing name-order section rather than adding a sibling:
the constant only means anything in contrast with FAMILY_FIRST, and a
separate section would duplicate the comma-precedence paragraph.

Also record the particle collision that made the old example inert, as
prose plus a unit test rather than a second doctest block: "Nguyen Van
Minh" parses identically under both family-first orders because "Van"
is the ambiguous Dutch particle.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@derek73 derek73 self-assigned this Aug 7, 2026
@derek73
derek73 merged commit fc0c31f into master Aug 7, 2026
9 checks passed
@derek73
derek73 deleted the docs/family-first-given-last branch August 7, 2026 09:57
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.48%. Comparing base (5a16424) to head (7050f1e).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #347   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files          41       41           
  Lines        2845     2845           
=======================================
  Hits         2802     2802           
  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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant