spaCy/spacy/training/alignment_array.pxd
Daniël de Kok c90dd6f265
Alignment: use a simplified ragged type for performance (#10319)
* Alignment: use a simplified ragged type for performance

This introduces the AlignmentArray type, which is a simplified version
of Ragged that performs better on the simple(r) indexing performed for
alignment.

* AlignmentArray: raise an error when using unsupported index

* AlignmentArray: move error messages to Errors

* AlignmentArray: remove simlified ... with simplifications

* AlignmentArray: fix typo that broke a[n:n] indexing
2022-04-01 09:02:06 +02:00

8 lines
170 B
Cython

from libcpp.vector cimport vector
cimport numpy as np
cdef class AlignmentArray:
cdef np.ndarray _data
cdef np.ndarray _lengths
cdef np.ndarray _starts_ends