double-metaphone
Version:
Double Metaphone algorithm
121 lines (80 loc) • 3 kB
Markdown
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[][source].
This package is ESM only: Node 12+ is needed to use it and it must be `import`ed
instead of `require`d.
[][]:
```sh
npm install double-metaphone
```
This package exports the following identifiers: `doubleMetaphone`.
There is no default export.
```js
import {doubleMetaphone} from 'double-metaphone'
doubleMetaphone('michael') // => ['MKL', 'MXL']
doubleMetaphone('crevalle') // => ['KRFL', 'KRF']
doubleMetaphone('Filipowitz') // => ['FLPTS', 'FLPFX']
doubleMetaphone('Xavier') // => ['SF', 'SFR']
doubleMetaphone('delicious') // => ['TLSS', 'TLXS']
doubleMetaphone('acceptingness') // => ['AKSPTNNS', 'AKSPTNKNS']
doubleMetaphone('allegrettos') // => ['ALKRTS', 'AKRTS']
```
With [stemmer][]:
```js
import {doubleMetaphone} from 'double-metaphone'
import {stemmer} from 'stemmer'
doubleMetaphone(stemmer('acceptingness')) // => [ 'AKSPTNK', 'AKSPTNK' ]
doubleMetaphone(stemmer('allegrettos')) // => [ 'ALKRT', 'AKRT' ]
```
```txt
Usage: double-metaphone [options] <words...>
Double Metaphone algorithm
Options:
-h, --help output usage information
-v, --version output version number
Usage:
$ double-metaphone michael
$ echo 'Xavier' | double-metaphone
$ echo 'acceptingness' | stemmer | double-metaphone
```
* [`metaphone`](https://github.com/words/metaphone)
— Fast Metaphone implementation
* [`soundex-code`](https://github.com/words/soundex-code)
— Fast Soundex implementation
* [`stemmer`](https://github.com/words/stemmer)
— Porter Stemmer algorithm
* [`dice-coefficient`](https://github.com/words/dice-coefficient)
— Sørensen–Dice coefficient
* [`levenshtein-edit-distance`](https://github.com/words/levenshtein-edit-distance)
— Levenshtein edit distance
* [`syllable`](https://github.com/words/syllable)
— Syllable count in an English word
[][license] © [Titus Wormer][author]
<!-- Definitions -->
[]: https://github.com/words/double-metaphone/workflows/main/badge.svg
[]: https://github.com/words/double-metaphone/actions
[]: https://img.shields.io/codecov/c/github/words/double-metaphone.svg
[]: https://codecov.io/github/words/double-metaphone
[]: https://img.shields.io/npm/dm/double-metaphone.svg
[]: https://www.npmjs.com/package/double-metaphone
[]: https://img.shields.io/bundlephobia/minzip/double-metaphone.svg
[]: https://bundlephobia.com/result?p=double-metaphone
[]: https://www.npmjs.com
[]: license
[]: https://wooorm.com
[]: https://en.wikipedia.org/wiki/metaphone
[]: https://github.com/words/stemmer