importredefsplitSentences(sentences):""" Splits a string of sentences into a list. Each sentence is period-separated, save for cases where the phrases "Mr." or "Ms." are used, since those don't end a sentence. """sentenceList=[]# missing code herereturnsentenceList
レスポンス
importredefsplitSentences(sentences):""" Splits a string of sentences into a list. Each sentence is period-separated, save for cases where the phrases "Mr." or "Ms." are used, since those don't end a sentence. """sentenceList=[]sentenceEnders=r'(?<!Mr)\.(?<![A-Z][a-z]\.)(?<![A-Z][a-z][a-z]\.)(?<=\.|\?)\s'sentenceList=re.split(sentenceEnders,sentences)returnsentenceList