{"_id":"ukkonen","_rev":"10-2e0b6f2537a1ff18deb93eb24cbe8ba0","name":"ukkonen","dist-tags":{"latest":"2.2.0"},"versions":{"1.0.0":{"name":"ukkonen","version":"1.0.0","keywords":["Ukkonen","Hal","Berghel","Aproximate","string","match","ASM","EHD","Levenshtein"],"author":{"name":"Sune Simonsen"},"license":"MIT","_id":"ukkonen@1.0.0","maintainers":[{"name":"sunesimonsen","email":"sune@we-knowhow.dk"}],"dist":{"shasum":"1fd47efc291dadacaffe6286e4d8c396012d5518","tarball":"https://registry.npmjs.org/ukkonen/-/ukkonen-1.0.0.tgz","integrity":"sha512-NGOfKr3n8SGiQWHZq2FwSvgsiaG9/HtufoxVyrO5GMWSw3rwCE5nZaBBhegiiaFCAp+fRzkIgTwKP1wEFiGKiA==","signatures":[{"sig":"MEQCIBPV94lO6Wc0lfvte0Vm1DWIlAzura8uU9Y1WLpQdaswAiBr4NXFT7zbOhpdlDQUR+2m57Y4OBLs1gCdpEKu5eGmVg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"03b3a1ec454db2832aed0adaeea915400c1efb53","scripts":{"test":"mocha","bench":"matcha bench.js"},"_npmUser":{"name":"sunesimonsen","email":"sune@we-knowhow.dk"},"_npmVersion":"5.5.1","description":"Ukkonens approximate string matching algorithm for finding edit distance similar to Levenshtein","directories":{},"_nodeVersion":"6.9.1","devDependencies":{"leven":"2.1.0","mocha":"4.0.1","matcha":"0.7.0","unexpected":"10.36.0","unexpected-check":"1.12.0","chance-generators":"2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ukkonen-1.0.0.tgz_1510691787824_0.7999173642601818","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"ukkonen","version":"1.2.0","keywords":["Ukkonen","Hal","Berghel","Aproximate","string","match","ASM","EHD","Levenshtein"],"author":{"name":"Sune Simonsen"},"license":"MIT","_id":"ukkonen@1.2.0","maintainers":[{"name":"sunesimonsen","email":"sune@we-knowhow.dk"}],"dist":{"shasum":"c8aef766389ad201f8916fb9c6df384fbf24d905","tarball":"https://registry.npmjs.org/ukkonen/-/ukkonen-1.2.0.tgz","integrity":"sha512-4GDTkNXpDWM/czwbDVmEeRILiWEsIAOxbq2YEptjCDFSFi5mboSEZZ87/FTuwjuW4tik4PzRL+NiRpjtfuAzKA==","signatures":[{"sig":"MEUCIQDsm6TIHP5WkWnm2XDZYU2bfxJS3euzckiGMYTdOVvO8wIgIJ28y/VoHnXEhrhsU5WWvmvBydt7mj85YODVsq2SOtk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"82ad695f9308fb010cbdaf44544c28756d2622cc","scripts":{"test":"mocha","bench":"matcha bench.js","travis":"UNEXPECTED_CHECK_MAX_ITERATIONS=10000 mocha"},"_npmUser":{"name":"sunesimonsen","email":"sune@we-knowhow.dk"},"_npmVersion":"5.5.1","description":"Ukkonens approximate string matching algorithm for finding edit distance similar to Levenshtein","directories":{},"_nodeVersion":"6.9.1","devDependencies":{"leven":"2.1.0","mocha":"3.5.3","matcha":"0.7.0","unexpected":"10.36.0","unexpected-check":"1.12.0","chance-generators":"2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ukkonen-1.2.0.tgz_1510736513347_0.40095043228939176","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"ukkonen","version":"1.3.0","keywords":["Ukkonen","Hal","Berghel","Aproximate","string","match","ASM","EHD","Levenshtein"],"author":{"name":"Sune Simonsen","email":"sune@we-knowhow.dk"},"license":"MIT","_id":"ukkonen@1.3.0","maintainers":[{"name":"sunesimonsen","email":"sune@we-knowhow.dk"}],"homepage":"https://github.com/sunesimonsen/ukkonen#readme","bugs":{"url":"https://github.com/sunesimonsen/ukkonen/issues"},"dist":{"shasum":"814e7992292905093be68772a52f25d34155b672","tarball":"https://registry.npmjs.org/ukkonen/-/ukkonen-1.3.0.tgz","integrity":"sha512-B8hjEsrJONDEF9m1LTUpksrZyYI6jx1sGjgvkMGUdX9RyrXXPhYgcA18FcXbg5/2eWw35M0Crpa616J+EVCiRQ==","signatures":[{"sig":"MEYCIQCWhs8qgadUJ1a7TOizH7/upNqiGAFt0KmrFggnM8vKXgIhAMWp+OMiAs33W5eaCBc8QF6MJJwskWcbjqtCnNMTiyjo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"45bb3df6e4043c4d46ce4f27de24f1e083e21224","scripts":{"test":"mocha","bench":"matcha bench.js","travis":"UNEXPECTED_CHECK_MAX_ITERATIONS=10000 mocha"},"_npmUser":{"name":"sunesimonsen","email":"sune@we-knowhow.dk"},"repository":{"url":"git+https://github.com/sunesimonsen/ukkonen.git","type":"git"},"_npmVersion":"5.3.0","description":"Ukkonens approximate string matching algorithm for finding edit distance similar to Levenshtein","directories":{},"_nodeVersion":"8.4.0","devDependencies":{"leven":"2.1.0","mocha":"3.5.3","matcha":"0.7.0","unexpected":"10.36.0","unexpected-check":"1.12.0","chance-generators":"2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ukkonen-1.3.0.tgz_1510772547058_0.9785173651762307","host":"s3://npm-registry-packages"}},"1.4.0":{"name":"ukkonen","version":"1.4.0","keywords":["Ukkonen","Hal","Berghel","Aproximate","string","match","ASM","EHD","Levenshtein"],"author":{"name":"Sune Simonsen","email":"sune@we-knowhow.dk"},"license":"MIT","_id":"ukkonen@1.4.0","maintainers":[{"name":"sunesimonsen","email":"sune@we-knowhow.dk"}],"homepage":"https://github.com/sunesimonsen/ukkonen#readme","bugs":{"url":"https://github.com/sunesimonsen/ukkonen/issues"},"dist":{"shasum":"594629234ceccbf7e44187ad9fedbeb4866a2e5f","tarball":"https://registry.npmjs.org/ukkonen/-/ukkonen-1.4.0.tgz","integrity":"sha512-g8SLGxflI0/VNH2C8j66KcfJXrU5StJglRQBYPNiChXFlOrqqYM1icOykOAAUgTeBpktaEuCm9hjpPinQ080PA==","signatures":[{"sig":"MEYCIQD4ALbmCUryAmv0f283MW/ODhGHU4Ci0QZRCI+JC9UnsgIhAOgtapibEFSkvFIuDIxgA47JrNfkIb+eN3LVTNtv2xe+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"1a46b9fc74cacf9bac32d0a454b2c69b30811549","scripts":{"test":"mocha","bench":"matcha bench.js","travis":"UNEXPECTED_CHECK_MAX_ITERATIONS=10000 mocha"},"_npmUser":{"name":"sunesimonsen","email":"sune@we-knowhow.dk"},"repository":{"url":"git+https://github.com/sunesimonsen/ukkonen.git","type":"git"},"_npmVersion":"5.5.1","description":"Ukkonens approximate string matching algorithm for finding edit distance similar to Levenshtein","directories":{},"_nodeVersion":"6.9.1","devDependencies":{"leven":"2.1.0","mocha":"3.5.3","matcha":"0.7.0","unexpected":"10.36.0","unexpected-check":"1.12.0","chance-generators":"2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ukkonen-1.4.0.tgz_1511035686087_0.7230751574970782","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"ukkonen","version":"2.0.0","keywords":["Ukkonen","Hal","Berghel","Aproximate","string","match","ASM","EHD","Levenshtein"],"author":{"name":"Sune Simonsen","email":"sune@we-knowhow.dk"},"license":"MIT","_id":"ukkonen@2.0.0","maintainers":[{"name":"sunesimonsen","email":"sune@we-knowhow.dk"}],"homepage":"https://github.com/sunesimonsen/ukkonen#readme","bugs":{"url":"https://github.com/sunesimonsen/ukkonen/issues"},"dist":{"shasum":"ebe3456188126979f923ee4887f3cb0bc511e696","tarball":"https://registry.npmjs.org/ukkonen/-/ukkonen-2.0.0.tgz","fileCount":17,"integrity":"sha512-ZZFh4XjPh4yzEHRZbsx1es2H3buoW6MBnzCe/EdWXVRCPfnz6fX619M90e04oGWKLA53z5+2SifY7UkK8QWREQ==","signatures":[{"sig":"MEUCIQDzD6PF9ynfyR/9Gm4lIu7XN0fAN/sA4wqOCmhOsbWR0gIgdgG+21f427CncS4pxFiW+H1BNSGyDyJuJpcxAaHYZFA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1846896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoDvmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4bw/+Pvh/x+QWIQcj5InVgxsdc4RpZNGg2c2JoH3fsC3KoamMbNOF\r\njiR3soUOzSF+ASJSalw/0wX52tx6IZeniEtv4mJ46PdECZc9i1GABthyczWY\r\nTqUWh5xrrzwqpv1DJx3UKfY03QelX0DwAv5x/7/kVqkACNrmDxNR1+zdFboq\r\nklAP5/J1ua625u00paRBjREYOnGFsnInNMLyVw0pcWUAtHrXOcjlsu0i9LQ5\r\nCDZCSJgcJuvF7zbz385daDu/SOWws/jBaUtnLvy+q7SgRio1aZ9qbpXOvlMU\r\nuP7s89E3fUsQt44OWNbzArFI+F3B2Qg7khG8dOAt4eghMEUKF8SV5522O9AV\r\nZwbkjbvIhrTo+A5ypn+sCx0CeK5PpkgjsNmHwiyBVDcnBdFRLyVue2PBJ2x9\r\nM443pgXZNr+bnITBNkr2l/AcPYK4Ka/2CneKSlSdBxv/mnZyMwg+pILCbGci\r\nMdoSGWFh0zCMYaCX5DyIWKMi76+yfcJCOylUkaEqCUDNqMAMTbPEDXSMrLNL\r\nn0LoA1bYSiKRFMAbSCfY1ZFMYOr3xqcg0lSGrEyuNBuaJsjT5E+aO3y+7O/6\r\nbklzrmSN73zzfCAyGkdbUpEs9glVpDxgYGB73IzowVppM7HFnf12UV/MB7Tg\r\n0ZFr/FZmcF7+YJmU9zppM4DI5BqNNtVtJbU=\r\n=7lKg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","engines":{"node":">=12"},"gitHead":"71f5b85b6c3461fa37f1798390f312e4ed0fa8e4","scripts":{"ci":"UNEXPECTED_CHECK_MAX_ITERATIONS=10000 mocha","lint":"eslint . && prettier --check '**/*.{js,md,json}'","test":"mocha","bench":"node bench.js","format":"prettier --write **/*.{md,js,json}","version":"offline-github-changelog --next=${npm_package_version} > CHANGELOG.md && git add CHANGELOG.md","preversion":"npm run lint && npm run test"},"_npmUser":{"name":"sunesimonsen","email":"sune@we-knowhow.dk"},"repository":{"url":"git+https://github.com/sunesimonsen/ukkonen.git","type":"git"},"_npmVersion":"6.14.8","description":"Ukkonens approximate string matching algorithm for finding edit distance similar to Levenshtein","directories":{},"_nodeVersion":"12.20.0","_hasShrinkwrap":false,"devDependencies":{"leven":"3.1.0","mocha":"3.5.3","eslint":"^7.32.0","prettier":"^2.3.2","nanobench":"3.0.0","unexpected":"10.36.0","unexpected-check":"1.12.0","chance-generators":"2.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-mocha":"^10.0.3","eslint-config-prettier":"^8.3.0","eslint-config-standard":"^16.0.3","offline-github-changelog":"^2.2.0"},"_npmOperationalInternal":{"tmp":"tmp/ukkonen_2.0.0_1671445478132_0.6924140583201561","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"ukkonen","version":"2.1.0","keywords":["Ukkonen","Hal","Berghel","Aproximate","string","match","ASM","EHD","Levenshtein"],"author":{"name":"Sune Simonsen","email":"sune@we-knowhow.dk"},"license":"MIT","_id":"ukkonen@2.1.0","maintainers":[{"name":"sunesimonsen","email":"sune@we-knowhow.dk"}],"homepage":"https://github.com/sunesimonsen/ukkonen#readme","bugs":{"url":"https://github.com/sunesimonsen/ukkonen/issues"},"dist":{"shasum":"7af741397e603462290aa5d4e65e514f400b29f7","tarball":"https://registry.npmjs.org/ukkonen/-/ukkonen-2.1.0.tgz","fileCount":17,"integrity":"sha512-unACtiJBMpL5Q+JKEBYtB88DVClP4Ch42NFkuj7Ck7jcJ4UKkkfvvfGQ2WeaMeuq7OIGLkbm0X7YN+TGP9C5bw==","signatures":[{"sig":"MEUCIQDNMod5760P81vupj+NxBLQCF2HbyfdDpuL6eQfIK0q8AIgKiHGr2cIzKPt2QjHrasYzZQxLe3QDwNQ56FpMOiSFso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1847681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoEBYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNaBAAiEIPX9AtWjhyiCXiESkKVvysrydVdzB4UyJYAqAKzEYu4hfB\r\nCo/nD+Y8qldIXdItttsdbhbMI+pgKToy2OpdTlleZBrZVK8NPstKZihpd/gx\r\nmluPCUUn3UZTbcWYZ0ohW+9r5PGc+yhJdV4GBYbmvEN1NtnTFLX2TWLOCxTT\r\nGhiKrsYZC0Ig04MLlgb0YhDLNLSDKYosmvWqyebdJdolYO54qdvy3+SQwa9Y\r\nBhvq8ecNhFvtsmilND+mRqxnLl/8Xz9K8jIF1qn7OCerlL2b61KrRA8X4e+x\r\nX24AvzlB5zw6A1v6qA+Yd+2ZPoEGdwAB34LWmZ0g5e8KTv1x1NH1kIvNrFWe\r\nVul1nvI+WVDcJuaaUU4JXIZB6viSb7HL7b8/gAEMyLEijSddOljwtPkCgTLd\r\niSHusMDKgTCjEvGSFVm9RDc6VeextHCUeF1MPK6gOXPKjxg/hBUqm5TgMZar\r\nhXPM2DUISBBBvobUnuj7GIztrihYPUAM5smXO1LILyls46V62e++o5olIH/p\r\n6TmWcg7+Oaw8N2sG+dqRYRn8uIGNdSUlRaBbrSZpIaEALlP3ysa4NZPaQOEC\r\nFiHGU9ixj9IKFnaGf9fvvpErntfGqYTn0ob2RhamBKVFnykjw+gojK2cR0OL\r\nrLQj6zYGsfCxYQv0TsajiRQhNgJDqNQCI4I=\r\n=Tmcg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","engines":{"node":">=12"},"gitHead":"0cf6a070d7499e9ec760a0b4e3adde282d655382","scripts":{"ci":"UNEXPECTED_CHECK_MAX_ITERATIONS=10000 mocha","lint":"eslint . && prettier --check '**/*.{js,md,json}'","test":"mocha","bench":"node bench.js","format":"prettier --write **/*.{md,js,json}","version":"offline-github-changelog --next=${npm_package_version} > CHANGELOG.md && git add CHANGELOG.md","preversion":"npm run lint && npm run test"},"_npmUser":{"name":"sunesimonsen","email":"sune@we-knowhow.dk"},"repository":{"url":"git+https://github.com/sunesimonsen/ukkonen.git","type":"git"},"_npmVersion":"8.19.1","description":"Ukkonens approximate string matching algorithm for finding edit distance similar to Levenshtein","directories":{},"_nodeVersion":"18.9.1","_hasShrinkwrap":false,"devDependencies":{"leven":"3.1.0","mocha":"10.2.0","eslint":"8.30.0","prettier":"2.8.1","nanobench":"3.0.0","unexpected":"13.0.1","unexpected-check":"3.1.0","chance-generators":"3.5.2","eslint-plugin-node":"11.1.0","eslint-plugin-mocha":"10.1.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","offline-github-changelog":"3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ukkonen_2.1.0_1671446616459_0.5189594165500198","host":"s3://npm-registry-packages"}},"2.2.0":{"name":"ukkonen","version":"2.2.0","description":"Ukkonens approximate string matching algorithm for finding edit distance similar to Levenshtein","bugs":{"url":"https://github.com/sunesimonsen/ukkonen/issues"},"repository":{"type":"git","url":"git+https://github.com/sunesimonsen/ukkonen.git"},"main":"index.js","types":"./types/index.d.ts","scripts":{"test":"mocha","lint":"eslint . && prettier --check '**/*.{js,md,json}'","format":"prettier --write **/*.{md,js,json}","ci":"UNEXPECTED_CHECK_MAX_ITERATIONS=10000 mocha","preversion":"npm run lint && npm run test","version":"offline-github-changelog --next=${npm_package_version} > CHANGELOG.md && git add CHANGELOG.md","bench":"node bench.js"},"keywords":["Ukkonen","Hal","Berghel","Aproximate","string","match","ASM","EHD","Levenshtein"],"author":{"name":"Sune Simonsen","email":"sune@we-knowhow.dk"},"license":"MIT","devDependencies":{"leven":"3.1.0","chance-generators":"3.5.3","eslint":"8.57.1","eslint-config-prettier":"9.1.0","eslint-config-standard":"17.1.0","eslint-plugin-mocha":"10.5.0","eslint-plugin-node":"11.1.0","mocha":"10.8.2","nanobench":"3.0.0","offline-github-changelog":"3.1.0","prettier":"3.4.1","unexpected":"13.2.1","unexpected-check":"3.2.0"},"engines":{"node":">=12"},"_id":"ukkonen@2.2.0","gitHead":"3c54706a5517e155c8a2476b06ab5dc933548110","homepage":"https://github.com/sunesimonsen/ukkonen#readme","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-tUad5tv8CxhXfA0xsogqXqiaZ1ldQdNni3iNOWOTXrf2/hnYa532Fg0fk6h+IyIEOPF324aLyovVAR/H/wR8rA==","shasum":"5c8d6eaa54b3a9e6e90f53b56d26368feea5948e","tarball":"https://registry.npmjs.org/ukkonen/-/ukkonen-2.2.0.tgz","fileCount":16,"unpackedSize":1851419,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCTOgxze3h4KHq0ESD2psqh+KjKhK46eTxXGgt8kgFQHAIhAJ4lPV8Rrng3Xsf6c/cQ3fRliR1k2tTHgDUgp9WAG150"}]},"_npmUser":{"name":"sunesimonsen","email":"sune@we-knowhow.dk"},"directories":{},"maintainers":[{"name":"sunesimonsen","email":"sune@we-knowhow.dk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ukkonen_2.2.0_1745922149825_0.7497800574464533"},"_hasShrinkwrap":false}},"time":{"created":"2017-11-14T20:36:28.878Z","modified":"2025-04-29T10:22:30.289Z","1.0.0":"2017-11-14T20:36:28.878Z","1.2.0":"2017-11-15T09:01:54.263Z","1.3.0":"2017-11-15T19:02:28.040Z","1.4.0":"2017-11-18T20:08:06.322Z","2.0.0":"2022-12-19T10:24:38.417Z","2.1.0":"2022-12-19T10:43:36.696Z","2.2.0":"2025-04-29T10:22:30.095Z"},"bugs":{"url":"https://github.com/sunesimonsen/ukkonen/issues"},"author":{"name":"Sune Simonsen","email":"sune@we-knowhow.dk"},"license":"MIT","homepage":"https://github.com/sunesimonsen/ukkonen#readme","keywords":["Ukkonen","Hal","Berghel","Aproximate","string","match","ASM","EHD","Levenshtein"],"repository":{"type":"git","url":"git+https://github.com/sunesimonsen/ukkonen.git"},"description":"Ukkonens approximate string matching algorithm for finding edit distance similar to Levenshtein","maintainers":[{"name":"sunesimonsen","email":"sune@we-knowhow.dk"}],"readme":"# Ukkonen - Approximate String Matching\n\n[![npm version](https://badge.fury.io/js/ukkonen.svg)](https://badge.fury.io/js/ukkonen)\n[![Checks](https://github.com/sunesimonsen/ukkonen/actions/workflows/ci.yml/badge.svg)](https://github.com/sunesimonsen/ukkonen/actions/workflows/ci.yml)\n\nThis project implements the [Approximate String Matching algorithm by Esko Ukkonen](https://www.sciencedirect.com/science/article/pii/S0019995885800462) extended with ideas from [An Extension of Ukkonen's Enhanced Dynamic Programming ASM Algorith by Hal Berghel and David Roach](http://berghel.net/publications/asm/asm.pdf).\n\nUkkonen's algorithm is very competitive with the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) and for longer strings it is much more performant than Levenshtein distance.\n\nIn addition to being a competitive alternative to Levenshtein distance, Ukkonen's algorithm also allows you to provide a threshold for the distance which increases the performance even more for texts that are longer than the threshold.\n\n<img src=\"./images/leven-for-tree-matching.gif\" alt=\"HTML diffing using Levenshtein\" height=\"200\"> <img src=\"./images/ukkonen-for-tree-matching.gif\" alt=\"HTML diffing using Ukkonen's algorithm\" height=\"200\">\n\nAbove you can see the different of using Levenshtein distance and Ukkonen's algorithm for matching sub-trees when diffing HTML.\n\n## Install\n\n```sh\nnpm install --save ukkonen\n```\n\n## Usage\n\nYou can find the distance between the strings `Ukkonen` and `Levenshtein` the following way:\n\n```js\nvar ukkonen = require(\"ukkonen\");\n\nassert.equal(ukkonen(\"Ukkonen\", \"Levenshtein\"), 8);\n```\n\nIf you want to limit the distance by a given threshold:\n\n```js\nvar ukkonen = require(\"ukkonen\");\n\nassert.equal(ukkonen(\"Ukkonen\", \"Levenshtein\", 6), 6);\nassert.equal(ukkonen(\"Ukkonen\", \"Levenshtein\", 10), 8);\n```\n\n## Platform support\n\nThe library is ES6 and will work with any JavaScript bundler in the browser as well as Node versions with ES6 support.\n\n## Benchmark\n\nI have benchmarked the library against [the fastest Levenshtein distance implementation on NPM](https://github.com/sindresorhus/leven).\n\n```\nRunning benchmarks with 1000 iterations\n\n# ukkonen: Edit distance one word (14 examples)\nok ~18 ms (0 s + 17993165 ns)\n\n# leven: Edit distance one word (14 examples)\nok ~13 ms (0 s + 13155407 ns)\n\n# ukkonen: Edit distance on sentence with small differences\nok ~1.66 ms (0 s + 1656841 ns)\n\n# leven: Edit distance on sentence with small differences\nok ~7.23 ms (0 s + 7233814 ns)\n\n# ukkonen: Edit distance on paragraphs with small differences\nok ~5.37 ms (0 s + 5367561 ns)\n\n# leven: Edit distance on paragraphs with small differences\nok ~416 ms (0 s + 416468504 ns)\n\n# ukkonen: Edit distance on longer texts with small differences\nok ~10 ms (0 s + 10305586 ns)\n\n# leven: Edit distance on longer texts with small differences\nok ~1.7 s (1 s + 703731130 ns)\n\n# ukkonen: Edit distance on longer texts with many differences\nok ~3.28 s (3 s + 280166305 ns)\n\n# leven: Edit distance on longer texts with many differences\nok ~2.52 s (2 s + 519432479 ns)\n\n# ukkonen: Edit distance on longer texts with small differences and a threshold of 20\nok ~9.69 ms (0 s + 9691021 ns)\n\n# leven: Edit distance on longer texts with small differences and a threshold of 20\nok ~1.61 s (1 s + 610079082 ns)\n\n# ukkonen: Edit distance on longer texts with many differences and a threshold of 40\nok ~15 ms (0 s + 15225792 ns)\n\n# leven: Edit distance on longer texts with many differences and a threshold of 40\nok ~2.54 s (2 s + 539519721 ns)\n```\n\n## Acknowledgements\n\nObviously the authors of the papers describing the algorithm Esko Ukkonen, Hal Berghel and David Roach.\n\nI stole a lot of ideas from [Sindre Sorhus](https://github.com/sindresorhus)'s [leven](https://github.com/sindresorhus/leven) library and I also used it to test my implementation against.\n\n## License\n\n[MIT © Sune Simonsen](./LICENSE)\n","readmeFilename":"Readme.md","users":{"incendiary":true,"shanewholloway":true}}