feat: Add Soundex phonetic matching for person name search#262
Open
isaacschepp wants to merge 47 commits intomainfrom
Open
feat: Add Soundex phonetic matching for person name search#262isaacschepp wants to merge 47 commits intomainfrom
isaacschepp wants to merge 47 commits intomainfrom
Conversation
Add Soundex algorithm (NARA standard) to go-glx library and integrate as --phonetic flag on glx query persons --name. Matches names that sound alike regardless of spelling (Miller/Myller/Mueller, Johannes/ Johannis/Johanns, Smith/Smyth). Library (go-glx/phonetic.go): - Soundex() — NARA algorithm, returns 4-char code - SoundexMatch() — compare two names phonetically - PhoneticPersonSearch() — search archive persons by Soundex CLI (glx query persons --name X --phonetic): - --phonetic flag enables Soundex matching on each word in person names - Added to supported flags for persons entity type 19 test cases covering standard Soundex codes, matching, person search, no-match, and empty-query edge cases. Closes #115
Deploying genealogix with
|
| Latest commit: |
a3f2290
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://375c714a.genealogix.pages.dev |
| Branch Preview URL: | https://feat-phonetic-matching.genealogix.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Soundex-based phonetic matching to the go-glx library and exposes it via a new --phonetic flag on glx query persons --name, enabling searches that match common spelling variants.
Changes:
- Added Soundex implementation + helpers and a phonetic person search helper in
go-glx. - Added unit tests covering Soundex codes, matching, and phonetic person search.
- Added
--phoneticflag wiring and phonetic filtering logic to the CLI query path.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| go-glx/phonetic.go | Implements Soundex, SoundexMatch, and PhoneticPersonSearch. |
| go-glx/phonetic_test.go | Adds test coverage for Soundex behavior and phonetic person search. |
| glx/query_runner.go | Adds Phonetic option, validation allowance, and phonetic name filtering in queryPersons. |
| glx/cli_commands.go | Adds --phonetic flag and passes it into query options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Restrict Soundex to ASCII A-Z only (prevents truncation of non-ASCII runes when stored as first byte of code) - Add nil archive guard in PhoneticPersonSearch - Validate --phonetic requires --name (error if used alone) - Split multi-word queries and match any query word against any name word (fixes "Jane Miller" never matching) - Note: CLI-level phonetic test deferred (library tests cover the logic)
…x/glx into feat/phonetic-matching
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
Add Soundex phonetic matching algorithm to the GLX library and CLI, enabling name searches that find spelling variants (Miller/Myller/Mueller, Johannes/Johannis, Smith/Smyth).
glx query persons --name "Miller" --phonetic --archive ./archiveLibrary (
go-glx/phonetic.go)Soundex()— NARA standard algorithm (letter + 3 digits)SoundexMatch()— compare two names phoneticallyPhoneticPersonSearch()— search all persons by Soundex codeCLI
--phoneticflag onglx query persons --nameTest plan
go vetclean, build succeedsCloses #115