diff --git a/spacy/attrs.pxd b/spacy/attrs.pxd index bd373c733..d0727d287 100644 --- a/spacy/attrs.pxd +++ b/spacy/attrs.pxd @@ -78,5 +78,6 @@ cpdef enum attr_id_t: LEMMA POS TAG + DEP diff --git a/tests/test_array.py b/tests/test_array.py index b55d87eab..7a08fbb8f 100644 --- a/tests/test_array.py +++ b/tests/test_array.py @@ -29,3 +29,13 @@ def test_tag(): assert feats_array[3][1] == tokens[3].tag +def test_dep(): + text = u'A nice sentence.' + tokens = EN(text) + feats_array = tokens.to_array((attrs.ORTH, attrs.DEP)) + assert feats_array[0][1] == tokens[0].dep + assert feats_array[1][1] == tokens[1].dep + assert feats_array[2][1] == tokens[2].dep + assert feats_array[3][1] == tokens[3].dep + +