Skip to content

Commit

Permalink
Remove garbage in the name after semicolons (issue #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersanp committed Feb 18, 2018
1 parent cbd6336 commit 6374bf4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hgwnames.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def normalize(text):

def parse(name):
"""Transform the name of a street from Cadastre conventions to OSM ones."""
name = name.split(';')[0] # Remove additional information
name = re.sub('[,]+', ', ', name).strip() # Avoids comma without trailing space
result = []
for (i, word) in enumerate(re.split('[ ]+', name.strip())):
Expand Down

0 comments on commit 6374bf4

Please sign in to comment.