String similarity algorithms?

前端 未结 5 546
傲寒
傲寒 2020-11-27 13:00

I need to compare 2 strings and calculate their similarity, to filter down a list of the most similar strings.

Eg. searching for \"dog\" would return

  1. d
5条回答
  •  [愿得一人]
    2020-11-27 13:54

    It seems you are needing some kind of fuzzy matching. Here is java implementation of some set of similarity metrics http://www.dcs.shef.ac.uk/~sam/stringmetrics.html. Here is more detailed explanation of string metrics http://www.cs.cmu.edu/~wcohen/postscript/ijcai-ws-2003.pdf it depends on how fuzzy and how fast your implementation must be.

提交回复
热议问题