Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 809 Bytes

README.md

File metadata and controls

28 lines (18 loc) · 809 Bytes

Soundex Encoder

A simple javascript module to encode strings using Soundex.

Soundex is an algorithm designed to index strings based on their English pronunciations.

See Soundex on Wikipedia for more info.

npm install soundex-encode

var Soundex = require('soundex-encode')

// Standard 3-digit
Soundex('Battlestar') // B342

// MySQL style (at least in 5.6...?)
Soundex('Battlestar', {mysql:true}) // B34236

// Un-zero-finished hashes
Soundex('Jackson', {zeroed:false}) // J25

Notes

  • Could be errors, need to test more extensively, but currently succeeding on all test examples I found on wikipedia and several other sources.
  • Plan to add a distance comparator for computing the similarity between two hashes. Maybe Levenshtein.