Fast Double Metaphone algorithm
Clone or download
Latest commit a21c638 Aug 29, 2018

readme.md

double-metaphone Build Status Coverage Status

Double metaphone algorithm.

API

Install:

npm install double-metaphone

Use:

var doubleMetaphone = require('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:

var doubleMetaphone = require('double-metaphone')
var stemmer = require('stemmer')

doubleMetaphone(stemmer('acceptingness')) // => [ 'AKSPTNK', 'AKSPTNK' ]
doubleMetaphone(stemmer('allegrettos')) // => [ 'ALKRT', 'AKRT' ]

CLI

Install:

npm install -g double-metaphone

Use:

Usage: double-metaphone [options] <words...>

Double Metaphone algorithm

Options:

  -h, --help           output usage information
  -v, --version        output version number

Usage:

# output phonetics
$ double-metaphone michael
# MKL MXL

# output phonetics from stdin
$ echo 'Xavier' | double-metaphone
# SF  SFR

# with stemmer
$ echo 'acceptingness' | stemmer | double-metaphone
# AKSPTNK AKSPTNK

Related

License

MIT © Titus Wormer