Most efficient way to calculate Levenshtein distance

后端 未结 6 440
傲寒
傲寒 2020-11-28 08:37

I just implemented a best match file search algorithm to find the closest match to a string in a dictionary. After profiling my code, I found out that the overwhelming major

6条回答
  •  旧时难觅i
    2020-11-28 09:37

    According to a comment on this blog, Speeding Up Levenshtein, you can use VP-Trees and achieve O(nlogn). Another comment on the same blog points to a python implementation of VP-Trees and Levenshtein. Please let us know if this works.

提交回复
热议问题