* Fix Issue #43: TAG attr not supported. Also add DEP attr, while I'm at it. Need better way of ensuring future changes don't break in similar way.

This commit is contained in:
Matthew Honnibal 2015-04-07 06:00:43 +02:00
parent b64b2bd910
commit 6640386b25
2 changed files with 11 additions and 0 deletions

View File

@ -78,5 +78,6 @@ cpdef enum attr_id_t:
LEMMA
POS
TAG
DEP

View File

@ -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