[addresses] let the place config take care of adding/removing neighborhoods rather than doing it as part of the add_neighborhoods method

This commit is contained in:
Al
2016-12-14 03:15:07 -05:00
parent 5946ead37f
commit 846b88cde5
2 changed files with 1 additions and 3 deletions

View File

@@ -108,7 +108,6 @@ boundaries:
neighborhood:
# Usually in Germany, may have e.g. name:prefix=Ortsteil
add_prefix_probability: 0.5
add_neighborhood_probability: 0.5
city:
quattroshapes_geonames_backup_city_probability: 0.2

View File

@@ -954,7 +954,6 @@ class AddressComponents(object):
neighborhood_levels = defaultdict(list)
add_prefix_prob = float(nested_get(self.config, ('neighborhood', 'add_prefix_probability')))
add_neighborhood_prob = float(nested_get(self.config, ('neighborhood', 'add_neighborhood_probability')))
name_key = ''.join((boundary_names.DEFAULT_NAME_KEY, language_suffix))
raw_name_key = boundary_names.DEFAULT_NAME_KEY
@@ -993,7 +992,7 @@ class AddressComponents(object):
neighborhood_levels[neighborhood_level].append(name)
for component, neighborhoods in neighborhood_levels.iteritems():
if component not in address_components and random.random() < add_neighborhood_prob:
if component not in address_components:
address_components[component] = neighborhoods[0]
def generate_sub_building_component(self, component, address_components, language, country=None, **kw):