How to determine a strings dna for likeness to another

后端 未结 6 2060
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-28 20:44

I am hoping I am wording this correctly to get across what I am looking for.

I need to compare two pieces of text. If the two strings are alike I would like to get s

6条回答
  •  长发绾君心
    2020-12-28 21:03

    Since the Levenshtein distance needs both input strings to produce a value, you would have to store all strings.

    You could, however, use a small number of strings as markers and only store these as strings.

    You would then calculate the Levenshtein distance from a new string to each of these marker strings and store these values. You could then guess that two strings that have a similar Levenshtein distance to all markers are also similar to each other. It would likely be sensible to "engineer" these markers in such a way that their mutual Levenshtein distance is as large as possible. I don't know whether there has been some research in this direction.

提交回复
热议问题