Getting the closest string match

后端 未结 13 709
难免孤独
难免孤独 2020-11-22 10:57

I need a way to compare multiple strings to a test string and return the string that closely resembles it:

TEST STRING: THE BROWN FOX JUMPED OVER THE RED COW         


        
13条回答
  •  隐瞒了意图╮
    2020-11-22 11:15

    You might find this library helpful! http://code.google.com/p/google-diff-match-patch/

    It is currently available in Java, JavaScript, Dart, C++, C#, Objective C, Lua and Python

    It works pretty well too. I use it in a couple of my Lua projects.

    And I don't think it would be too difficult to port it to other languages!

提交回复
热议问题