From 7a5ba20692055a7561e766970998eb384d333a6a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 23 Feb 2018 14:51:24 +0100 Subject: [PATCH] Fix integer typing in _align --- spacy/_align.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/_align.pyx b/spacy/_align.pyx index 4a2e2f29f..8b0c8482f 100644 --- a/spacy/_align.pyx +++ b/spacy/_align.pyx @@ -83,6 +83,7 @@ i.e. D[i,j+1] + 1 ''' from __future__ import unicode_literals +from libc.stdint cimport uint32_t import numpy cimport numpy as np from .compat import unicode_ @@ -107,8 +108,8 @@ def align(S, T): def _convert_sequence(seq): if isinstance(seq, numpy.ndarray): - return numpy.ascontiguousarray(seq, dtype='i') - cdef np.ndarray output = numpy.zeros((len(seq),), dtype='i') + return numpy.ascontiguousarray(seq, dtype='uint32_t') + cdef np.ndarray output = numpy.zeros((len(seq),), dtype='uint32_t') cdef bytes item_bytes for i, item in enumerate(seq): if isinstance(item, unicode):