From ffab53cefe1f1537d0d5aae7f6e7daea855a5f4c Mon Sep 17 00:00:00 2001 From: Sune Simonsen Date: Tue, 14 Nov 2017 21:45:32 +0100 Subject: [PATCH] Updated the readme with usage of the threshold --- Readme.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Readme.md b/Readme.md index c8dc808..abadb77 100644 --- a/Readme.md +++ b/Readme.md @@ -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.