Skip to content

Commit

Permalink
Add tests for token comparison, re Issue #631
Browse files Browse the repository at this point in the history
  • Loading branch information
honnibal committed Jan 9, 2017
1 parent c9fdd99 commit 18c3c2d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spacy/tests/tokens/test_tokens_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@
from spacy.en import English
import numpy
from spacy.attrs import HEAD
from ...vocab import Vocab
from ...tokens.doc import Doc

import pytest

def test_tokens_compare_by_string_position():
vocab = Vocab()
doc = Doc(vocab, [u'one', u'two', u'three'])
one, two, three = doc
assert one < two < three
assert not one > two
assert two > one
assert two <= three
assert three >= one


@pytest.mark.models
def test_getitem(EN):
Expand Down

0 comments on commit 18c3c2d

Please sign in to comment.