* Fix tests

This commit is contained in:
Matthew Honnibal 2015-06-07 18:07:32 +02:00
parent e3af6af83c
commit dd587b7477
4 changed files with 4 additions and 6 deletions

View File

@ -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']

View File

@ -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

View File

@ -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