From 09acfbca012c6a1b98fbb4167420ed0b5797f9be Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 12 Jan 2017 23:38:55 +0100 Subject: [PATCH] Add Lemmatizer fixture --- spacy/tests/conftest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spacy/tests/conftest.py b/spacy/tests/conftest.py index dac0669f1..d7eccb9fe 100644 --- a/spacy/tests/conftest.py +++ b/spacy/tests/conftest.py @@ -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()