Commit 2373240
fix: honor single-char symbol conjunctions regardless of name length (#173)
* fix: honor single-char symbol conjunctions regardless of name length (closes #151)
The `join_on_conjunction` heuristic skipped single-character conjunctions
when `total_length < 4` to avoid treating alphabetic initials like `e` or
`y` as conjunctions. This inadvertently also skipped non-alphabetic symbols
like `&`, which can never be initials.
Fix: only apply the "treat as initial" fallback when the character is
alphabetic. Non-alphabetic conjunctions (e.g. `&`) are now always joined
regardless of name length, so `"Mr. & Mrs. John Smith"` correctly parses
the title as `"Mr. & Mrs."`.
* test: add boundary tests for single-char alpha vs symbol conjunction handling
Documents the intentional asymmetry introduced in #151: non-alpha symbols
like & are always honored as conjunctions, while single-char alpha
conjunctions (e, y) still fall back to initial treatment in short names.
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b488e97 commit 2373240
2 files changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
873 | | - | |
| 873 | + | |
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
114 | 136 | | |
115 | 137 | | |
116 | 138 | | |
| |||
0 commit comments