2015-08-28 00:02:33 +00:00
|
|
|
from cymem.cymem cimport Pool
|
2021-04-26 14:54:23 +00:00
|
|
|
from preshed.maps cimport PreshMap
|
2020-01-23 21:01:54 +00:00
|
|
|
cimport numpy as np
|
2021-04-26 14:54:23 +00:00
|
|
|
from libc.stdint cimport uint64_t
|
2015-08-28 00:02:33 +00:00
|
|
|
|
2021-04-26 14:54:23 +00:00
|
|
|
from .structs cimport MorphAnalysisC
|
2015-08-27 07:16:11 +00:00
|
|
|
from .strings cimport StringStore
|
2021-04-26 14:54:23 +00:00
|
|
|
from .typedefs cimport attr_t, hash_t
|
2015-08-28 00:02:33 +00:00
|
|
|
|
2020-03-02 10:48:10 +00:00
|
|
|
|
2015-08-26 17:17:35 +00:00
|
|
|
cdef class Morphology:
|
2015-08-28 00:02:33 +00:00
|
|
|
cdef readonly Pool mem
|
2015-08-28 01:44:54 +00:00
|
|
|
cdef readonly StringStore strings
|
2018-09-24 21:57:41 +00:00
|
|
|
cdef PreshMap tags # Keyed by hash, value is pointer to tag
|
2020-03-02 10:48:10 +00:00
|
|
|
|
2020-01-23 21:01:54 +00:00
|
|
|
cdef MorphAnalysisC create_morph_tag(self, field_feature_pairs) except *
|
|
|
|
cdef int insert(self, MorphAnalysisC tag) except -1
|
2020-03-02 10:48:10 +00:00
|
|
|
|
2019-03-07 17:33:06 +00:00
|
|
|
|
2020-01-23 21:01:54 +00:00
|
|
|
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
|