[names] adding new name_affixes call to replace both prefixes/suffixes in one call, using in GeoPlanet training and the generic AddressComponents normalizations

This commit is contained in:
Al
2016-12-07 05:49:16 -05:00
parent 9386a999f6
commit 7436d9693a
3 changed files with 17 additions and 12 deletions

View File

@@ -109,4 +109,7 @@ class NameAffixes(object):
return re.sub(six.u(''), name)
def replace_affixes(self, name, lang, country=None, sim_only=False):
return self.replace_prefixes(self.replace_suffixes(name, lang, country=country, sim_only=sim_only), lang, country=country, sim_only=sim_only)
name_affixes = NameAffixes()