Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

soundex-code

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

soundex-code

Fast Soundex implementation

Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
5.3K
13.45%
Maintainers
1
Weekly downloads
 
Created
Source

soundex-code Build Status Coverage Status

Fast Soundex implementation. No cruft. Real fast.

Soundex is one of the earlier phonetics algorithms, specifically designed for surnames, inspiring others such as metaphone.

Depending on your goals, additionally use a stemmer (e.g., my own porter stemmer implementation) for better results.

Installation

npm:

$ npm install soundex-code

Component:

$ component install wooorm/soundex-code

Bower:

$ bower install soundex-code

Usage

var soundexCode = require('soundex-code');

soundexCode("phonetics"); // "P532"
soundexCode("Ashcraft"); // "A261"
soundexCode("Lissajous"); // "L222"
soundexCode("Smith") === soundex-code("Schmit"); // true

soundexCode("Ashcraftersson", 6); // "A26136"
soundexCode("A", 6); // "A000"

CLI

Install:

$ npm install --global soundex-code

Use:

Usage: soundex-code [options] words...

Fast Soundex implementation

Options:

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

Usage:

# output phonetics for words
$ soundex-code soundex unicorn
# S532 U526

# output phonetics for words from stdin
$ echo "soundex unicorn banana" | soundex-code
# S532 U526 B550

Benchmark

On a MacBook Air, it runs about 516,000 op/s.

           soundexCode — this module
  410 op/s » op/s * 1,000

           natural
  182 op/s » op/s * 1,000

           soundex-encode
   45 op/s » op/s * 1,000

           soundex
   30 op/s » op/s * 1,000
  • metaphone — The orignal Metaphone algorithm;
  • double-metaphone — The Double Metaphone algorithm.

License

MIT © Titus Wormer

Keywords

natural

FAQs

Package last updated on 20 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts