summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers
diff options
context:
space:
mode:
Diffstat (limited to 'python/fatcat_tools/importers')
-rw-r--r--python/fatcat_tools/importers/datacite.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index 703dbc27..eb49596f 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -549,10 +549,13 @@ class DataciteImporter(EntityImporter):
lang = langdetect.detect(text)
except (langdetect.lang_detect_exception.LangDetectException, TypeError) as err:
print('[{}] language detection failed with {} on {}'.format(doi, err, text), file=sys.stderr)
+ abstract_text = clean(text)
+ if not abstract_text:
+ continue
abstracts.append(
fatcat_openapi_client.ReleaseAbstract(
mimetype="text/plain",
- content=clean(text),
+ content=abstract_text,
lang=lang,
))