mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-13 08:34:57 +03:00
Fix head alignment for split tokens
This commit is contained in:
parent
6aded3d855
commit
e9d1e6d66b
|
@ -472,7 +472,7 @@ cdef class GoldParse:
|
||||||
self.heads[cand_i[-1]] = cand_head[-1]
|
self.heads[cand_i[-1]] = cand_head[-1]
|
||||||
else:
|
else:
|
||||||
self.heads[cand_i[-1]] = cand_head
|
self.heads[cand_i[-1]] = cand_head
|
||||||
elif isinstance(cand_i, tuple) and isinstance(cand_head, int):
|
elif isinstance(cand_i, tuple) and not isinstance(cand_head, list):
|
||||||
# We only handle one-to-many or many-to-one, not many-to-many
|
# We only handle one-to-many or many-to-one, not many-to-many
|
||||||
cand_i, sub_i = cand_i
|
cand_i, sub_i = cand_i
|
||||||
if not isinstance(self.heads[cand_i], list):
|
if not isinstance(self.heads[cand_i], list):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user