3 ms·
I have only looked at the README. > If you run go test the tests will pass which validate that Levenshtein performs < 60% accuracy and closestmatch performs wi
by Safety1stClyde 10y ago
I have only looked at the README.
> If you run go test the tests will pass which validate that Levenshtein performs < 60% accuracy and closestmatch performs with > 98% accuracy.
If you've set those tests up yourself, what you mean by "accuracy" may be what your library achieves.
- qrv3w 10y agoYou're absolutely right. You can check out the tests [1] - its a lot of re-ordering and inserting random letters in random places, which basically trying to emulate sloppy user input. Your comment is also getting at a caveat: this library works better than Levenshtein for long strings (multiple words) but worse than Levenshtein for short strings (e.g. single words) as there is too much overlap in character n-grams. [1] https://github.com/schollz/closestmatch/blob/master/closestmatch.go#L181 https://github.com/schollz/closestmatch/blob/master/closestm...