Repository navigation
Read a comma with nothing before it as a family comma naming no surname (rules/C15, #892) - #914
Merged
Merged
Conversation
…me (rules/C15, #892) A name opening with a comma had no rule: clauses in H8, O6 and M2 and review findings in five decisions files each decided it locally, and every comma change had to sweep the shape. rules/C15 states it once: the part after the comma reads as the given part after a family comma reads, with no surname supplied. H1 is the one exception -- a title and one name word read that word as the family (', Dr. John'), the comma naming no surname to decide the field by. No reading moves. test_an_empty_head_reads_as_its_family_comma_twin holds ', X' to 'Smith, X' less the surname over 3,519 given parts per order, with H1's 1,075 rows per order counted and a recorded negative control (#613's early return fails 1,098 rows). The twin's surname is written in the given part's case: a mixed-case 'Smith' brings a case contrast (S6) the empty head lacks, which is why ', MA' reads given 'MA' as 'SMITH, MA' does. nameparser/AGENTS.md's comma sweep points at the invariant for fields and kinds, keeping the empty head in report-detail grids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #892 (points 1–3; point 4, removing code written for the empty head alone, stays open in decisions/C15).
What
A name opening with a comma (
, John Smith) had no rule. Clauses in H8, O6 and M2, and review findings in decisions/C1, S10, A1 and H5, each decided it locally, andnameparser/AGENTS.mdmade every comma change sweep the shape. This PR states it once, as rules/C15 (a comma with nothing before it): the comma is a family comma naming no surname, and the part after it reads as the given part after any family comma reads.No reading moves. The parser already followed the rule; the only code edit is a citation comment in
_comma.py. The snapshot diff only adds the new rule examples.The exception: H1 (a title and one name word)
A title and one name word read that word as the family:
, Dr. John→ familyJohn, whereSmith, Dr. John→ givenJohn. The comma names no surname, so it does not decide the field, mirroring H1's existing clause for a comma with nothing but titles after it. A new Then bullet in H1 says so. H8 and O6 now cite C15.The invariant
test_an_empty_head_reads_as_its_family_comma_twin(tests/v2/test_properties.py) checks that, Xreads asSmith, Xdoes, less the surname, comparing fields and ambiguity kinds.Smithadds a case contrast (rules/S6) that the empty head doesn't have. That is why, MAreads givenMAhere, asSMITH, MAdoes, whileSmith, MAreads suffixMA. C15's Accepted bullet records this. The "MA fix" first considered for this PR turned out to be an artifact of the comparison, not a parser defect.nameparser/AGENTS.md's comma sweep now points at the invariant for fields and kinds. It keeps the empty head, with a trailing title, in grids that check report details, which the invariant doesn't compare.Review
A design-docs review found that the first draft's "the family stays empty" was false where P6 (a particle ending the name) attaches one.
, Jane vanreads familyvan, and C15 now has a P6 Precedence bullet for it. The same review found that "as it does with no comma" was false on 493 of the 1,075 H1 rows per order (, Jane Mrs,, Dr. abdul Rahman). The exception is now stated by its result instead. The corpus count was recounted: 10 of 6,005,647 local-corpus names, adding one in tw-donors that opens with a fullwidth comma.Follow-up noted, not done
, Sir Jones vdreports thatvd"joins the family the comma named", but C15 says that comma names none. This is report wording only (decisions/C15's Log).Checks
The full suite and the serial benchmarks pass, as do
ruffandmypy. On the first serial run, three wall-clock scaling ratios landed at 6.0–6.5× against a limit of 6.0. They passed on rerun, and no parser code changed.🤖 Generated with Claude Code