擅长:python、mysql、java
<p>所以,我知道这个问题是关于使用regex来查找句子,但是,出于同样的原因,regex不是解析html(不同语法类)的正确选择,对于涉及自然语言的问题,regex是一个更糟糕的选择。在</p>
<p>如果你的目标是描述句子,你必须寻找其他工具。我个人推荐nltk提供的Punkt语句标记器。下面是一个例子,说明为什么对于这个任务来说,这是一个比regex更好的选择。在</p>
<pre><code>Punkt knows that the periods in Mr. Smith and Johann S. Bach do not mark
sentence boundaries. And sometimes sentences can start with non-capitalized
words. i is a good variable name.
</code></pre>
<p><a href="http://nltk.org/api/nltk.tokenize.html" rel="nofollow">http://nltk.org/api/nltk.tokenize.html</a>了解更多信息。在</p>