如何与QUOT;调整" 2串? [英] How to "align" 2 strings?
本文介绍了如何与QUOT;调整" 2串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
首先让我来解释一下我所说的对齐。
First let me explain what I mean by "alignment".
比方说,我们要的字符串:例如AGBCDEF ABCDIEFK
Let's say we have to strings : e.g. AGBCDEF ABCDIEFK
他们的调整将是:
A - G - B - C - D - - E - F -
A - - B - C - D - I - E - F - K
-----------------------------------
A - ? - B - C - D - ? - E - F - ?
另一种(很简单)的例子(因为我相信我的问题有可能是与NLP):
Another (quite simplified) example (since I believe my question has probably something to do with NLP) :
I give Mary a kiss
I give Ann a book
----------------------
I give X a Y
你会如何去的?任何想法(甚至引用)有关的算法?
How would you go about that? Any ideas (or even reference) regarding the algorithm?
我可能会在Objective-C(或PHP)写这篇文章,但是任何code会受到欢迎。
I'm probably going to write this in Objective-C (or PHP), but any code would be welcome.
推荐答案
我觉得你在找什么是最长公共子。
这篇关于如何与QUOT;调整" 2串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文