Commit 8cb62a9
* fix: correct suffix boundary lookup for prefixed last names (#100)
The prefix-joining loop located the suffix stop boundary with a
value-based pieces.index() that searched from position 0. When a token
value repeated (a trailing title that is also a suffix acronym, e.g.
the second 'dr' in 'dr Vincent van Gogh dr'), it matched the leading
occurrence, producing an empty slice that duplicated pieces and
corrupted the middle name. Constrain the lookup to start at i + 1,
consistent with the sibling next_prefix lookup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test: guard against #108 exponential blow-up on repeated prefixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* review: improve comment accuracy and test coverage
- Fix inline comment in join_on_conjunctions: clarify that filter()
finds the value in pieces[i+1:] but index() searches from 0 by
default, and drop the misleading "title" framing (the token only
needs to satisfy is_suffix, not is_title)
- Add test for two-word prefix collision ("van der") — different loop
iteration count than the single-word case
- Add test with a genuine middle name alongside the repeated token,
since the pre-fix bug corrupted the middle field specifically
- Add @pytest.mark.timeout(2) to the #108 guard so the timeout is
enforced locally and in CI, not just by CI job limits
- Assert hn.last contains "Berg" in the #108 guard to catch silent
last-name corruption
- Add pytest-timeout dev dependency
- Resolve pre-existing stash conflict in docs/resources.rst (keep upstream)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f14fb58 commit 8cb62a9
4 files changed
Lines changed: 120 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
983 | | - | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
984 | 989 | | |
985 | 990 | | |
986 | 991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
46 | 92 | | |
47 | 93 | | |
48 | 94 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments