mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +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):
|
||||
if gold[i] == head:
|
||||
n += 1
|
||||
elif gold[i] == i or gold[i] < head:
|
||||
break
|
||||
return n
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user