@jollie/soundex

1.0.8 • Public • Published

Version Licence Build Coverage Downloads

soundex

Calculate soundex key of a string by implementing the rules described on the wikipedia page Compliant, optimized and small package to get soundex key

For mapping and formula, see https://en.wikipedia.org/wiki/Soundex#American_Soundex

Install

yarn add @jellyfish-commuting/soundex

or

npm install @jellyfish-commuting/soundex

Usage

import soundex from '@jellyfish-commuting/soundex';

// Test 'Ashcraft' (it's a common error in soundex implementation)
console.log(soundex('Ashcraft')); // Output A261 (... not A226)

// Test equal phonetics
if (soundex('Robert') === soundex('Rupert')) {
  console.log('Equal soundex');
} else {
  console.log('Different soundex');
}

// Output : Equal soundex

Params

soundex(str, length = 4);
Prop Type Default Note
str string Required field Input value
length int 4 Length of soundex key

Return value

Soundex key of length chars

/@jollie/soundex/

    Package Sidebar

    Install

    npm i @jollie/soundex

    Weekly Downloads

    17

    Version

    1.0.8

    License

    MIT

    Unpacked Size

    4.97 kB

    Total Files

    5

    Last publish

    Collaborators

    • thejellyfish