* Fix assignment of root label to words left as root implicitly, after parsing ends.

This commit is contained in:
Matthew Honnibal 2016-04-25 19:39:19 +00:00
parent 7c2d2deaa7
commit 77609588b6
1 changed files with 4 additions and 1 deletions

View File

@ -378,7 +378,10 @@ cdef class ArcEager(TransitionSystem):
st.fast_forward() st.fast_forward()
cdef int finalize_state(self, StateC* st) nogil: cdef int finalize_state(self, StateC* st) nogil:
pass cdef int i
for i in range(st.length):
if st._sent[i].head == 0 and st._sent[i].dep == 0:
st._sent[i].dep = self.root_label
cdef int set_valid(self, int* output, const StateC* st) nogil: cdef int set_valid(self, int* output, const StateC* st) nogil:
cdef bint[N_MOVES] is_valid cdef bint[N_MOVES] is_valid