Node Asearch
Approximate pattern matching on JavaScript
Install
$ npm install asearch
Usage
const Asearch = require('asearch')
const match = Asearch('abcde')
console.log(match('abcde'))
console.log(match('AbCdE'))
console.log(match('abcd'))
console.log(match('abcd', 1))
console.log(match('ab de', 1))
console.log(match('abe', 1))
console.log(a.match('abe', 2))
Typo
const match = Asearch('cheese burger')
console.log(match('cheese burger'))
console.log(match('chess burger'))
console.log(match('chess burger', 2))
console.log(match('chess', 2))
2 byte chars
const match = Asearch('漢字文字列')
console.log(match('漢字文字列'))
console.log(match('漢字の文字列'))
console.log(match('漢字の文字列', 1))
Test
$ git clone https://github.com/shokai/node-asearch.git
$ cd node-asearch
$ npm i
$ npm test