1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2024-09-08 02:58:26 +02:00

csv_metadata_quality/fix.py: minor update to DOI fix

Normalize www.doi.org to doi.org in DOI field.
This commit is contained in:
Alan Orth 2024-06-25 11:48:45 +03:00
parent c1f630c298
commit ae38a826ec
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -441,6 +441,13 @@ def normalize_dois(field):
pattern = re.compile(r"dx\.doi\.org")
match = re.findall(pattern, new_value)
if match:
new_value = re.sub(pattern, "doi.org", new_value)
# Convert www.doi.org to doi.org
pattern = re.compile(r"www\.doi\.org")
match = re.findall(pattern, new_value)
if match:
new_value = re.sub(pattern, "doi.org", new_value)