[fix] checking for components

This commit is contained in:
Al
2016-09-08 03:19:10 -04:00
parent 769a65b808
commit 170e8d74d8

View File

@@ -476,9 +476,10 @@ class OpenAddressesFormatter(object):
if rand_val < place_and_postcode_probability:
components = self.components.drop_postcode(components)
formatted = self.formatter.format_address(components, country, language=language,
minimal_only=False, tag_components=tag_components)
yield (language, country, formatted)
if components:
formatted = self.formatter.format_address(components, country, language=language,
minimal_only=False, tag_components=tag_components)
yield (language, country, formatted)
def build_training_data(self, base_dir, out_dir, tag_components=True):
if tag_components: