mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-27 09:44:36 +03:00
* Bug fixes to edge calculation
This commit is contained in:
parent
7f9384f53c
commit
02b171ee67
|
@ -193,11 +193,13 @@ cdef class StateClass:
|
||||||
cdef int i
|
cdef int i
|
||||||
if child > head:
|
if child > head:
|
||||||
self._sent[head].r_kids += 1
|
self._sent[head].r_kids += 1
|
||||||
self._sent[head].r_edge = child
|
# Some transition systems can have a word in the buffer have a
|
||||||
|
# rightward child, e.g. from Unshift.
|
||||||
|
self._sent[head].r_edge = self._sent[child].r_edge
|
||||||
i = 0
|
i = 0
|
||||||
while self.has_head(head) and i < self.length:
|
while self.has_head(head) and i < self.length:
|
||||||
self._sent[head].r_edge = child
|
|
||||||
head = self.H(head)
|
head = self.H(head)
|
||||||
|
self._sent[head].r_edge = self._sent[child].r_edge
|
||||||
i += 1 # Guard against infinite loops
|
i += 1 # Guard against infinite loops
|
||||||
else:
|
else:
|
||||||
self._sent[head].l_kids += 1
|
self._sent[head].l_kids += 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user