Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4f5b956
Add the glued-honorific tail vocabulary (#308)
derek73 Jul 31, 2026
2b0f007
Vet the glued tail set against real surname data (#308)
derek73 Jul 31, 2026
b9c58a2
Add Lexicon.honorific_tails, the glued-peel vocabulary (#308)
derek73 Jul 31, 2026
b72150a
Enforce the honorific-tail subset invariant (#308)
derek73 Jul 31, 2026
9075fde
Peel a glued CJK honorific off the last name token (#308)
derek73 Jul 31, 2026
17f9c39
Never treat a post-nominal as a name site (#308)
derek73 Jul 31, 2026
be97aec
Decline rather than scan past a post-nominal surname site (#308)
derek73 Jul 31, 2026
90be6ba
Pin the suffix-comma peel and name the maiden reach (#308)
derek73 Jul 31, 2026
59aac1f
Let a recognized honorific reach the segmenter, not block it (#308)
derek73 Jul 31, 2026
f71a2e4
Pin that an honorific does not excuse a real boundary (#308)
derek73 Jul 31, 2026
d56fff2
Classify the glued-honorific diffs in the differential (#308)
derek73 Jul 31, 2026
aba6c03
Document the glued honorific peel (#308)
derek73 Jul 31, 2026
1d46fc6
Say what the 君 row actually pins (#308)
derek73 Jul 31, 2026
73fb92f
Finish the #308 staleness sweep (#308)
derek73 Jul 31, 2026
fdd3527
Scope the doctrine paragraph's count to what it counts (#308)
derek73 Jul 31, 2026
227426d
Note the lone-honorific fix and the peel's off-switch (#308)
derek73 Jul 31, 2026
063fd1a
Exempt only the tail the peel manufactured (#308)
derek73 Jul 31, 2026
931ce0e
Ship 박사님, the missing third -님 honorific (#308)
derek73 Jul 31, 2026
cd626cb
Correct six claims the code makes about itself (#308)
derek73 Jul 31, 2026
a527bd6
Pin the v1 shim's honorific_tails translation (#308)
derek73 Jul 31, 2026
288fef2
Say what the peel actually does, in prose (#308)
derek73 Jul 31, 2026
acbfefc
Pin the peel's segment choice and its two boundaries (#308)
derek73 Jul 31, 2026
3e5dad6
Reach the peel from a drawn lexicon (#308)
derek73 Jul 31, 2026
b31f759
Replace the peel docstring's self-refuting no-peel-twice example (#308)
derek73 Jul 31, 2026
dde0c60
Reclassify the FAMILY-comma honorific row to comma-family (#308)
derek73 Jul 31, 2026
d6cd806
Justify the segmenter's spaced-honorific rule by its cost (#308)
derek73 Jul 31, 2026
7819a3d
Scope the spaced-honorific advice to the segmenter path (#308)
derek73 Jul 31, 2026
2189401
Pin _is_post_nominal's strict suffix test with the input it names (#308)
derek73 Jul 31, 2026
b8a9252
Give the spaced-honorific test its missing control (#308)
derek73 Jul 31, 2026
e6a6b69
Correct five accuracy nits around the peel (#308)
derek73 Jul 31, 2026
41588b4
Let _split tag the tail it just built (#308)
derek73 Jul 31, 2026
2c5edcc
Derive the peel test lexicon from the stage's own (#308)
derek73 Jul 31, 2026
6ae3351
Drop a test whose assertion cannot fail (#308)
derek73 Jul 31, 2026
3171267
Pin the 殿 exclusion, the one nothing held (#308)
derek73 Jul 31, 2026
46fdc3e
Put a non-ASCII shape in the scaling benchmark (#308)
derek73 Jul 31, 2026
53611b1
Name the escape hatch that actually works (#308)
derek73 Jul 31, 2026
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
Prev Previous commit
Next Next commit
Pin the suffix-comma peel and name the maiden reach (#308)
  • Loading branch information
derek73 committed Jul 31, 2026
commit 90be6ba5f685871bea8eadc76e205668e462c520
9 changes: 9 additions & 0 deletions nameparser/_pipeline/_script_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ def _peel_honorific_tail(state: ParseState) -> ParseState:
that returns None where the outright index would raise removes an
unpinned reliance on the FAMILY_COMMA gate landing first.

That last token is the last of the NAME PART, which under NO_COMMA
reaches into a maiden clause: maiden tokens are still main-stream
here (extract_delimited has masked only bracketed content), so
"김민준 née 박씨" peels 씨 off the MAIDEN name 박씨 and hands it to
the person's suffix list -- "née Ms. Park". Intended rather than
incidental: the honorific is the reader's regardless of which of
her names it was glued to, and a name-part-final honorific is
exactly what this peels.

Longest-first. ONE peel, never recursive: 김민준박사님 gives up
its 님 and keeps its glued 박사, though 박사 is itself a listed
tail, which is accepted rather than chased. No script precondition
Expand Down
10 changes: 10 additions & 0 deletions tests/v2/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,16 @@ def __post_init__(self) -> None:
"hide it -- this now agrees with the comma-written "
"'Dr 김민준씨, Jr.', where the suffix comma had "
"already put 씨 within reach"),
Case("ko_honorific_glued_given_suffix_comma", "Dr 김민준씨, Jr.",
{"title": "Dr", "family": "김", "given": "민준",
"suffix": "씨, Jr."},
classification="fix(#308)",
notes="the peel indexes the NAME part, not the token stream: "
"under a suffix comma segments[0] is a strict subset, "
"and the peel site is found within it. Pairs with "
"ko_honorific_glued_given_trailing_suffix, whose "
"comma-less spelling of the same name reaches the same "
"answer by the scan-back instead"),
Case("zh_honorific_glued_surname", "王先生",
{"family": "王", "suffix": "先生"},
locale="zh",
Expand Down
2 changes: 1 addition & 1 deletion tests/v2/pipeline/test_script_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def test_a_trailing_post_nominal_does_not_hide_the_peel_site() -> None:
lexicon=_LEX_TAILS)) == ["김", "민준", "씨", "jr"]


def test_the_peel_only_looks_at_the_last_name_token() -> None:
def test_the_peel_only_looks_at_the_last_non_post_nominal_token() -> None:
# a tail anywhere but the end is somebody's name, not an
# honorific: only the trailing position is an honorific site, the
# same reasoning the trailing-only suffix gate follows
Expand Down
1 change: 1 addition & 0 deletions tools/differential/corpus_cjk.jsonl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"Andersonさん"
"Anderson선생님"
"Dr 김민준, Jr."
"Dr 김민준씨, Jr."
"John 王"
"〆木 ひろ"
"〆木 太郎"
Expand Down