From 1e5680202fe2bf0348f969ffd0e4b211cc45e1e5 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 3 Jan 2020 17:08:56 +0100 Subject: datacite: lowercase only once --- python/fatcat_tools/importers/datacite.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py index 8034a5c1..d13e855e 100644 --- a/python/fatcat_tools/importers/datacite.py +++ b/python/fatcat_tools/importers/datacite.py @@ -872,7 +872,7 @@ def index_form_to_display_name(s): if s.count(',') > 1: # "Dr. Hina, Dr. Muhammad Usman Shahid, Dr. Muhammad Zeeshan Khan" return s - stopwords = [ + stopwords = [s.lower() for s in ( 'Archive', 'Collection', 'Coordinator', @@ -890,9 +890,10 @@ def index_form_to_display_name(s): 'University', 'Verein', 'Volkshochschule', - ] + )] + lower = s.lower() for stop in stopwords: - if stop.lower() in s.lower(): + if stop in lower: return s a, b = s.split(',') -- cgit v1.2.3