mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-13 09:42:26 +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
|
from spacy.en import English
|
||||||
import numpy
|
import numpy
|
||||||
from spacy.attrs import HEAD
|
from spacy.attrs import HEAD
|
||||||
|
from ...vocab import Vocab
|
||||||
|
from ...tokens.doc import Doc
|
||||||
|
|
||||||
import pytest
|
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
|
@pytest.mark.models
|
||||||
def test_getitem(EN):
|
def test_getitem(EN):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user