Split text into sentences [duplicate]
问题 This question already has answers here : Python split text on sentences (10 answers) Closed 9 months ago . I wish to split text into sentences. Can anyone help me? I also need to handle abbreviations. However my plan is to replace these at an earlier stage. Mr. -> Mister import re import unittest class Sentences: def __init__(self,text): self.sentences = tuple(re.split("[.!?]\s", text)) class TestSentences(unittest.TestCase): def testFullStop(self): self.assertEquals(Sentences("X. X.")