diff options
| author | jules@lens <julescarbon@gmail.com> | 2019-03-30 16:02:16 +0100 |
|---|---|---|
| committer | jules@lens <julescarbon@gmail.com> | 2019-03-30 16:02:16 +0100 |
| commit | 4772fbdbfe18c5d0e8abd87ac39ebbed5a306b6f (patch) | |
| tree | f8fee86c1cd08993579ab0353c042557fd0db3c7 /scraper/util.py | |
| parent | f99d2d7b13f03e4cc29a8fa9f763dfd5a70102bd (diff) | |
FIX institution lookup from paper thingie
Diffstat (limited to 'scraper/util.py')
| -rw-r--r-- | scraper/util.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scraper/util.py b/scraper/util.py index 65194fd1..05b01fa7 100644 --- a/scraper/util.py +++ b/scraper/util.py @@ -308,7 +308,10 @@ class AddressBook (object): for index, line in enumerate(data): if line[0] == line[1] or line[0] not in entities: entities[line[0]] = index - name = line[1].lower().strip() + name = line[0].lower().strip().strip(string.digits) + if name not in lookup: + lookup[name] = line[0] + name = line[1].lower().strip().strip(string.digits) if name not in lookup: lookup[name] = line[0] self.data = data @@ -347,7 +350,6 @@ def load_institutions(paperId, paper_location_lookup={}): if paperId in paper_location_lookup: items = paper_location_lookup[paperId] result = [] - print(items) if items['validate_1'] is True or items['validate_1'] == 'TRUE': result.append(['', items['institution_1'], '', '']) if items['validate_2'] is True or items['validate_2'] == 'TRUE': |
