microsoft / damlev Goto Github PK
View Code? Open in Web Editor NEW:memo: The fastest JS implementation of the Damerau-Levenshtein edit distance
License: MIT License
:memo: The fastest JS implementation of the Damerau-Levenshtein edit distance
License: MIT License
Hi! I believe there is a bug in your implementation that affects the append distance:
var dl = require('damlev');
dl('foo', 'foo') // expected 0, got 0
dl('foo', 'foob') // expected 1, got 1
dl('foo', 'fooba') // expected 2, got 4
dl('foo', 'foobar') // expected 3, got 6
dl('foo', 'foobarb') // expected 4, got 6
dl('foo', 'foobarba') // expected 5, got 7
dl('foo', 'foobarbaz') // expected 6, got 14
dl('foo', 'foo') // expected 0, got 0
dl('foo', 'bfoo') // expected 1, got 1
dl('foo', 'bafoo') // expected 2, got 2
dl('foo', 'barfoo') // expected 3, got 4
dl('foo', 'barbfoo') // expected 4, got 6
dl('foo', 'barbafoo') // expected 5, got 7
dl('foo', 'barbazfoo') // expected 6, got 15
Hey @connor4312,
Is there a good way to get the actual required edit ops out of this algo? I assume it would require swapping out each instance of Math.min()
with longer conditional statements? Any pointers on how to do this (or a demo branch ;) would be great. Also, passing in specific op costs would be useful.
thanks!
would like to use with https://unpkg.com/
Hello
Do you think it may be even faster as a C/C++ node.js module?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.