2017-09-06 16:40:18 +00:00
|
|
|
import pytest
|
2017-10-24 15:05:15 +00:00
|
|
|
import spacy
|
2017-09-06 16:40:18 +00:00
|
|
|
|
2017-10-24 15:05:15 +00:00
|
|
|
#@pytest.mark.models('en')
|
|
|
|
def test_issue1305():
|
2017-09-06 16:40:18 +00:00
|
|
|
'''Test lemmatization of English VBZ'''
|
2017-10-24 15:05:15 +00:00
|
|
|
nlp = spacy.load('en_core_web_sm')
|
|
|
|
assert nlp.vocab.morphology.lemmatizer('works', 'verb') == ['work']
|
|
|
|
doc = nlp(u'This app works well')
|
|
|
|
print([(w.text, w.tag_) for w in doc])
|
2017-09-06 16:40:18 +00:00
|
|
|
assert doc[2].lemma_ == 'work'
|