2014-12-09 10:16:17 +00:00
|
|
|
from cymem.cymem cimport Pool
|
2014-12-19 20:27:28 +00:00
|
|
|
from preshed.maps cimport PreshMapArray
|
2014-12-09 10:16:17 +00:00
|
|
|
|
2014-12-19 20:27:28 +00:00
|
|
|
from .structs cimport TokenC, Lexeme, Morphology, PosTag
|
|
|
|
from .strings cimport StringStore
|
|
|
|
from .typedefs cimport id_t, univ_tag_t
|
2014-12-09 10:16:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
cdef class Morphologizer:
|
|
|
|
cdef Pool mem
|
|
|
|
cdef StringStore strings
|
|
|
|
cdef object lemmatizer
|
|
|
|
cdef PosTag* tags
|
2014-12-09 14:02:04 +00:00
|
|
|
cdef readonly list tag_names
|
2014-12-09 10:16:17 +00:00
|
|
|
|
2014-12-09 14:02:04 +00:00
|
|
|
cdef PreshMapArray _cache
|
2014-12-09 10:16:17 +00:00
|
|
|
cdef int lemmatize(self, const univ_tag_t pos, const Lexeme* lex) except -1
|
|
|
|
cdef int set_morph(self, const int i, TokenC* tokens) except -1
|