I think this fixes the segfault

This commit is contained in:
Matthew Honnibal 2017-03-11 06:58:34 -06:00
parent 318b9e32ff
commit d59c6926c1
1 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,9 @@ cdef cppclass StateC:
this._ents[i].end = -1 this._ents[i].end = -1
this._sent[i].l_edge = i this._sent[i].l_edge = i
this._sent[i].r_edge = i this._sent[i].r_edge = i
for i in range(length, length + (PADDING * 2)): for i in range(PADDING):
this._sent[i].lex = &EMPTY_LEXEME
for i in range(length, PADDING):
this._sent[i].lex = &EMPTY_LEXEME this._sent[i].lex = &EMPTY_LEXEME
this._sent += PADDING this._sent += PADDING
this._ents += PADDING this._ents += PADDING
@ -59,8 +61,6 @@ cdef cppclass StateC:
for i in range(length): for i in range(length):
this._sent[i] = sent[i] this._sent[i] = sent[i]
this._buffer[i] = i this._buffer[i] = i
for i in range(length, length + 5):
this._sent[i].lex = &EMPTY_LEXEME
__dealloc__(): __dealloc__():
cdef int PADDING = 5 cdef int PADDING = 5