mirror of https://github.com/explosion/spaCy.git
Update morph exceptions test
This commit is contained in:
parent
d719f8e77e
commit
4cab8ac136
|
@ -9,9 +9,9 @@ import pytest
|
||||||
def test_tagger_load_morph_exc(en_tokenizer):
|
def test_tagger_load_morph_exc(en_tokenizer):
|
||||||
text = "I like his style."
|
text = "I like his style."
|
||||||
tags = ['PRP', 'VBP', 'PRP$', 'NN', '.']
|
tags = ['PRP', 'VBP', 'PRP$', 'NN', '.']
|
||||||
morph_exc = {'PRP$': {'his': {'L': '-PRP-', 'person': 3, 'case': 2}}}
|
morph_exc = {'VBP': {'like': {'L': 'luck'}}}
|
||||||
en_tokenizer.vocab.morphology.load_morph_exceptions(morph_exc)
|
en_tokenizer.vocab.morphology.load_morph_exceptions(morph_exc)
|
||||||
tokens = en_tokenizer(text)
|
tokens = en_tokenizer(text)
|
||||||
doc = get_doc(tokens.vocab, [t.text for t in tokens], tags=tags)
|
doc = get_doc(tokens.vocab, [t.text for t in tokens], tags=tags)
|
||||||
assert doc[2].tag_ == 'PRP$'
|
assert doc[1].tag_ == 'VBP'
|
||||||
assert doc[2].lemma_ == '-PRP-'
|
assert doc[1].lemma_ == 'luck'
|
||||||
|
|
Loading…
Reference in New Issue