mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix integer typing in _align
This commit is contained in:
parent
875411b875
commit
7a5ba20692
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user