Skip to content

Veto a one-case letter in the strict suffix test as its capital (#727) - #729

Merged
derek73 merged 2 commits into
masterfrom
fix/issue-727-strict-comma-one-case
Oct 19, 2026
Merged

derek73 merged 2 commits into
masterfrom
fix/issue-727-strict-comma-one-case

Conversation

@derek73

@derek73 derek73 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Closes #727.

rules/T4 (#723) tags a bare lowercase letter in a one-case name an initial, but the strict suffix test (_vocab.is_suffix_strict) vetoes an initial by the word's text, not by that tag. So a lowercase v or i passed where its capital was vetoed. Two callers reached it:

input policy before after (= its capitals)
john smith, v lenient_comma_suffixes=False suffix v given v, family john smith
smith, john, i lenient_comma_suffixes=False no report comma-structure
田中さん v default family 田中, suffix さん v given 田中さん, family v (1.4.0's reading)

The third is W2's honorific peel, whose scan-back asks the same strict test. A CJK name with a Latin letter beside it is one case, the letter being its only cased word.

Change. is_suffix_strict takes the one-case fact and vetoes a bare lowercase letter whose capital is A to Z where it holds. is_wholly_suffix and name_word_count take it as letters_one_case, a keyword kept apart from is_wholly_suffix's one_case, which is the credential lean and is None by design at callers that want no lean. segment, _comma and script_segment pass the fact they already hold. segment asks for it only under the strict knob, and the honorific peel only for a single lowercase letter. The lenient default never reads it.

Cost. Frames are unchanged on the default path for the reference name and the common comma names (counted by the code review). 田中さん v falls from 291 to 229 frames, since the peel no longer runs. Under the opt-in strict knob, a three-part comma name pays for the case fact (smith, john, v 206 → 257); no guard covers that knob.

Tests. The one-case invariant's grid gains three comma shapes and 田中さん {n}, and runs its comma shapes again under the strict knob, which reaches nothing else (the docs review measured 0 differences on the comma-free shapes). 2444f84 disagreed on 72 of 4,554 pairs (54 strict comma, 18 honorific), this branch on none. The new control records that 72. Three case rows are added. No corpus name moved: the snapshot gains only 田中さん v.

Docs. T4 says a suffix test that vetoes an initial vetoes a one-case letter too (C1's strict mode, W2's scan-back). C1's strict-mode sentence and a strict example, decisions/T4's #727 entry (and its first entry's Open line closed), the knob's docstring, customize.rst, and the #723 release bullet extended.

Reviews. The code review found no defects. The design-docs review found the stale Open line and a docstring quoting C1's old wording; both are fixed in 5d552c1. A gap they found that predates this PR, john smith nee x x against JOHN SMITH NEE X X in the maiden take, is filed as #731.

🤖 Generated with Claude Code

derek73 and others added 2 commits October 18, 2026 19:35
T4 tags a bare lowercase letter in a one-case name an initial, but the
strict suffix test vetoes an initial by the word's text, so a
lowercase 'v' or 'i' passed where its capital was vetoed. Under
lenient_comma_suffixes=False 'john smith, v' read suffix 'v' where
'JOHN SMITH, V' reads given 'V', and 'smith, john, i' reported nothing
where its capitals report comma-structure. Under the default policy
the honorific peel's scan-back asks the same test, so '田中さん v'
peeled さん where '田中さん V' does not.

is_suffix_strict takes the one-case fact and vetoes such a letter;
segment, _comma and script_segment pass the fact they hold (segment
asks for it only under the strict knob). It is a keyword apart from
is_wholly_suffix's one_case, which is the credential lean and None by
design at callers that want no lean. The lenient default never reads
it.

The one-case invariant's grid gains three comma shapes and the
honorific shape, and runs its comma shapes again under the strict
knob: 2444f84 disagreed on 72 of 4,554 pairs, this tree on none;
the new control records the 72. '田中さん v' reads as 1.4.0 did. No
corpus name moved. Docs: T4 and C1 state it, decisions/T4 records it,
the knob's docstring and customize.rst, and the release bullet.

Closes #727

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

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.04%. Comparing base (2444f84) to head (5d552c1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #729   +/-   ##
=======================================
  Coverage   99.04%   99.04%           
=======================================
  Files          46       46           
  Lines        4586     4588    +2     
=======================================
+ Hits         4542     4544    +2     
  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 derek73 added this to the 2.5 milestone Oct 19, 2026
@derek73
derek73 merged commit ad486f6 into master Oct 19, 2026
12 checks passed
@derek73
derek73 deleted the fix/issue-727-strict-comma-one-case branch October 19, 2026 02:56
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.

Should john smith, v read like JOHN SMITH, V under lenient_comma_suffixes=False?

1 participant