mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Add tests for token comparison, re Issue #631
This commit is contained in:
parent
c9fdd9917c
commit
18c3c2d05c
|
@ -4,9 +4,21 @@ from spacy.tokens import Doc
|
|||
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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user