Repository navigation
fix: ignore H and W between SoundEx consonants - #807
Open
xiaoyao-666-coder wants to merge 1 commit into
Open
xiaoyao-666-coder wants to merge 1 commit into
xiaoyao-666-coder wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
new SoundEx().process('Ashcraft')currently returnsA226instead ofA261. H and W incorrectly separate consonants with the same code, so the S and C are both encoded. The National Archives Soundex rules explicitly use Ashcraft to illustrate this case.Remove H and W from the input after its first character before collapsing repeated codes. This also handles duplicate initial consonant sounds across H/W. Vowels still separate consonants, and an initial H or W is preserved.
Add 10 Jasmine specs covering Ashcraft/Ashcroft, all six consonant groups, repeated H/W, vowels, initial H/W, comparisons, and extended codes. The new suite had 8 failures against the unmodified source and passes after the fix.
Validation on Node 24.22.1:
npm run build:testsnpm test: 908 specs, 0 failuresnpm run lintsoundex.jsnpm run build:esmandnpm run smoke:esmgit diff --checkThe database-backed I/O suite was not run. Companion documentation is submitted separately against
gh-pagesin #808, as requested by CONTRIBUTING.md.Prepared with Codex assistance.