2014-09-10 22:41:37 +04:00
|
|
|
from .typedefs cimport hash_t, utf8_t, flag_t, id_t
|
2014-09-18 01:09:24 +04:00
|
|
|
from cymem.cymem cimport Pool
|
2014-09-10 22:41:37 +04:00
|
|
|
|
|
|
|
|
|
|
|
cdef struct LexemeC:
|
2014-10-09 06:50:05 +04:00
|
|
|
size_t i
|
2014-09-10 22:41:37 +04:00
|
|
|
size_t length
|
|
|
|
double prob
|
|
|
|
size_t cluster
|
|
|
|
|
|
|
|
char* string
|
2014-09-15 05:22:40 +04:00
|
|
|
|
2014-09-10 22:41:37 +04:00
|
|
|
char** views
|
|
|
|
flag_t flags
|
|
|
|
|
|
|
|
|
2014-10-09 06:50:05 +04:00
|
|
|
cdef LexemeC* lexeme_init(Pool mem, size_t i, unicode string, double prob, size_t cluster,
|
2014-09-10 22:41:37 +04:00
|
|
|
list views, set flags)
|
|
|
|
|
|
|
|
cdef bint lexeme_check_flag(LexemeC* lexeme, size_t flag_id)
|
|
|
|
cdef unicode lexeme_string_view(LexemeC* lexeme, size_t view_id)
|
2014-10-09 07:10:46 +04:00
|
|
|
|
|
|
|
|
|
|
|
cdef dict lexeme_pack(LexemeC* lexeme)
|
2014-10-09 07:51:35 +04:00
|
|
|
cdef int lexeme_unpack(LexemeC* lexeme, dict p) except -1
|