108 """Parse the text written in green.
111 * "{authors} - {journal}, {year} - {publisher}"
112 * "{authors} - {year} - {publisher}"
113 * "{authors} - {publisher}"
115 if text
is None or text ==
"":
116 return None,
None,
None,
None
118 s_text = text.split(
' - ')
119 authors = s_text[0].split(
', ')
120 publisher = s_text[-1]
122 return authors,
None, publisher,
None
126 journal_year = s_text[1].split(
', ')
128 if len(journal_year) > 1:
129 journal =
', '.join(journal_year[0:-1])
135 year = journal_year[-1]
137 publishedDate = datetime.strptime(year.strip(),
'%Y')
140 return authors, journal, publisher, publishedDate