Merge lemmatizer tests

This commit is contained in:
Ines Montani 2017-01-12 11:16:53 +01:00
parent 3bc082abdf
commit 1add8ace67
2 changed files with 9 additions and 12 deletions

View File

@ -1,12 +0,0 @@
from __future__ import unicode_literals
from spacy.en import English
import pytest
@pytest.mark.models
def test_lemma_assignment(EN):
tokens = u'Bananas in pyjamas are geese .'.split(' ')
doc = EN.tokenizer.tokens_from_list(tokens)
assert all( t.lemma_ == u'' for t in doc )
EN.tagger(doc)
assert all( t.lemma_ != u'' for t in doc )

View File

@ -91,3 +91,12 @@ def test_pickle_lemmatizer(lemmatizer):
file_.seek(0) file_.seek(0)
loaded = pickle.load(file_) loaded = pickle.load(file_)
@pytest.mark.models
def test_lemma_assignment(EN):
tokens = u'Bananas in pyjamas are geese .'.split(' ')
doc = EN.tokenizer.tokens_from_list(tokens)
assert all( t.lemma_ == u'' for t in doc )
EN.tagger(doc)
assert all( t.lemma_ != u'' for t in doc )