Test morphological features

This commit is contained in:
Matthew Honnibal 2019-03-08 01:38:54 +01:00
parent 9dceb97570
commit 19e6b39786
1 changed files with 5 additions and 0 deletions

View File

@ -22,9 +22,14 @@ def test_token_morph_id(i_has):
def test_morph_props(i_has): def test_morph_props(i_has):
assert i_has[0].morph.pron_type == i_has.vocab.strings["PronType_prs"] assert i_has[0].morph.pron_type == i_has.vocab.strings["PronType_prs"]
assert i_has[0].morph.pron_type_ == "PronType_prs"
assert i_has[1].morph.pron_type == 0 assert i_has[1].morph.pron_type == 0
def test_morph_iter(i_has): def test_morph_iter(i_has):
assert list(i_has[0].morph) == ["PronType_prs"] assert list(i_has[0].morph) == ["PronType_prs"]
assert list(i_has[1].morph) == ["Number_sing", "Person_three", "VerbForm_fin"] assert list(i_has[1].morph) == ["Number_sing", "Person_three", "VerbForm_fin"]
def test_morph_get(i_has):
assert i_has[0].morph.get("pron_type") == "PronType_prs"