1.1 --- a/iixr/phrases.py Mon Nov 22 23:50:03 2010 +0100
1.2 +++ b/iixr/phrases.py Tue Nov 23 00:22:52 2010 +0100
1.3 @@ -168,6 +168,15 @@
1.4 raise StopIteration
1.5
1.6 def is_phrase_position(self, last, last_token, current, current_token):
1.7 - return current - last <= 1 and current_token > last_token
1.8 + if current_token <= last_token:
1.9 + return 0
1.10 +
1.11 + # NOTE: For position sequences, assume that the first value is the token
1.12 + # NOTE: index/position.
1.13 +
1.14 + if isinstance(last, (list, tuple)):
1.15 + return current[0] - last[0] <= 1
1.16 + else:
1.17 + return current - last <= 1
1.18
1.19 # vim: tabstop=4 expandtab shiftwidth=4