sem1083.fuzzy
v0.0.8
Published
The (not) best and most simple fuzzy find for js.
Downloads
8
Readme
Sem1083.fuzzy
Sem1083.fuzzy
is a node.js package used for approximate string matching.
Installation
Use the package manager npm to install this package.
npm install sem1083.fuzzy
Usage
compare
-> Compare two strings. This will return a score between 0 and 1.
let x = require(`sem1083.fuzzy`);
x.compare('fuzy','fuzzy')
//=> 0.8571428571428571
filter
-> Compare a string with an array of strings. Will return a sorted array with the first entry being the best and the last the worst.
let x = require(`sem1083.fuzzy`);
x.filter('fuzy',['fuzzy','fuzy'])
//=> [ [Object], [Object], get: [Function] ]
//=> First object: { string: 'fuzy', score: 1 }
x.filter('fuzy',['fuzzy','fuzy']).get(0,1) //.get is slice but fancy
//=> [ [Object], get: [Function] ]