"""Conservative local sentence boundaries for prose, Arabic and Chinese punctuation. This is punctuation-based segmentation, not a language model. Ambiguous abbreviations, poetry and punctuation-free speech can require manual line breaks. """ import re ABBREVIATIONS={'mr','mrs','ms','dr','prof','sr','jr','st','vs','etc','e.g','i.e','fig','no','vol','inc','ltd','a.m','p.m'} CLOSERS='\"\'”’»))]}' def split_sentences(text): paragraphs=re.split(r'\n[ \t]*\n+',text.replace('\r\n','\n').replace('\r','\n').strip()) result=[] for paragraph in paragraphs: p=re.sub(r'[ \t]*\n[ \t]*',' ',paragraph).strip() start=0;i=0 while i