aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-28 21:33:07 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-28 21:33:07 -0800
commit37dbdaf1280137a086b74eeb6d7c352ee1ff61f4 (patch)
tree83526062544e821d165db2b94d04fafaa3d36f56
parent89b729feac30a272b557542c5c4149d3611f869a (diff)
downloadfatcat-37dbdaf1280137a086b74eeb6d7c352ee1ff61f4.tar.gz
fatcat-37dbdaf1280137a086b74eeb6d7c352ee1ff61f4.zip
filter short/stub original_title
-rw-r--r--python/fatcat_tools/importers/crossref.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py
index c163a534..082a638b 100644
--- a/python/fatcat_tools/importers/crossref.py
+++ b/python/fatcat_tools/importers/crossref.py
@@ -338,11 +338,15 @@ class CrossrefImporter(EntityImporter):
original_title = None
if obj.get('original-title'):
original_title = clean(obj.get('original-title')[0], force_xml=True)
+ if len(original_title) < 2:
+ original_title = None
+
+ title = None
if obj.get('title'):
title = clean(obj.get('title')[0], force_xml=True)
- if not title or len(title) < 2:
- # title can't be just a single character
- return None
+ if len(title) < 2:
+ # title can't be just a single character
+ return None
if extra_crossref:
extra['crossref'] = extra_crossref