Text difference algorithm

后端 未结 11 2115
温柔的废话
温柔的废话 2020-11-27 10:56

I need an algorithm that can compare two text files and highlight their difference and ( even better!) can compute their difference in a meaningful way (like two similar fi

11条回答
  •  借酒劲吻你
    2020-11-27 11:24

    There are a number of distance metrics, as paradoja mentioned there is the Levenshtein distance, but there is also NYSIIS and Soundex. In terms of Python implementations, I have used py-editdist and ADVAS before. Both are nice in the sense that you get a single number back as a score. Check out ADVAS first, it implements a bunch of algorithms.

提交回复
热议问题