mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
* 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:
parent
b64b2bd910
commit
6640386b25
|
@ -78,5 +78,6 @@ cpdef enum attr_id_t:
|
|||
LEMMA
|
||||
POS
|
||||
TAG
|
||||
DEP
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user