* Fix rule that made Last action invalid if there was a preset of O, since if the entity is already open, that ship has sailed.

This commit is contained in:
Matthew Honnibal 2015-11-08 22:17:51 +11:00
parent f9d20b1318
commit e92371bb54

View File

@ -256,12 +256,8 @@ cdef class In:
cdef class Last: cdef class Last:
@staticmethod @staticmethod
cdef bint is_valid(StateClass st, int label) nogil: cdef bint is_valid(StateClass st, int label) nogil:
cdef int preset_ent_iob = st.B_(0).ent_iob if st.B_(1).ent_iob == 1:
if preset_ent_iob == 2:
return False return False
elif st.B_(1).ent_iob == 1:
return False
return st.entity_is_open() and label != 0 and st.E_(0).ent_type == label return st.entity_is_open() and label != 0 and st.E_(0).ent_type == label
@staticmethod @staticmethod