Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
break
if not year:
for el in citation:
m = re_year_in_misc_txt.search(el['misc_txt'])
if m:
year = m.group(0)
if year:
citation.append({'type': 'YEAR',
'year': year,
'misc_txt': '',
})
for el in citation:
if year in el['misc_txt']:
el['misc_txt'] = remove_year(el['misc_txt'], year)
return splitted_citations
for author in re.findall('[a-zA-Z]{4,}', book_authors):
if find_substring_ignore_special_chars(citation_element['misc_txt'], author) != -1:
book_found = True
if book_found:
LOGGER.debug(u"Book found: %s", title)
book_element = {'type': 'BOOK',
'misc_txt': '',
'authors': book_authors,
'title': line[1],
'year': book_year}
citation.append(book_element)
citation_element['misc_txt'] = cut_substring_with_special_chars(citation_element['misc_txt'], title, startIndex)
# Remove year from misc txt
citation_element['misc_txt'] = remove_year(citation_element['misc_txt'], book_year)
return True
LOGGER.debug("Book not found!")
return False