summaryrefslogtreecommitdiff
path: root/scraper/util.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-02-20 17:19:03 +0100
committerJules Laplace <julescarbon@gmail.com>2019-02-20 17:19:03 +0100
commit16f7583dbdb2928c557d0ee3766f809779ae9b39 (patch)
tree78711119681f7dbd21c7523c77ea0a4f31e56cbe /scraper/util.py
parent9b97ddf7e1bc1febc4066cd5e083cee688d77027 (diff)
smoother geocode process, fix html entities
Diffstat (limited to 'scraper/util.py')
-rw-r--r--scraper/util.py5
1 files changed, 3 insertions, 2 deletions
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
-