最相似的串串比较 [英] string comparison with the most similar string

查看:137
本文介绍了最相似的串串比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有人知道是否存在给定的一个字符串A和字符串B上阵列的算法,与B中给出的输出最相似者一切的字符串比较的字符串。

does anyone know if exist an algorithm that given one string A and an array of strings B, compares the A string with all the strings in B giving in output the most similar one.

有关最相似的一我的意思是,例如,

For "the most similar one" I mean that for example,

如果该字符串是:世界你好你怎么样

if the A string is: "hello world how are you"

然后

ASDF asdewr世界你好如何asfrqr你

"asdf asdewr hello world how asfrqr you"

更类似于比:

h2ll4 w1111 H11 111 111

"h2ll4 w1111 h11 111 111"

推荐答案

这个通常的测量是莱文斯坦距离。计算从原来的Levenshtein距离每名候选人,并采取最小距离为最有可能的人选。

The usual measurement for this is the Levenshtein distance. Compute the Levenshtein distance from the original to each candidate, and take the smallest distance as the most likely candidate.

这篇关于最相似的串串比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆