[fix] if there are street types that are not venue words and not vice versa, then call the venue invalid as a standalone term
This commit is contained in:
@@ -215,7 +215,7 @@ class OSMAddressFormatter(object):
|
||||
venue_phrases = venue_names_gazetteer.extract_phrases(name, languages=languages)
|
||||
street_phrases = street_types_only_gazetteer.extract_phrases(name, languages=languages)
|
||||
|
||||
if street_phrases - venue_phrases and not (AddressFormatter.HOUSE_NUMBER in address_components and AddressFormatter.ROAD in address_components):
|
||||
if street_phrases - venue_phrases and not venue_phrases - street_phrases and not (AddressFormatter.HOUSE_NUMBER in address_components and AddressFormatter.ROAD in address_components):
|
||||
return False
|
||||
|
||||
if not address_components and not venue_phrases:
|
||||
|
||||
Reference in New Issue
Block a user