- for key, value in address.items():
- if key == 'postcode':
- self._add_postcode(value)
- elif key in ('housenumber', 'streetnumber', 'conscriptionnumber'):
- hnrs.append(value)
- elif key == 'street':
- token_info.add_street(self._compute_partial_tokens(value))
- elif key == 'place':
- token_info.add_place(self._compute_partial_tokens(value))
- elif not key.startswith('_') and \
- key not in ('country', 'full'):
- addr_terms.append((key, self._compute_partial_tokens(value)))
+ for item in address:
+ if item.kind == 'postcode':
+ self._add_postcode(item.name)
+ elif item.kind in ('housenumber', 'streetnumber', 'conscriptionnumber'):
+ hnrs.append(item.name)
+ elif item.kind == 'street':
+ token_info.add_street(self._compute_partial_tokens(item.name))
+ elif item.kind == 'place':
+ token_info.add_place(self._compute_partial_tokens(item.name))
+ elif not item.kind.startswith('_') and \
+ item.kind not in ('country', 'full'):
+ addr_terms.append((item.kind, self._compute_partial_tokens(item.name)))