skip most addr: tags with suffixes

Only one addr: tag can be processed currently, so make
sure it is the one without suffixes to not get odd data.
addr:street is the exception because it uses a different
matching mechanism.
This commit is contained in:
Sarah Hoffmann
2021-12-06 14:46:40 +01:00
parent 5e435b41ba
commit 7f7d2fd5b3
2 changed files with 17 additions and 2 deletions

View File

@@ -420,8 +420,9 @@ class LegacyICUNameAnalyzer(AbstractAnalyzer):
if token:
streets.append(token)
elif item.kind == 'place':
token_info.add_place(self._compute_partial_tokens(item.name))
elif not item.kind.startswith('_') and \
if not item.suffix:
token_info.add_place(self._compute_partial_tokens(item.name))
elif not item.kind.startswith('_') and not item.suffix and \
item.kind not in ('country', 'full'):
addr_terms.append((item.kind, self._compute_partial_tokens(item.name)))