spaCy/spacy/morphology.pxd

42 lines
1.4 KiB
Cython
Raw Normal View History

from cymem.cymem cimport Pool
2018-09-24 22:35:59 +00:00
from preshed.maps cimport PreshMap, PreshMapArray
from libc.stdint cimport uint64_t
2018-09-24 21:57:41 +00:00
from murmurhash cimport mrmr
2019-03-07 13:03:07 +00:00
from .structs cimport TokenC, MorphAnalysisC
from .strings cimport StringStore
2018-09-24 21:57:41 +00:00
from .typedefs cimport hash_t, attr_t, flags_t
from .parts_of_speech cimport univ_pos_t
from . cimport symbols
cdef class Morphology:
cdef readonly Pool mem
cdef readonly StringStore strings
2018-09-24 21:57:41 +00:00
cdef PreshMap tags # Keyed by hash, value is pointer to tag
cdef public object lemmatizer
cdef readonly object tag_map
2018-09-24 22:35:59 +00:00
cdef readonly object tag_names
cdef readonly object reverse_index
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
2018-09-25 19:07:08 +00:00
cpdef update(self, hash_t morph, features)
2019-03-07 13:03:07 +00:00
cdef hash_t insert(self, MorphAnalysisC tag) except 0
2018-09-24 21:57:41 +00:00
cdef int assign_untagged(self, TokenC* token) except -1
cdef int assign_tag(self, TokenC* token, tag) except -1
2016-11-04 18:19:09 +00:00
cdef int assign_tag_id(self, TokenC* token, int tag_id) except -1
2018-09-25 13:18:21 +00:00
cdef int _assign_tag_from_exceptions(self, TokenC* token, int tag_id) except -1
2019-03-07 17:33:06 +00:00
cdef int check_feature(const MorphAnalysisC* tag, attr_t feature) nogil
2019-03-07 23:08:35 +00:00
cdef attr_t get_field(const MorphAnalysisC* tag, int field) nogil
cdef list list_features(const MorphAnalysisC* tag)
cdef int attribute_to_field(unicode attribute)
2019-03-07 17:33:06 +00:00
2019-03-07 23:08:35 +00:00
cdef tag_to_json(const MorphAnalysisC* tag)