add wrapper class for place data passed to tokenizer

This is mostly for convenience and documentation purposes.
This commit is contained in:
Sarah Hoffmann
2021-09-29 10:37:54 +02:00
parent d44a428b74
commit 231250f2eb
9 changed files with 84 additions and 34 deletions

View File

@@ -405,16 +405,16 @@ class LegacyNameAnalyzer(AbstractAnalyzer):
"""
token_info = _TokenInfo(self._cache)
names = place.get('name')
names = place.name
if names:
token_info.add_names(self.conn, names)
country_feature = place.get('country_feature')
country_feature = place.country_feature
if country_feature and re.fullmatch(r'[A-Za-z][A-Za-z]', country_feature):
self.add_country_names(country_feature.lower(), names)
address = place.get('address')
address = place.address
if address:
self._process_place_address(token_info, address)