double-metaphone
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    double-metaphone

    Build Coverage Downloads Size

    Double metaphone algorithm.

    Install

    This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

    npm:

    npm install double-metaphone

    API

    This package exports the following identifiers: doubleMetaphone. There is no default export.

    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:

    import {doubleMetaphone} from 'double-metaphone'
    import {stemmer} from 'stemmer'
    
    doubleMetaphone(stemmer('acceptingness')) // => [ 'AKSPTNK', 'AKSPTNK' ]
    doubleMetaphone(stemmer('allegrettos')) // => [ 'ALKRT', 'AKRT' ]

    CLI

    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

    Install

    npm i double-metaphone

    DownloadsWeekly Downloads

    866

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    32.2 kB

    Total Files

    6

    Last publish

    Collaborators

    • wooorm
    • zeke