Skip to content

fix: restrict DoubleMetaphone silent S to ISL and YSL - #783

Open
ryanchou1994 wants to merge 1 commit into
NaturalNode:masterfrom
ryanchou1994:fix/double-metaphone-silent-s
Open

ryanchou1994 wants to merge 1 commit into
NaturalNode:masterfrom
ryanchou1994:fix/double-metaphone-silent-s

Conversation

@ryanchou1994

Copy link
Copy Markdown

Fixes #301

Proposed Changes

DoubleMetaphone drops the S in is, giving both is and a the code ['A', 'A']. The silent-S condition currently skips S whenever it follows A/I or precedes L. Restrict that exception to the complete ISL and YSL sequences so ordinary S sounds are retained.

Add regressions for is, as, asleep, and leslie, 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

  • Added Jasmine tests
  • Updates TypeScipt index.d.ts files — not needed; no type or API changes.

Copilot AI lite review requested due to automatic review settings September 10, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

DoubleMetaphone

2 participants