Fix compound/hyphenated names generating false positives#85
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
split_name()previously split on both whitespace and hyphens, soJean-Charles Martinwas broken into[jean, charles, martin]— producing false positives likejean.charlesand missingjean-charles.martinentirely_hyphen_variants()to expand hyphenated last names into both the compound form and each part, soJohn Davidson-Smithstill generatesjohn.davidson-smith,john.davidson, andjohn.smith— no valid variants lostTest plan
uv run pytest -v)TEST_NAMES[6]("Jean-Charles Martin") added — verifiesjean-charles.martinis generatedTEST_NAMES[7]("Madonna Wayne Gacey") added — exercises thesecondfield path in all six mutation methods (previously parsed but never mutation-tested)test_hyphen_variants()added as a direct unit test for the new helpertest_split_nameextended with hyphenated casesFixes #82
🤖 Generated with Claude Code