Skip to content

Commit

Permalink
Updated the readme with usage of the threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed Nov 14, 2017
1 parent 2a89b90 commit ffab53c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ npm install --save ukkonen

## Usage

You can find the distance between the strings `Ukkonen` and `Levenshtein` the following way:

```js
var ukkonen = require('ukkonen')

assert.equal(ukkonen('Ukkonen', 'Levenshtein'), 8)
```

If you want to limit the distance by a given threshold:

```js
var ukkonen = require('ukkonen')

assert.equal(ukkonen('Ukkonen', 'Levenshtein', 6), 6)
assert.equal(ukkonen('Ukkonen', 'Levenshtein', 10), 8)
```

## Platform support

The library is ES5 and will work with any JavaScript bundler in the browser as well as Node versions with ES5 support.
Expand Down

0 comments on commit ffab53c

Please sign in to comment.