From 19e6b39786964d5c4c401fe9bf8c03dacda11dd5 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 8 Mar 2019 01:38:54 +0100 Subject: [PATCH] Test morphological features --- spacy/tests/doc/test_morphanalysis.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spacy/tests/doc/test_morphanalysis.py b/spacy/tests/doc/test_morphanalysis.py index 31c765e32..ffee5694a 100644 --- a/spacy/tests/doc/test_morphanalysis.py +++ b/spacy/tests/doc/test_morphanalysis.py @@ -22,9 +22,14 @@ def test_token_morph_id(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_ == "PronType_prs" assert i_has[1].morph.pron_type == 0 def test_morph_iter(i_has): assert list(i_has[0].morph) == ["PronType_prs"] 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"