mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 18:36:36 +03:00
e2b70df012
* Use isort with Black profile * isort all the things * Fix import cycles as a result of import sorting * Add DOCBIN_ALL_ATTRS type definition * Add isort to requirements * Remove isort from build dependencies check * Typo
24 lines
808 B
Cython
24 lines
808 B
Cython
cimport numpy as np
|
|
from cymem.cymem cimport Pool
|
|
from libc.stdint cimport uint64_t
|
|
from preshed.maps cimport PreshMap
|
|
|
|
from .strings cimport StringStore
|
|
from .structs cimport MorphAnalysisC
|
|
from .typedefs cimport attr_t, hash_t
|
|
|
|
|
|
cdef class Morphology:
|
|
cdef readonly Pool mem
|
|
cdef readonly StringStore strings
|
|
cdef PreshMap tags # Keyed by hash, value is pointer to tag
|
|
|
|
cdef MorphAnalysisC create_morph_tag(self, field_feature_pairs) except *
|
|
cdef int insert(self, MorphAnalysisC tag) except -1
|
|
|
|
|
|
cdef int check_feature(const MorphAnalysisC* morph, attr_t feature) nogil
|
|
cdef list list_features(const MorphAnalysisC* morph)
|
|
cdef np.ndarray get_by_field(const MorphAnalysisC* morph, attr_t field)
|
|
cdef int get_n_by_field(attr_t* results, const MorphAnalysisC* morph, attr_t field) nogil
|