<p>有没有一种方法(Pattern或Python或NLTK等)可以检测出一个句子中有一个单词列表。</p>
<p>即</p>
<p><code>The cat ran into the hat, box, and house.</code>| <code>The list would be hat, box, and house</code></p>
<p>这可以是字符串处理,但我们可能有更多的通用列表:</p>
<p>即</p>
<p><code>The cat likes to run outside, run inside, or jump up the stairs.</code></p>
<p><code>List=run outside, run inside, or jump up the stairs.</code></p>
<p>这可能在段落的中间或句子的结尾,这会使事情更加复杂。</p>
<p>我已经使用Pattern for python有一段时间了,我没有看到一种方法来实现这一点,我很好奇Pattern或nltk(自然语言工具包)是否有一种方法。</p>