- q.add_token(TokenRange(1, 2), TokenType.PARTIAL,
- MyToken(0.5, 2, address_part, 'address_part', True))
- q.add_token(TokenRange(1, 2), TokenType.WORD,
- MyToken(0, 102, address_full, 'address_full', True))
+ for i in range(num_address_parts):
+ q.add_token(TokenRange(i + 1, i + 2), TokenType.PARTIAL,
+ MyToken(0.5, 2, address_part, 'address_part', True))
+ q.add_token(TokenRange(i + 1, i + 2), TokenType.WORD,
+ MyToken(0, 102, address_full, 'address_full', True))