Skip to content

Commit 3c27dad

Browse files
derek73claude
andcommitted
Correct two comments this pass got wrong itself
Both describe the branch's own mechanism, and both were checked against origin/master afterwards rather than before. The maiden clause said 씨 "stayed in maiden 박씨 on the unscoped segments[0]". It did stay there, but not for that reason: before #312 the family-comma gate sat ABOVE the peel and the stage returned without running it at all. The comma-and-dot test comment said the 间隔号 gates the surname split and the family comma "gates it too". Both stand over the split, but the family comma returns first, so the dot's gate is never reached on this input -- which is the only reason the test is a composition and not two facts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 6c0c3bc commit 3c27dad

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

nameparser/_pipeline/_script_segment.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,9 @@ def _peel_honorific_tail(state: ParseState) -> ParseState:
349349
regardless of which of her names it was glued to, and a
350350
name-final honorific is exactly what this peels. Since #312 that
351351
reach extends to FAMILY_COMMA along with the rest of the crossing
352-
-- "김, 민준 née 박씨" now routes 씨 to suffix where on the
353-
unscoped segments[0] it stayed in maiden "박씨".
352+
-- "김, 민준 née 박씨" now routes 씨 to suffix, where before #312
353+
the stage returned at the family-comma gate above the peel and
354+
left it in maiden "박씨".
354355
355356
The other direction is a LIMIT, stated rather than fixed: a maiden
356357
clause pushes the site off the person's own name, so "김민준씨 née

tests/v2/pipeline/test_script_segment.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -622,13 +622,13 @@ def test_an_empty_first_run_still_reaches_the_second() -> None:
622622

623623

624624
def test_the_peel_crosses_a_comma_and_a_dot_at_once() -> None:
625-
# The two gates #312 made siblings, composed: the 间隔号 gates the
626-
# surname split (威廉 stays whole -- 威 is a listed surname here,
627-
# so without the dot it would divide) and the family comma gates
628-
# it too, while the peel crosses both and reaches 太郎さん on the
629-
# far side of the comma. Neither gate alone pins this: keying the
630-
# cross-comma reach on interpunct-free input passes every other
631-
# case in this file.
625+
# The two gates #312 made siblings, composed. Both stand over the
626+
# surname split here -- 威 is a listed surname in this lexicon, so
627+
# bare 威廉 would divide 威 + 廉, and either gate alone stops that
628+
# (the family comma reaches its return first) -- while the peel
629+
# crosses both and reaches 太郎さん on the far side of the comma.
630+
# Neither gate alone pins this: keying the cross-comma reach on
631+
# interpunct-free input passes every other case in this file.
632632
lex = _LEX_TAILS.add(surnames={"威"})
633633
state = segment(tokenize(ParseState(
634634
original="威廉·莎士比亚, 太郎さん", lexicon=lex, policy=_HAN)))

0 commit comments

Comments
 (0)