是否有任何算法可以找到與字符串集合中字符串最接近的匹配?例如:是否有任何算法可以找到與字符串集合中字符串最接近的匹配?
string_to_match = 'What color is the sky?'
strings = [
'What colour is the sea?',
'What colour is the sky?',
'What colour is grass?',
'What colour is earth?'
]
answer = method_using_string_matching_algorithm(string_to_match, strings)
answer # returns strings[1] 'What colour is the sky?'
請定義您的「親密度」指標。 – Skiminok 2012-04-27 10:21:11
可能的重複:http://stackoverflow.com/questions/49263/approximate-string-matching-algorithms – DhruvPathak 2012-04-27 10:21:42
你試過[維基百科](http://en.wikipedia.org/wiki/Approximate_string_matching)嗎? – 2012-04-27 10:22:29