mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-22 19:04:25 +03:00
* Make test_tag_names version-portable
This commit is contained in:
parent
a20fdbd8ee
commit
d1c9e7ff70
|
@ -1,11 +1,12 @@
|
||||||
from spacy.en import English
|
from spacy.en import English
|
||||||
|
import six
|
||||||
|
|
||||||
def test_tag_names():
|
def test_tag_names():
|
||||||
nlp = English()
|
nlp = English()
|
||||||
tokens = nlp(u'I ate pizzas with anchovies.', parse=True, tag=True)
|
tokens = nlp(u'I ate pizzas with anchovies.', parse=True, tag=True)
|
||||||
pizza = tokens[2]
|
pizza = tokens[2]
|
||||||
assert type(pizza.pos) == int
|
assert type(pizza.pos) == int
|
||||||
assert type(pizza.pos_) == str
|
assert isinstance(pizza.pos_, six.text_types)
|
||||||
assert type(pizza.dep) == int
|
assert type(pizza.dep) == int
|
||||||
assert type(pizza.dep_) == str
|
assert isinstance(pizza.dep_, six.text_types)
|
||||||
assert pizza.tag_ == u'NNS'
|
assert pizza.tag_ == u'NNS'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user