When I started writing one function, i got Syntax error. I tried execute line at REPL - and it's worked. But i want to do it at IDE. Can somebody help me?
My code:
def sentence_splitter(file_name):
with open(file_name) as f:
input_str = f.read()
period_indexes = get_periods(input_str)
for el in period_indexes:
sub_str = input_str[el - 14:el + 14]
if not re.search(r'\.\s+[A-Za-z]{1,3}\w+', sub_str) and # Error here
re.search(r'\.\d+', sub_str) and
re.search(r'\.\s+[a-z]+', sub_str) and
re.search(r'([A-Za-z\.]+\.\w+){1,50}', sub_str) and
re.search(r'\w+\.[\.,]+', s):
pass