2015-08-28 00:02:33 +00:00
|
|
|
from cymem.cymem cimport Pool
|
2018-09-24 22:35:59 +00:00
|
|
|
from preshed.maps cimport PreshMap, PreshMapArray
|
2015-08-28 00:02:33 +00:00
|
|
|
from libc.stdint cimport uint64_t
|
2018-09-24 21:57:41 +00:00
|
|
|
from murmurhash cimport mrmr
|
2020-01-23 21:01:54 +00:00
|
|
|
cimport numpy as np
|
2015-08-28 00:02:33 +00:00
|
|
|
|
2019-03-07 13:03:07 +00:00
|
|
|
from .structs cimport TokenC, MorphAnalysisC
|
2015-08-27 07:16:11 +00:00
|
|
|
from .strings cimport StringStore
|
2018-09-24 21:57:41 +00:00
|
|
|
from .typedefs cimport hash_t, attr_t, flags_t
|
2015-08-28 00:02:33 +00:00
|
|
|
from .parts_of_speech cimport univ_pos_t
|
2015-10-10 11:10:58 +00:00
|
|
|
from . cimport symbols
|
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
|
|
|
|
2015-08-27 07:16:11 +00:00
|
|
|
cdef public object lemmatizer
|
2015-10-12 04:27:47 +00:00
|
|
|
cdef readonly object tag_map
|
2018-09-24 22:35:59 +00:00
|
|
|
cdef readonly object tag_names
|
|
|
|
cdef readonly object reverse_index
|
2020-07-16 19:16:49 +00:00
|
|
|
cdef readonly object _exc
|
2018-09-25 08:57:33 +00:00
|
|
|
cdef readonly PreshMapArray _cache
|
2018-09-24 22:35:59 +00:00
|
|
|
cdef readonly int n_tags
|
2015-08-28 00:02:33 +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
|