Add Lemmatizer fixture

This commit is contained in:
Ines Montani 2017-01-12 23:38:55 +01:00
parent 514bfa2597
commit 09acfbca01

View File

@ -12,6 +12,7 @@ from ..sv import Swedish
from ..hu import Hungarian
from ..tokens import Doc
from ..strings import StringStore
from ..lemmatizer import Lemmatizer
from ..attrs import ORTH, TAG, HEAD, DEP
from ..util import match_best_version, get_data_path
@ -66,6 +67,14 @@ def en_entityrecognizer():
return English.Defaults.create_entity()
@pytest.fixture
def lemmatizer(path):
if path is not None:
return Lemmatizer.load(path)
else:
return None
@pytest.fixture
def text_file():
return StringIO()