[fix] PEBCAK
This commit is contained in:
@@ -174,14 +174,14 @@ class AddressFormatter(object):
|
|||||||
tokens = tokenize_raw(value.strip())
|
tokens = tokenize_raw(value.strip())
|
||||||
for token_start, token_length, token_type in tokens:
|
for token_start, token_length, token_type in tokens:
|
||||||
start = token_start
|
start = token_start
|
||||||
if token_type in (comma, hyphen):
|
if token_type not in (comma, hyphen):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
start = token_start + token_length
|
start = token_start + token_length
|
||||||
|
|
||||||
for token_start, token_length, token_type in reversed(tokens):
|
for token_start, token_length, token_type in reversed(tokens):
|
||||||
end = token_start + token_length
|
end = token_start + token_length
|
||||||
if token_type in (comma, hyphen):
|
if token_type not in (comma, hyphen):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
end = token_start
|
end = token_start
|
||||||
|
|||||||
Reference in New Issue
Block a user