I need to parse sentences from a paragraph in Python. Is there an existing package to do this, or should I be trying to use regex here?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
The
nltk.tokenize
module is designed for this and handles edge cases. For example:Here is how I am getting the first n sentences:
Reference: http://www.daniweb.com/software-development/python/threads/303844