From 3709ed9d6d833283e59b1aa7838eebc739e031cc Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 10 Nov 2014 22:14:36 +1100 Subject: [PATCH] * Add curr field to State, to handle entity being built --- spacy/ner/_state.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/ner/_state.pyx b/spacy/ner/_state.pyx index ae1300e2f..edffebf39 100644 --- a/spacy/ner/_state.pyx +++ b/spacy/ner/_state.pyx @@ -8,7 +8,8 @@ cdef int begin_entity(State* s, label) except -1: cdef int end_entity(State* s) except -1: s.curr.end = s.i + 1 - s.curr[s.j] = s.curr + s.ents[s.j] = s.curr + s.j += 1 s.curr.start = 0 s.curr.label = -1 s.curr.end = 0 @@ -16,7 +17,7 @@ cdef int end_entity(State* s) except -1: cdef State* init_state(Pool mem, int sent_length) except NULL: s = mem.alloc(1, sizeof(State)) - s.j = -1 + s.j = 0 s.ents = mem.alloc(sent_length, sizeof(Entity)) for i in range(sent_length): s.ents[i].label = -1