Token comparison test

This commit is contained in:
Matthew Honnibal 2017-01-09 19:12:00 +01:00
parent 18c3c2d05c
commit 64f747cb65

View File

@ -12,6 +12,10 @@ import pytest
def test_tokens_compare_by_string_position():
vocab = Vocab()
doc = Doc(vocab, [u'one', u'two', u'three'])
# Get the tokens in this order, so their ID ordering doesn't match the idx
three = doc[-1]
two = doc[-2]
one = doc[-1]
one, two, three = doc
assert one < two < three
assert not one > two