-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use fastest-levenshtein instead of leven #7
Conversation
Thank you for the pull request. I believe I dont see a reason for having this package as a wrapper of |
for anyone who is curious of using // levenary
import levenary from 'levenary';
levenary('cat', ['cow', 'dog', 'pig']);
// fastest-levenshtein
const {closest} = require('fastest-levenshtein')
closest('cat', ['cow', 'dog', 'pig']); |
The reason for this package to be a wrapper of fastest-levenshtein is that this package already has a lot of people using it. Why wouldn't you merge a PR that clearly makes it better for them. It does not matter whether fastest-levenshtein has the same functionality or not. This package has less use if it uses leven, bacause then it is just an intentionally slow alternative. You should reconsider. |
@JLHwung @nicolo-ribaudo i need some advice over here.
@ka-weihe here has implemented an even faster levensthein distance library, according to his benchmark. im a bit hesitant to swap from what i see the main dependent on what do you think? |
@tanhauhau For context: babel/babel#11911 (comment) Babel does not swap @ka-weihe I understand your passion on promoting |
I get that Babel doesn't need a fast levenshtein implementation since you only use it on a very small array, but I don't get why you would have two dependecies for something so simple! This (2 line - 150 bytes) piece of code has the functionality of Levenary and Leven combined.
If you don't believe that it works... try run it in your browser.
I suggest people to just write a levenshtein implementation themselves or copy a simple one from google. If performance matters, add a dependency. That is why I think levenary should be fast (not use leven) or at least not deceive people with its benchmarks #8. @tanhauhau |
Thanks for your input. However the recursive version is significantly slow due to the overhead of JS functions. I went with https://rosettacode.org/wiki/Levenshtein_distance#ES5 which is small but not that slow for some 20 character strings. |
fastest-levenshtein
is much faster thanleven
(up to 10x faster). Please consider using it instead.Benchmark
Higher is better.