commited all contents created by participants
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
def splitParagraphIntoSentences(paragraph):
|
||||
''' break a paragraph into sentences
|
||||
and return a list '''
|
||||
import re
|
||||
# to split by multile characters
|
||||
|
||||
sentenceEnders = re.compile('[.!?]')
|
||||
sentenceList = split(paragraph)
|
||||
return sentenceList
|
||||
|
||||
with open("how_2_use_drill.txt", "r" ) as source:
|
||||
for line in source:
|
||||
sentences = splitParagraphIntoSentences(line)
|
||||
for s in sentences:
|
||||
print s.strip()
|
||||
|
||||
Reference in New Issue
Block a user