spaCy/spacy/tests/regression/test_issue781.py

13 lines
478 B
Python
Raw Normal View History

# coding: utf-8
from __future__ import unicode_literals
import pytest
# Note: "chromosomes" worked previous the bug fix
@pytest.mark.models('en')
2017-11-06 19:02:17 +03:00
@pytest.mark.parametrize('word,lemmas', [("chromosomes", ["chromosome"]), ("endosomes", ["endosome"]), ("colocalizes", ["colocaliz", "colocalize"])])
def test_issue781(EN, word, lemmas):
lemmatizer = EN.Defaults.create_lemmatizer()
2017-11-06 19:34:50 +03:00
assert sorted(lemmatizer(word, 'noun', morphology={'number': 'plur'})) == sorted(lemmas)