Skip to content

Commit 44589fb

Browse files
committed
Fix Break oracle
1 parent 6d4e8e1 commit 44589fb

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

spacy/syntax/arc_eager.pyx

+4-8
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,7 @@ cdef class Break:
249249
elif st.stack_depth() < 1:
250250
return False
251251
else:
252-
prev = st.B_(0)-1
253-
if Lexeme.c_check_flag(prev.lex, IS_PUNCT):
254-
return True
255-
elif Lexeme.c_check_flag(prev.lex, IS_SPACE):
256-
return True
257-
else:
258-
return False
252+
return True
259253

260254
@staticmethod
261255
cdef int transition(StateC* st, attr_t label) nogil:
@@ -292,7 +286,7 @@ cdef class Break:
292286
return 0
293287

294288
cdef int _get_root(int word, const GoldParseC* gold) nogil:
295-
while gold.heads[word] != word and not gold.has_dep[word] and word >= 0:
289+
while gold.heads[word] != word and gold.has_dep[word] and word >= 0:
296290
word = gold.heads[word]
297291
if not gold.has_dep[word]:
298292
return -1
@@ -522,9 +516,11 @@ cdef class ArcEager(TransitionSystem):
522516
"before training and after parsing. Either pass make_projective=True "
523517
"to the GoldParse class, or use PseudoProjectivity.preprocess_training_data")
524518
else:
519+
print(gold.orig_annot)
525520
print(gold.words)
526521
print(gold.heads)
527522
print(gold.labels)
523+
print(gold.sent_starts)
528524
raise ValueError(
529525
"Could not find a gold-standard action to supervise the dependency "
530526
"parser.\n"

0 commit comments

Comments
 (0)