Skip to content

Commit

Permalink
fixed _gen_document_dict() to fallover gracefully if a doc is missing…
Browse files Browse the repository at this point in the history
… DOI
  • Loading branch information
Quantisan committed Oct 9, 2023
1 parent f8cc555 commit d034dde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mind_palace/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
def _gen_document_dict(file_path) -> dict[str, TextNode]:
xml = docs.load_tei_xml(file_path)
doi = xml.header.doi
assert doi is not None
if doi is None:
print(f"DOI is None for {file_path}. Replacing with title instead.")
doi = xml.header.title

try:
title_node = docs.title(xml, doi)
Expand Down

0 comments on commit d034dde

Please sign in to comment.