mirror of https://github.com/explosion/spaCy.git
* Fix tests
This commit is contained in:
parent
e3af6af83c
commit
dd587b7477
|
@ -11,8 +11,6 @@ def orths(tokens):
|
|||
def test_simple_two(EN):
|
||||
tokens = EN('I lost money and pride.', tag=True, parse=True)
|
||||
pride = tokens[4]
|
||||
for t in tokens:
|
||||
print t.orth_, t.tag_, t.head.orth_
|
||||
assert orths(pride.conjuncts) == ['money', 'pride']
|
||||
money = tokens[2]
|
||||
assert orths(money.conjuncts) == ['money', 'pride']
|
||||
|
|
|
@ -7,7 +7,7 @@ import pytest
|
|||
|
||||
@pytest.fixture
|
||||
def sun_text():
|
||||
with codecs.open(path.join(path.dirname(__file__), 'sun.txt'), 'r', 'utf8') as file_:
|
||||
with codecs.open(path.join(path.dirname(__file__), '..', 'sun.txt'), 'r', 'utf8') as file_:
|
||||
text = file_.read()
|
||||
return text
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ HERE = path.dirname(__file__)
|
|||
|
||||
@pytest.fixture
|
||||
def sun_txt():
|
||||
loc = path.join(HERE, 'sun.txt')
|
||||
loc = path.join(HERE, '..', 'sun.txt')
|
||||
return utf8open(loc).read()
|
||||
|
||||
|
||||
def test_tokenize(sun_txt, EN):
|
||||
def test_tokenize(sun_txt, en_tokenizer):
|
||||
assert len(sun_txt) != 0
|
||||
tokens = nlp(sun_txt)
|
||||
tokens = en_tokenizer(sun_txt)
|
||||
assert len(tokens) > 100
|
||||
|
|
Loading…
Reference in New Issue