Skip to content

Join an elided particle or Arabic article written after the given name to the family (#700) - #711

Merged
derek73 merged 5 commits into
masterfrom
fix/issue-700-trailing-particle-forms
Oct 18, 2026
Merged

derek73 merged 5 commits into
masterfrom
fix/issue-700-trailing-particle-forms

Conversation

@derek73

@derek73 derek73 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #700.

Library catalogs file Paul d'Ivoi as Ivoi, Paul d' and Ḥusnī az-Zaʿīm as Zaʿīm, Ḥusnī az-. That is, the particle is written apart, behind the given name, with its mark still on it. Neither written form was particle vocabulary, so 1.4.0 through 2.4.2 all read it as a middle name. Since rules.md#P6 asks only the particle tag, the parse fix is vocabulary alone.

Input Before After
Ivoi, Paul d' middle d', family Ivoi family d' Ivoi
Rashid, Harun al- middle al- family al- Rashid
Zaʿīm, Ḥusnī az- middle az- family az- Zaʿīm
Paul d' Ivoi middle d' family d' Ivoi
IVOI, PAUL D' .capitalized() Paul D' Ivoi Paul d' Ivoi
jacobus henricus van 't hoff .capitalized() van 'T Hoff van 't Hoff

Decisions (yours, from the session's options)

  • Elided set: d', l', dell', each also with U+2019, and de’ added beside de', because nothing folds the typographic apostrophe.
  • Articles: a closed list, not a shape rule. It covers al-, ul-, the article assimilated to each sun letter in both ASCII and DMG spellings, and the Egyptian el- series. All are never-given, while the bare al (Al Gore) stays ambiguous.
  • Rendering: joined with a space like every particle (d' Ivoi). Glued forms like d'Ivoi are unchanged.

What review changed

  • esh-, eth-, edh- added. The design-docs review found that the el- series lacked the ASCII digraphs the a- series had. They weren't in the first approved list; you kept them after review, since the trailing hyphen keeps them clear of any name word.
  • Case repair fixed (_render.py). capitalized() split a token at its mark and tested the stem, which gave D' Ivoi. The whole token is now asked the particle arm's question first. That arm is now one shared predicate, _lowers_as_particle, and the early return takes only its lowercase. The second review caught a first version that also moved ed- and configured hyphenated particles.
  • 't reached as a side effect. The case-repair fix also reaches the shipped Dutch 't. It now lowercases in van 't Hoff, which is R4's reading. This is a change from every release, so it has its own release bullet.
  • Doc corrections. The P6 sentence no longer claims "never a given name". The Ivoi, d' boundary example came out of P6 because the rule's statement implies otherwise. The case row still pins it.

Measured

  • Parse: against b4a004c3, 39 corpus names move (38 GND, 1 conventions). Each one has a trailing d' or article that leaves the middle name and joins the family, and no ambiguity kinds change. To recompute: uv run python tools/differential/snapshot.py --since b4a004c3. The GND and conventions agreement records gain that progress.
  • Render (not visible in the snapshot): against 00dd2759, 28 corpus names move. Each move only lowercases a token ending in ' or -. A particle × position × order grid adds 'T → 't.

Docs

  • rules.md#P6: a sentence and examples.
  • rules.md#R4: three capitalized examples.
  • decisions.md#P6: a dated entry with a Declined line and the not-decided scope.
  • Release log: two bullets.
  • AGENTS.md: a lesson on checking the render views when adding a vocabulary word that contains punctuation.

PR review round (code, tests, comments, simplifier)

  • Decline path pinned. test_a_marked_particle_lowercases_only_where_the_particle_arm_would covers the all-particle part, the declared given slot, the suffix ed- and a configured van-der. The first broad early return had passed the whole suite; I measured that it fails this test.
  • ’t added beside 't. particles.py now asserts at import that every elided entry has both apostrophe spellings.
  • Ivoi, d' relabelled fix(#700). It had been labelled parity by default, but 1.4.0 through 2.4.2 read given d'. The same move happens to any new entry standing alone after a comma (Smith, al- → family Smith al-), as Jong, de has read since 2.0. That shape is garbage input, so it has no release bullet.
  • New rows for the empty head, a particle-surname head, a glued comma, and ’t.
  • Frame cost removed. The whole-token check is gated on not text.isalpha(), because it had cost every token two frames under capitalized().
  • Prose corrections, including AGENTS.md, which had wrongly called initials() invisible to the snapshot.

The full suite, ruff, mypy, and the Sphinx doctests all pass, and the suite ran without namedivider, the way CI runs it.

🤖 Generated with Claude Code

derek73 and others added 3 commits October 17, 2026 17:34
Library catalogs file "Paul d'Ivoi" as "Ivoi, Paul d'" and
"Ḥusnī az-Zaʿīm" as "Zaʿīm, Ḥusnī az-": the particle written apart,
behind the given name, with its mark still on it. Neither form was
particle vocabulary, so both read as a middle name. P6 asks only the
particle tag, so the fix is vocabulary alone:

- d', l', dell' and their U+2019 spellings, plus de’ beside de'
- al-, ul-, the article assimilated to each sun letter (ASCII and DMG
  spellings) and the Egyptian el- forms, as a closed list

All never-given: written apart, the word is the article and nothing
else. The family renders with a space as every particle joins
("d' Ivoi"); glued forms ("d'Ivoi") are unchanged.

39 corpus names move, every one the same shape (38 GND, 1
conventions); the GND and conventions agreement records gain the
progress and are re-recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
capitalized() split "d'" and "az-" at the mark and asked the particle
test of the stem, so "IVOI, PAUL D'" repaired to "Paul D' Ivoi". The
whole token is asked first now. Measured over every corpus name in
three cases against 00dd275: 29 names move, each only lowercasing a
token ending in ' or -.

From the design-docs review: add esh-, eth-, edh- (the a- series'
ASCII digraphs had no e- twins); P6's sentence names the listed
spellings and the never-given kind instead of "never a given name";
the "Ivoi, d'" boundary leaves P6, whose statement implies given d'
(the case row keeps it); recompute recipe for the attested spellings;
R4 examples for the repair; AGENTS.md records the render-path check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Second review of de6c045: the early return sent every whole-token
particle down _cap_word's remaining clauses where the particle arm
declined, moving "smith, john, ed-" (ED- -> Ed-) and a configured
"van-der" (Van-Der -> Van-der). The arm's test is now one shared
predicate, _lowers_as_particle, and the early return takes only its
lowercase; every decline goes to the per-word walk as before.

The shipped 't is reached too: "van 't Hoff" repairs to 'van 't Hoff'
where 1.4.0 through 2.4.2 wrote 'van 'T Hoff'. R4's reading; recorded
with an R4 example, a release bullet and the decisions entry, whose
render measurement is re-taken against 00dd275 and names its corpus.

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

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.03%. Comparing base (b4a004c) to head (c7ee4f1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #711   +/-   ##
=======================================
  Coverage   99.03%   99.03%           
=======================================
  Files          46       46           
  Lines        4552     4557    +5     
=======================================
+ Hits         4508     4513    +5     
  Misses         44       44           

☔ 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.

derek73 and others added 2 commits October 17, 2026 18:11
- test_render: pin that a marked particle lowercases only where the
  particle arm would. The all-particle part, the declared given slot,
  the suffix ed- and a configured van-der keep the walk's reading.
  Measured: the first broad early return fails it, where it had passed
  the whole suite.
- particles.py: add ’t beside 't, and assert at import that every
  elided entry has its ASCII and its U+2019 spelling.
- cases.py: "Ivoi, d'" was labelled parity by default, but 1.4.0
  through 2.4.2 read given d'. Relabel it fix(#700). Add rows for the
  empty head, a particle-surname head, a glued comma, and ’t.
- Prose: AGENTS.md no longer says initials() is invisible to the
  snapshot. Corrected the d' comment, the sun-letter count (lām's
  form is al- itself) and the ASCII-only el- series. The decisions
  entry now explains why the boundary left P6. The release bullet
  carries one before/after example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
)

_cap_text's whole-token check ran for every token, costing every
capitalized() two frames per token ('john smith' forced: 48 -> 52). A
wholly alphabetic token is one word to the walk, which asks _cap_word
the same arm, so the check is gated on `not text.isalpha()`; the
simplifier's sweep over 147,070 role x tag x spelling combinations
found no output difference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 8cd815c into master Oct 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ivoi, Paul d' and Zaʿīm, Ḥusnī az-: a particle written after the given name isn't joined to the family

1 participant