mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
* Set is_parsed and is_tagged attrs when loading annotations into Doc, re Issue #152
This commit is contained in:
parent
1c0356e4c2
commit
52fc338001
|
@ -388,9 +388,13 @@ cdef class Doc:
|
||||||
tokens[i + values[i]].l_kids += 1
|
tokens[i + values[i]].l_kids += 1
|
||||||
elif values[i] < 0:
|
elif values[i] < 0:
|
||||||
tokens[i + values[i]].r_kids += 1
|
tokens[i + values[i]].r_kids += 1
|
||||||
|
if not self.is_parsed and tokens[i].head != 0:
|
||||||
|
self.is_parsed = True
|
||||||
elif attr_id == TAG:
|
elif attr_id == TAG:
|
||||||
for i in range(length):
|
for i in range(length):
|
||||||
tokens[i].tag = values[i]
|
tokens[i].tag = values[i]
|
||||||
|
if not self.is_tagged and tokens[i].tag != 0:
|
||||||
|
self.is_tagged = True
|
||||||
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]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user