spaCy/spacy/tests/lang/tr/test_lemmatization.py
2017-12-01 17:04:32 +03:00

15 lines
709 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding: utf-8
from __future__ import unicode_literals
import pytest
@pytest.mark.parametrize('string,lemma', [('evlerimizdeki', 'ev'),
('işlerimizi', ''),
('biran', 'biran'),
('bitirmeliyiz', 'bitir'),
('isteklerimizi', 'istek'),
('karşılaştırmamızın', 'karşılaştır'),
('çoğulculuktan', 'çoğulcu')])
def test_lemmatizer_lookup_assigns(tr_tokenizer, string, lemma):
tokens = tr_tokenizer(string)
assert tokens[0].lemma_ == lemma