115 """Parse the text written in green.
118 * "{authors} - {journal}, {year} - {publisher}"
119 * "{authors} - {year} - {publisher}"
120 * "{authors} - {publisher}"
122 if text
is None or text ==
"":
123 return None,
None,
None,
None
125 s_text = text.split(
' - ')
126 authors = s_text[0].split(
', ')
127 publisher = s_text[-1]
129 return authors,
None, publisher,
None
133 journal_year = s_text[1].split(
', ')
135 if len(journal_year) > 1:
136 journal =
', '.join(journal_year[0:-1])
142 year = journal_year[-1]
144 publishedDate = datetime.strptime(year.strip(),
'%Y')
147 return authors, journal, publisher, publishedDate