From 16f7583dbdb2928c557d0ee3766f809779ae9b39 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Feb 2019 17:19:03 +0100 Subject: smoother geocode process, fix html entities --- scraper/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scraper/util.py') diff --git a/scraper/util.py b/scraper/util.py index 0401b342..fdbc0534 100644 --- a/scraper/util.py +++ b/scraper/util.py @@ -308,7 +308,9 @@ class AddressBook (object): for index, line in enumerate(data): if line[0] == line[1] or line[0] not in entities: entities[line[0]] = index - lookup[line[1].lower().strip()] = line[0] + name = line[1].lower().strip() + if name not in lookup: + lookup[name] = line[0] self.data = data self.lookup = lookup self.entities = entities @@ -460,4 +462,3 @@ def load_countries(): for alt_name in country['alt']: lookup[alt_name] = name return lookup - -- cgit v1.2.3-70-g09d2