Support TAG attribute in doc.from_array

This commit is contained in:
Matthew Honnibal 2017-01-10 22:47:07 +01:00
parent 271997a146
commit 44e2b0100d
1 changed files with 3 additions and 0 deletions

View File

@ -585,6 +585,9 @@ cdef class Doc:
elif attr_id == POS: elif attr_id == POS:
for i in range(length): for i in range(length):
tokens[i].pos = <univ_pos_t>values[i] tokens[i].pos = <univ_pos_t>values[i]
elif attr_id == TAG:
for i in range(length):
tokens[i].tag = <univ_pos_t>values[i]
elif attr_id == DEP: elif attr_id == DEP:
for i in range(length): for i in range(length):
tokens[i].dep = values[i] tokens[i].dep = values[i]