2
我的目标是从两段文字中找到类似的短语。在两段文字之间找到匹配的短语?
我知道常见的词将是一个问题。例如,and the
we are the
。在这种情况下,我认为过滤器是必要的。
我想知道这是否是一种好方法?这使用递归,如果它发现匹配,它会查看下一个单词是否也匹配,并继续直到没有匹配。
1. the cat is on the roof
2. a man is on the stage
A1 = [the, cat, is, on, the, roof]
A2 = [a, man, is, on, the, stage]
[the]: no match
[cat]: no match
[is]: match
[is, on]: match
[is, on, the]: match
[is, on, the, roof]: no match
[on]: match
[on, the]: match
[on, the, roof]: no match
[the]: match
[the, roof]: no match
[roof]: no match
-end-
您希望我们对方法提供建议,您可以在方法看起来没问题的情况下显示代码 – RageZ 2011-12-21 09:39:55