Repository navigation
fix: restrict DoubleMetaphone silent S to ISL and YSL - #783
Open
ryanchou1994 wants to merge 1 commit into
Open
ryanchou1994 wants to merge 1 commit into
ryanchou1994 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.
Fixes #301
Proposed Changes
DoubleMetaphone drops the S in
is, giving bothisandathe code['A', 'A']. The silent-S condition currently skips S whenever it follows A/I or precedes L. Restrict that exception to the completeISLandYSLsequences so ordinary S sounds are retained.Add regressions for
is,as,asleep, andleslie, with controls for silent S, initial SL, French final S, comparison, and code truncation. Other letter rules and the public API are unchanged.Validation on macOS and Linux: the new tests produce 6 failures against the original code, then all 107 DoubleMetaphone specs and 867 unit specs pass with the fix. TypeScript and ESM builds, lint, Standard JS, jscpd, and CJS/ESM smoke checks pass. Database-backed IO tests were not run; this change only affects phonetic encoding.
Checklist before merging
index.d.tsfiles — not needed; no type or API changes.