[fix] checking for components
This commit is contained in:
@@ -476,9 +476,10 @@ class OpenAddressesFormatter(object):
|
|||||||
if rand_val < place_and_postcode_probability:
|
if rand_val < place_and_postcode_probability:
|
||||||
components = self.components.drop_postcode(components)
|
components = self.components.drop_postcode(components)
|
||||||
|
|
||||||
formatted = self.formatter.format_address(components, country, language=language,
|
if components:
|
||||||
minimal_only=False, tag_components=tag_components)
|
formatted = self.formatter.format_address(components, country, language=language,
|
||||||
yield (language, country, formatted)
|
minimal_only=False, tag_components=tag_components)
|
||||||
|
yield (language, country, formatted)
|
||||||
|
|
||||||
def build_training_data(self, base_dir, out_dir, tag_components=True):
|
def build_training_data(self, base_dir, out_dir, tag_components=True):
|
||||||
if tag_components:
|
if tag_components:
|
||||||
|
|||||||
Reference in New Issue
Block a user