Files
ola5doc/output/sources/poemecanic2.py
T

12 lines
300 B
Python

def findTheWordsBefore(paragraph):
import re
prose = re.compile(r"(\s\w*\s\w*\s\w*\s)+drill")
List = prose.split(paragraph)
return List
with open("how_2_use_drill.txt", "r" ) as source:
for line in source:
sentences = findTheWordsBefore(line)
for s in sentences:
print s.strip()