【发布时间】:2012-04-27 10:19:28
【问题描述】:
是否有任何算法可以从字符串集合中找到与字符串最接近的匹配项?例如:
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?'
【问题讨论】:
-
请定义您的“亲密度”指标。
-
你试过Wikipedia吗?
-
为什么不能对每个字符串逐个运行字符串匹配?
-
'滑雪板是什么颜色的?'