From c79b3129e3fa9d60ce0b4a34691f2bc4601a9f2e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 15 Mar 2017 09:26:53 -0500 Subject: [PATCH] Fix setting of empty lexeme in initial parse state --- spacy/syntax/_state.pxd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/syntax/_state.pxd b/spacy/syntax/_state.pxd index c764e877d..bfe3a6bea 100644 --- a/spacy/syntax/_state.pxd +++ b/spacy/syntax/_state.pxd @@ -42,8 +42,6 @@ cdef cppclass StateC: this._sent[i].r_edge = i 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 += PADDING this._ents += PADDING this._buffer += PADDING @@ -61,6 +59,8 @@ cdef cppclass StateC: for i in range(length): this._sent[i] = sent[i] this._buffer[i] = i + for i in range(length, length+PADDING): + this._sent[i].lex = &EMPTY_LEXEME __dealloc__(): cdef int PADDING = 5