Commit c8ea8cf
* fix: recognize trailing suffix_not_acronyms in lastname-comma format (closes #144)
In 'Last, First Middle I' format, a trailing single-letter suffix like 'I'
was silently absorbed into the middle name because is_suffix() rejects single
uppercase letters via is_an_initial().
Add is_suffix_at_lastname_comma_end() which applies when the piece is the
final token of the post-comma segment and no explicit comma-separated suffix
follows (len(parts)==2). When parts[2] exists the caller already declared a
suffix, making the trailing token more likely a middle initial
(e.g. 'Doe, Rev. John V, Jr.'), so that case is excluded.
* test: add coverage for trailing suffix_not_acronyms in lastname-comma format
Add tests for 'V' (same ambiguity as 'I'), no-middle case, single-letter
middle-initial-before-suffix pattern, and an xfail documenting the known
limitation when an explicit comma-suffix segment is present. Also tighten
the is_suffix_at_lastname_comma_end docstring to explain the parts parameter
semantics and the three conditions that must hold.
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8d5f769 commit c8ea8cf
2 files changed
Lines changed: 64 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
507 | 528 | | |
508 | 529 | | |
509 | 530 | | |
| |||
767 | 788 | | |
768 | 789 | | |
769 | 790 | | |
770 | | - | |
| 791 | + | |
771 | 792 | | |
772 | 793 | | |
773 | 794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
169 | 211 | | |
170 | 212 | | |
171 | 213 | | |
| |||
0 commit comments