Look for more variations of street names

This commit is contained in:
Edward Betts 2021-10-22 11:30:27 +01:00
parent badef91b97
commit 2c8ac7259c

View file

@ -430,8 +430,9 @@ def api_get_item_tags(item_id):
duration=t1)
def expand_street_name(name):
ret = {name}
def expand_street_name(from_names):
ret = set(from_names)
for name in from_names:
if any(name.startswith(st) for st in ('St ', 'St. ')):
first_space = name.find(' ')
ret.add("Saint" + name[first_space:])
@ -444,6 +445,7 @@ def expand_street_name(name):
for n in set(ret):
ret.extend(part.strip() for part in n.split("/"))
ret.update({"The " + name for name in ret if not name.startswith("The ")})
return ret