mirror of
https://github.com/explosion/spaCy.git
synced 2025-05-28 17:53:19 +03:00
* Make optimization to children_in_buffer: stop searching when we would cross a bracket.
This commit is contained in:
parent
a513ec500f
commit
6c47b10a6e
|
@ -82,6 +82,8 @@ cdef int children_in_buffer(const State *s, int head, const int* gold) except -1
|
||||||
for i in range(s.i, s.sent_len):
|
for i in range(s.i, s.sent_len):
|
||||||
if gold[i] == head:
|
if gold[i] == head:
|
||||||
n += 1
|
n += 1
|
||||||
|
elif gold[i] == i or gold[i] < head:
|
||||||
|
break
|
||||||
return n
|
return n
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user