mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 13:47:13 +03:00
ae855a4625
* Clean up Morphology imports and definitions * Whitespace formatting
24 lines
808 B
Cython
24 lines
808 B
Cython
from cymem.cymem cimport Pool
|
|
from preshed.maps cimport PreshMap
|
|
cimport numpy as np
|
|
from libc.stdint cimport uint64_t
|
|
|
|
from .structs cimport MorphAnalysisC
|
|
from .strings cimport StringStore
|
|
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
|