Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions nameparser/_pipeline/_pieces.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,9 @@ def segment_suffix_reading(pieces: Sequence[Sequence[int]],
two name words -- and each reads as a suffix whatever its writing
or company.

rules/S2's initial veto keeps a roman numeral out of a suffix
reading, which is right after a NAME word: 'Smith, John V.' is a
The initial veto (`_vocab.is_initial`) keeps a roman numeral out
of a suffix reading, which is right after a NAME word (rules/C1's
one-character suffix word, read by what stands before it): 'Smith, John V.' is a
middle initial (#432). After a SUFFIX word the numeral is
describing that suffix -- 'PSM I' is Professional Scrum Master
level I -- so the run continues through it, period included, an
Expand Down
7 changes: 4 additions & 3 deletions tests/v2/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,8 @@ def _check_cjk_shape_purity(self) -> None:
classification="fix(#289)",
ambiguities=("suffix-or-name",),
notes="the two-word twin of 'Royce, Ed' below, and the case "
"row item 5 of decisions/S4 turns on -- no corpus "
"row decisions/S4's 2026-09-15 entry (THE COUNT "
"REACHES THE LISTED SET TOO) turns on -- no corpus "
"name has this shape, so this row carries the whole "
"weight of that decision",
shape=3),
Expand Down Expand Up @@ -4265,8 +4266,8 @@ def _check_cjk_shape_purity(self) -> None:
notes="why the condition asks assign's TRAILING-RUN walk "
"rather than the suffix-piece test: a bare 'V' is "
"suffix vocabulary written like an initial, so "
"is_suffix_piece refuses it (rules/S2's initial "
"veto) and a class test spelled with that predicate "
"is_suffix_piece refuses it (the initial veto, "
"_vocab.is_initial) and a class test spelled with that predicate "
"alone would let the link swallow it. The peel takes "
"it, so trailing_start puts it outside the name's own "
"words and the link stays the generation -- carrying "
Expand Down
4 changes: 2 additions & 2 deletions tests/v2/pipeline/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,8 +1438,8 @@ def test_the_right_hand_test_reads_the_peel_not_the_suffix_piece(
) -> None:
# the arm that forces trailing_start rather than is_suffix_piece:
# a ONE-CHARACTER suffix word is initial-shaped, so the
# suffix-piece test refuses it (rules/S2's initial veto) while
# assign's trailing peel takes it. Spelled with the piece test
# suffix-piece test refuses it (the initial veto,
# `_vocab.is_initial`) while assign's trailing peel takes it. Spelled with the piece test
# alone, the link would swallow the generation here.
lex = _LINK_LEX.add(suffix_words={"v"})
out = _grouped("Josep Lluis Carod i V", lexicon=lex)
Expand Down
3 changes: 2 additions & 1 deletion tests/v2/test_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,8 @@ def test_unlisted_caps_suffixes_on_reads_an_all_caps_word() -> None:
assert default.parse("John Smith XYZ").ambiguities == ()
# the boundaries: one case, one letter, a digit, and vocabulary.
# 'John Smith X' is NOT the single-letter control -- 'X' is a bare
# roman numeral (rules/S2's numeral fork) and reads as suffix
# roman numeral (the trailing numeral fork,
# `_vocab.is_trailing_numeral_suffix`) and reads as suffix
# 'X' with the switch either way, unrelated to this one; 'Z' is
# not vocabulary at all and stays unaffected by the switch, which
# is the actual boundary (a single capital never satisfies the
Expand Down
Loading