Is there a faster (less precise) algorithm than Levenshtein for string distance?

前端 未结 3 1523
孤城傲影
孤城傲影 2021-01-05 17:56

I want to run the Levenshtein, but WAY faster because it\'s real time application that I\'m building. It can terminate once the distance is greater than 10.

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-05 18:42

    If you want to compare UTF-8 contents use sift4:

    https://siderite.dev/blog/super-fast-and-accurate-string-distance.html

    Also I prepared a jsPerf which shows the performance difference between those libraries: http://jsperf.com/levenshtein-perf

提交回复
热议问题