From db71b65412cdcbc90f984839af8b8be55fefb6d6 Mon Sep 17 00:00:00 2001 From: Al Date: Fri, 2 Oct 2015 20:28:45 -0400 Subject: [PATCH] [fix] checking validity of component combination --- scripts/geodata/osm/osm_address_training_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/geodata/osm/osm_address_training_data.py b/scripts/geodata/osm/osm_address_training_data.py index 051b1ab2..2e9ff504 100644 --- a/scripts/geodata/osm/osm_address_training_data.py +++ b/scripts/geodata/osm/osm_address_training_data.py @@ -500,7 +500,7 @@ def build_address_format_training_data(language_rtree, infile, out_dir, tag_comp current_components = component_bitset(address_components.keys()) for component in address_components.keys(): - if current_components ^ OSM_ADDRESS_COMPONENT_VALUES[component] and random.random() >= 0.5: + if current_components ^ OSM_ADDRESS_COMPONENT_VALUES[component] in OSM_ADDRESS_COMPONENTS_VALID and random.random() >= 0.5: address_components.pop(component) current_components ^= OSM_ADDRESS_COMPONENT_VALUES[component] if not address_components: