Skip to content

Commit 66a4963

Browse files
committed
docs: drop stale v1 parser.py line-number citations
The prose in each comment already names the specific v1 logic being ported; the hardcoded line numbers (1285, 1313, 1333, 1368, 1390) add nothing on top of that and would silently go stale on the next edit to parser.py, with nothing to catch the drift (polish item from the #288 review).
1 parent 4cc75db commit 66a4963

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

nameparser/_pipeline/_assign.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ def _assign_main(seg_idx: int, state: ParseState,
114114
if not rest:
115115
return
116116
# v1 nickname rule (plan deviation #2): v1's p_len == 1 counted
117-
# the WHOLE segment before any title peeling (parser.py:1285) --
118-
# 'Xyz. (Bud) Smith' has two pieces, so the title peel wins and
119-
# Smith stays the given name (pinned live 2026-07-17)
117+
# the WHOLE segment before any title peeling -- 'Xyz. (Bud) Smith'
118+
# has two pieces, so the title peel wins and Smith stays the given
119+
# name (pinned live 2026-07-17)
120120
if len(pieces) == 1 and len(rest) == 1 and has_nickname:
121121
_set_roles(tokens, pieces[rest[0]], Role.FAMILY)
122122
return
@@ -173,10 +173,10 @@ def assign(state: ParseState) -> ParseState:
173173
# PARTICLE_OR_GIVEN is deliberately not emitted here: after a
174174
# comma the family is already fixed, so a leading given-position
175175
# particle is not meaningfully ambiguous.
176-
# v1: "lastname part may have suffixes in it" (parser.py:1368)
177-
# -- the first piece is always the family even if suffix-shaped;
178-
# any later strict-suffix piece goes to SUFFIX per piece
179-
# ('Smith Jr., John' -> family=Smith, suffix=Jr.)
176+
# v1: "lastname part may have suffixes in it" -- the first
177+
# piece is always the family even if suffix-shaped; any later
178+
# strict-suffix piece goes to SUFFIX per piece ('Smith Jr.,
179+
# John' -> family=Smith, suffix=Jr.)
180180
fam_pieces = state.pieces[0]
181181
fam_tags = state.piece_tags[0]
182182
for k, piece in enumerate(fam_pieces):
@@ -190,8 +190,8 @@ def assign(state: ParseState) -> ParseState:
190190
n = _peel_leading_titles(pieces, ptags, tokens)
191191
given_done = False
192192
for m in range(n, len(pieces)):
193-
# v1 walk order (parser.py:1390): the first non-title
194-
# piece is ALWAYS the given, before any suffix check --
193+
# v1 walk order: the first non-title piece is ALWAYS
194+
# the given, before any suffix check --
195195
# 'Hardman, RN - CRNA' keeps first='RN'. One deliberate
196196
# 2.0 deviation, classified fix(comma-family): when that
197197
# piece is the segment's ONLY piece and unambiguously

nameparser/_pipeline/_group.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ def group(state: ParseState) -> ParseState:
194194
all_pieces: list[tuple[tuple[int, ...], ...]] = []
195195
all_ptags: list[tuple[frozenset[str], ...]] = []
196196
# v1 parity: additional_parts_count=1 applies only to FAMILY_COMMA
197-
# parts (parser.py:1313, 1369); the SUFFIX_COMMA pre-comma segment
198-
# gets 0 (parser.py:1333).
197+
# parts; the SUFFIX_COMMA pre-comma segment gets 0.
199198
additional = 1 if state.structure is Structure.FAMILY_COMMA else 0
200199
# v1 expand_suffix_delimiter parity (#191): tail segments (wholly
201200
# consumed as suffixes by assign) drop delimiter-core tokens, the

0 commit comments

Comments
 (0)