Skip to content

Fix compound/hyphenated names generating false positives#85

Merged
initstring merged 3 commits into
masterfrom
fix-compound-names
May 20, 2026
Merged

Fix compound/hyphenated names generating false positives#85
initstring merged 3 commits into
masterfrom
fix-compound-names

Conversation

@initstring
Copy link
Copy Markdown
Owner

Summary

  • split_name() previously split on both whitespace and hyphens, so Jean-Charles Martin was broken into [jean, charles, martin] — producing false positives like jean.charles and missing jean-charles.martin entirely
  • Now splits on whitespace only, preserving compound names as single units
  • Added _hyphen_variants() to expand hyphenated last names into both the compound form and each part, so John Davidson-Smith still generates john.davidson-smith, john.davidson, and john.smith — no valid variants lost
  • Bumped version to 0.30

Test plan

  • All 10 tests pass (uv run pytest -v)
  • TEST_NAMES[6] ("Jean-Charles Martin") added — verifies jean-charles.martin is generated
  • TEST_NAMES[7] ("Madonna Wayne Gacey") added — exercises the second field path in all six mutation methods (previously parsed but never mutation-tested)
  • test_hyphen_variants() added as a direct unit test for the new helper
  • test_split_name extended with hyphenated cases

Fixes #82

🤖 Generated with Claude Code

initstring and others added 3 commits May 21, 2026 09:05
split_name() now splits only on whitespace, so hyphenated names like
"Jean-Charles" are kept intact as a single unit rather than being broken
into separate parts. A new _hyphen_variants() helper expands hyphenated
last names into both the compound form and each individual part, ensuring
"Davidson-Smith" still generates john.davidson-smith, john.davidson, and
john.smith. Tests updated throughout and new TEST_NAMES[6] added for the
exact case from the issue report.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Add TEST_NAMES[7] ("Madonna Wayne Gacey") to exercise the 'second' field
path in all six mutation methods — previously the second field was parsed
but never assertion-tested in mutations. Add test_hyphen_variants() as a
direct unit test for the helper, covering no-hyphen, single-hyphen, and
multi-hyphen inputs.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@initstring initstring merged commit 317f35f into master May 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compound name returns false positives

1 participant