比较2个单词 [英] Compare 2 Words

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

问题描述

问题:

是否可以比较"Hollændervej"和"Hollændervej"。和"Hollaedervej"除了"ae"之外,它们是类似的。和"æ"使用Levenshtein算法后?




背景: 

比较单词"b"是否更容易ASDF"和"ssdf"使用Levenshtein算法后因为你的差值为1.



为了比较"asdf"和"ssdf"你只需删除第一个字母。



比较  "Hollændervej"和"Hollaedervej",这有点困难。



我只是不知道如何解决它。



谢谢!

Questions:
Is there a possibility to compare if "Hollændervej" and "Hollaedervej" are similiar except the "ae" and "æ" after using Levenshtein algorithm?


Background: 
Is it easier to compare the word "asdf" and "ssdf" after using Levenshtein algorithm because you the value of the difference that is 1.

In order to compare "asdf" and "ssdf" you just remove the first letter.

Compare to  "Hollændervej" and "Hollaedervej", it is a little more difficult.

I just don't know how to solve it.

Thank you!

推荐答案

嗯,他们之间的Levenshtein距离应该是2,对吧? 一次插入,一次替换。

Well, the Levenshtein distance between them should be 2, right?  One insertion, one replacement.

当然,一种替代方法是用等效替换所有潜在的连线。 因此,在比较之前,请替换'æ'带有'ae'的
,等等。 这通常是用德语'
ß'完成的,比较为'ss'。

One alternative, of course, is to replace all of the potential ligatures with their equivalents.  So, before comparing, replace 'æ' with 'ae', and so on.  That's often done with the German 'ß', which compares as 'ss'.


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

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