listenshtein

Filter a list based on Levenshtein distances

listenshtein

Filter a list based on Levenshtein distances


Example

var fs = require('fs')
  , listenshtein = require('listenshtein');
  
fs.readFile(somefile, function(errdata) {
  var words = data.split(' ');
  
  console.log(
    listenshtein('tako', words, 1);
  ); // => 'taco' 
});

listenshtein(word, words, [max dist])

  • max dist the maximum levenshtein distance to allow (defaults to word.length - 1)

install

With npm do:

npm install listenshtein