[fix] return value
This commit is contained in:
@@ -106,7 +106,7 @@ class OpenAddressesFormatter(object):
|
||||
|
||||
formatted = self.formatter.format_address(components, country,
|
||||
language=language, tag_components=tag_components)
|
||||
yield formatted
|
||||
yield (language, country, formatted)
|
||||
|
||||
def build_training_data(self, base_dir, out_dir, tag_components=True):
|
||||
if tag_components:
|
||||
@@ -122,9 +122,9 @@ class OpenAddressesFormatter(object):
|
||||
for file_props in config.get('files', []):
|
||||
filename = file_props['filename']
|
||||
|
||||
path = os.path.join(base_dir, country_code, filename)
|
||||
path = os.path.join(base_dir, country, filename)
|
||||
configs = (file_props, config, self.config)
|
||||
for formatted_address in self.build_training_data_for_file(path, configs, tag_components=tag_components):
|
||||
for language, country, formatted_address in self.build_training_data_for_file(path, configs, tag_components=tag_components):
|
||||
if formatted_address and formatted_address.strip():
|
||||
continue
|
||||
|
||||
@@ -149,7 +149,7 @@ class OpenAddressesFormatter(object):
|
||||
path = os.path.join(base_dir, country, subdir, filename)
|
||||
|
||||
configs = (file_props, subdir_config, config, self.config)
|
||||
for formatted_address in self.build_training_data_for_file(path, configs, tag_components=tag_components):
|
||||
for language, country, formatted_address in self.build_training_data_for_file(path, configs, tag_components=tag_components):
|
||||
if formatted_address and formatted_address.strip():
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user