mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
* Fix padding on tokens
This commit is contained in:
parent
96b835a3d4
commit
7baef5b7ff
|
@ -49,9 +49,8 @@ cdef class Tokens:
|
||||||
self.lex = self._lex_ptr
|
self.lex = self._lex_ptr
|
||||||
self.idx = self._idx_ptr
|
self.idx = self._idx_ptr
|
||||||
self.pos = self._pos_ptr
|
self.pos = self._pos_ptr
|
||||||
for i in range(PADDING):
|
cdef int i
|
||||||
self.lex[i] = &EMPTY_LEXEME
|
for i in range(size + (PADDING*2)):
|
||||||
for i in range(size, PADDING):
|
|
||||||
self.lex[i] = &EMPTY_LEXEME
|
self.lex[i] = &EMPTY_LEXEME
|
||||||
self.lex += PADDING
|
self.lex += PADDING
|
||||||
self.idx += PADDING
|
self.idx += PADDING
|
||||||
|
@ -85,7 +84,8 @@ cdef class Tokens:
|
||||||
self.lex = self._lex_ptr + PADDING
|
self.lex = self._lex_ptr + PADDING
|
||||||
self.idx = self._idx_ptr + PADDING
|
self.idx = self._idx_ptr + PADDING
|
||||||
self.pos = self._pos_ptr + PADDING
|
self.pos = self._pos_ptr + PADDING
|
||||||
|
for i in range(self.length, self.max_length + PADDING):
|
||||||
|
self.lex[i] = &EMPTY_LEXEME
|
||||||
|
|
||||||
cdef int extend(self, int idx, LexemeC** lexemes, int n) except -1:
|
cdef int extend(self, int idx, LexemeC** lexemes, int n) except -1:
|
||||||
cdef int i
|
cdef int i
|
||||||
|
|
Loading…
Reference in New Issue
Block a user