From b166d1d2a241b33404be331dc0529714dc56df80 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 21 Jul 2015 19:59:06 +0200 Subject: [PATCH] * Use encode32 and decode32 --- spacy/serialize/packer.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/serialize/packer.pyx b/spacy/serialize/packer.pyx index f0e376410..717f2e862 100644 --- a/spacy/serialize/packer.pyx +++ b/spacy/serialize/packer.pyx @@ -120,7 +120,7 @@ cdef class Packer: if self.attrs: array = doc.to_array(self.attrs) for i, codec in enumerate(self._codecs): - codec.encode(array[:, i], bits) + codec.encode_int32(array[:, i], bits) return bits def unpack(self, BitArray bits): @@ -133,7 +133,7 @@ cdef class Packer: array = numpy.zeros(shape=(len(doc), len(self._codecs)), dtype=numpy.int32) for i, codec in enumerate(self._codecs): - codec.decode(bits, array[:, i]) + codec.decode_int32(bits, array[:, i]) doc.from_array(self.attrs, array) return doc @@ -142,7 +142,7 @@ cdef class Packer: cdef BitArray bits = BitArray() cdef int32_t length = len(doc) bits.extend(length, 32) - self.orth_codec.encode(orths, bits) + self.orth_codec.encode_int32(orths, bits) for token in doc: bits.append(bool(token.whitespace_)) return bits