mirror of https://github.com/explosion/spaCy.git
* Automatically push when the stack is empty
This commit is contained in:
parent
61142a8eff
commit
7e0c692daf
|
@ -22,6 +22,8 @@ cdef int pop_stack(State *s) except -1:
|
||||||
assert s.stack_len >= 1
|
assert s.stack_len >= 1
|
||||||
s.stack_len -= 1
|
s.stack_len -= 1
|
||||||
s.stack -= 1
|
s.stack -= 1
|
||||||
|
if s.stack_len == 0 and not at_eol(s):
|
||||||
|
push_stack(s)
|
||||||
|
|
||||||
|
|
||||||
cdef int push_stack(State *s) except -1:
|
cdef int push_stack(State *s) except -1:
|
||||||
|
@ -117,4 +119,5 @@ cdef State* init_state(Pool mem, TokenC* sent, const int sent_length) except NUL
|
||||||
s.stack_len = 0
|
s.stack_len = 0
|
||||||
s.i = 0
|
s.i = 0
|
||||||
s.sent_len = sent_length
|
s.sent_len = sent_length
|
||||||
|
push_stack(s)
|
||||||
return s
|
return s
|
||||||
|
|
Loading…
Reference in New Issue