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?
The nltk.tokenize
module is designed for this and handles edge cases. For example:
>>> from nltk import tokenize
>>> p = "Good morning Dr. Adams. The patient is waiting for you in room number 3."
>>> tokenize.sent_tokenize(p)
['Good morning Dr. Adams.', 'The patient is waiting for you in room number 3.']