Need a routine to detect strings that are similar but not identical

后端 未结 1 2046
猫巷女王i
猫巷女王i 2021-02-08 08:47

I have a list of strings, some of which have been modified since my previous release. Some of the changes are trivial (spacing, off by one word, etc). I would like to detect s

1条回答
  •  一整个雨季
    2021-02-08 09:42

    There are many such algorithms. Keywords are fuzzy string matching.

    A well known one is a Levenshtein distance. By it you can calculate the number of "changes" required to transform one string into another, so that gives you an estimate of how similar the strings are.

    See also this question: How to search for similar words for solutions in Delphi.

    0 讨论(0)
提交回复
热议问题