@artur_mkrtchyannnn/metaphone
Version:
Metaphone implementation
121 lines (80 loc) • 2.82 kB
Markdown
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[][source].
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
Node 12+ is needed to use it and it must be `import`ed instead of `require`d.
[][]:
```sh
npm install metaphone
```
This package exports the following identifiers: `metaphone`.
There is no default export.
```js
import {metaphone} from 'metaphone'
metaphone('michael') // => 'MXL'
metaphone('crevalle') // => 'KRFL'
metaphone('Filipowitz') // => 'FLPWTS'
metaphone('Xavier') // => 'SFR'
metaphone('delicious') // => 'TLSS'
metaphone('acceptingness') // => 'AKSPTNKNS'
metaphone('allegrettos') // => 'ALKRTS'
```
With [stemmer][]:
```js
var metaphone = require('metaphone')
var stemmer = require('stemmer')
metaphone(stemmer('acceptingness')) // => 'AKSPTNK'
metaphone(stemmer('allegrettos')) // => 'ALKRT'
```
```txt
Usage: metaphone [options] <words...>
Metaphone implementation
Options:
-h, --help output usage information
-v, --version output version number
Usage:
$ metaphone considerations detestable
$ echo 'hiccups vileness' | metaphone
$ echo 'vileness' | stemmer | metaphone
```
* [`double-metaphone`](https://github.com/words/double-metaphone)
— Double 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/metaphone/workflows/main/badge.svg
[]: https://github.com/words/metaphone/actions
[]: https://img.shields.io/codecov/c/github/words/metaphone.svg
[]: https://codecov.io/github/words/metaphone
[]: https://img.shields.io/npm/dm/metaphone.svg
[]: https://www.npmjs.com/package/metaphone
[]: https://img.shields.io/bundlephobia/minzip/metaphone.svg
[]: https://bundlephobia.com/result?p=metaphone
[]: https://www.npmjs.com
[]: license
[]: https://wooorm.com
[]: https://en.wikipedia.org/wiki/metaphone
[]: https://github.com/words/stemmer