开发者

algorithm to find out if two sentence parts can be joined together

I'm looking to build a开发者_JS百科n algorithm that can join together sentence parts. So, for example, it would know that

"drank it down and ordered a second glass,"

would be able to follow:

"He listened to what she had to say and ordered a glass of wine,"

but

"by trying to know what he could not understand,"

would not.

I'm familiar with the NLTK - any suggestions?


This is actually proven to be unsolvable. The code would have to have understanding of the meaning of the words to be sure. What you are effectively asking for is a Context-free Grammar (http://en.wikipedia.org/wiki/Context-free_grammar) which simply doesn't exist for human languages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜