aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-06-23 20:10:21 -0700
committerBryan Newbold <bnewbold@archive.org>2020-06-23 20:10:21 -0700
commit05f6a1b143a521688ccb3a59f300b44f5c04c6be (patch)
tree903a40c9afee5b491a7d8fa6ccde81bdc202b03e
parent60c02cda282bce6863d3a9ec1938729c899dc61a (diff)
downloadchocula-05f6a1b143a521688ccb3a59f300b44f5c04c6be.tar.gz
chocula-05f6a1b143a521688ccb3a59f300b44f5c04c6be.zip
road: proper language parsing
-rw-r--r--chocula/directories/road.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/chocula/directories/road.py b/chocula/directories/road.py
index fc33a5f..a061a18 100644
--- a/chocula/directories/road.py
+++ b/chocula/directories/road.py
@@ -1,7 +1,7 @@
from typing import Iterable, Optional
import csv
-from chocula.util import clean_str
+from chocula.util import clean_str, parse_lang
from chocula.common import DirectoryLoader
from chocula.database import DirectoryInfo, HomepageUrl
@@ -48,7 +48,11 @@ class RoadLoader(DirectoryLoader):
raw_issn=row["ISSN-L"],
name=clean_str(row["Short Title"]),
publisher=clean_str(row["Publisher"]),
- langs=[lang for lang in (row["Lang1"], row["Lang2"]) if lang],
+ langs=[
+ lang
+ for lang in [parse_lang(s) for s in (row["Lang1"], row["Lang2"])]
+ if lang
+ ],
)
# TODO: region mapping: "Europe and North America"