From 36e481c5845bac6ee83498b9a9e15f3348494eff Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 26 Feb 2018 10:53:55 +0100 Subject: [PATCH] Revert "Improve parser oracle around sentence breaks." This reverts commit 50817dc9ad582f06c90aaaab7bf90df3a6396b14. --- spacy/syntax/arc_eager.pyx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index 30314a227..3694ddc24 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -110,8 +110,7 @@ cdef bint _is_gold_root(const GoldParseC* gold, int word) nogil: cdef class Shift: @staticmethod cdef bint is_valid(const StateC* st, attr_t label) nogil: - sent_start = st._sent[st.B_(0).l_edge].sent_start - return st.buffer_length() >= 2 and not st.shifted[st.B(0)] and sent_start != 1 + return st.buffer_length() >= 2 and not st.shifted[st.B(0)] and st.B_(0).sent_start != 1 @staticmethod cdef int transition(StateC* st, attr_t label) nogil: @@ -171,8 +170,7 @@ cdef class Reduce: cdef class LeftArc: @staticmethod cdef bint is_valid(const StateC* st, attr_t label) nogil: - sent_start = st._sent[st.B_(0).l_edge].sent_start - return sent_start != 1 + return st.B_(0).sent_start != 1 @staticmethod cdef int transition(StateC* st, attr_t label) nogil: @@ -207,8 +205,7 @@ cdef class RightArc: @staticmethod cdef bint is_valid(const StateC* st, attr_t label) nogil: # If there's (perhaps partial) parse pre-set, don't allow cycle. - sent_start = st._sent[st.B_(0).l_edge].sent_start - return sent_start != 1 and st.H(st.S(0)) != st.B(0) + return st.B_(0).sent_start != 1 and st.H(st.S(0)) != st.B(0) @staticmethod cdef int transition(StateC* st, attr_t label) nogil: