bitap

an approximate string matching algorithm

Usage no npm install needed!

<script type="module">
  import bitap from 'https://cdn.skypack.dev/bitap';
</script>

README

bitap

Fuzzy string search algorithm that searches for a given pattern in a text respecting an amount of errors (Levenshtein distance).

It's a JavaScript implementation of the algorithm present in the paper A Faster Algorithm for Approximate String Matching by Ricardo Baeza Yates and Gonzalo Navarro:

Usage

$ npm install bitap
(...)
$ node
> let bitap = require('bitap')
undefined
> bitap('where is my elephant', 'telephone', 3)
[ 18 ]