* Remove from_struct method from StateClass

This commit is contained in:
Matthew Honnibal 2015-06-10 06:58:27 +02:00
parent 18cc326dc0
commit e9aaecc619
2 changed files with 0 additions and 17 deletions

View File

@ -4,8 +4,6 @@ from cymem.cymem cimport Pool
from ..structs cimport TokenC, Entity
from ._state cimport State
from ..vocab cimport EMPTY_LEXEME
@ -30,8 +28,6 @@ cdef class StateClass:
self._buffer[i] = i
return self
cdef int from_struct(self, const State* state) except -1
cdef int S(self, int i) nogil
cdef int B(self, int i) nogil
@ -90,5 +86,3 @@ cdef class StateClass:
cdef void set_sent_end(self, int i) nogil
cdef void clone(self, StateClass src) nogil

View File

@ -21,17 +21,6 @@ cdef class StateClass:
self._buffer[i] = i
self._empty_token.lex = &EMPTY_LEXEME
cdef int from_struct(self, const State* state) except -1:
self._s_i = state.stack_len
self._b_i = state.i
self._e_i = state.ents_len
memcpy(self._sent, state.sent, sizeof(TokenC) * self.length)
cdef int i
for i in range(state.stack_len):
self._stack[self._s_i - (i+1)] = state.stack[-i]
for i in range(state.ents_len):
self._ents[i] = state.ent[-i]
cdef int S(self, int i) nogil:
if i >= self._s_i:
return -1