2014-09-10 18:41:37 +00:00
|
|
|
from .typedefs cimport hash_t, utf8_t, flag_t, id_t
|
2014-09-17 21:09:24 +00:00
|
|
|
from cymem.cymem cimport Pool
|
2014-09-10 18:41:37 +00:00
|
|
|
|
|
|
|
|
2014-10-09 08:53:30 +00:00
|
|
|
cpdef flag_t OOV_DIST_FLAGS
|
|
|
|
|
|
|
|
|
|
|
|
cpdef enum LexInts:
|
|
|
|
LexInt_i
|
|
|
|
LexInt_length
|
|
|
|
LexInt_cluster
|
|
|
|
LexInt_pos
|
|
|
|
LexInt_supersense
|
|
|
|
LexInt_N
|
|
|
|
|
|
|
|
|
|
|
|
cpdef enum LexFloats:
|
|
|
|
LexFloat_prob
|
|
|
|
LexFloat_sentiment
|
|
|
|
LexFloat_N
|
|
|
|
|
|
|
|
|
|
|
|
cpdef enum LexStrs:
|
|
|
|
LexStr_key
|
|
|
|
LexStr_casefix
|
|
|
|
LexStr_shape
|
|
|
|
LexStr_unsparse
|
|
|
|
LexStr_asciied
|
|
|
|
LexStr_N
|
|
|
|
|
|
|
|
|
|
|
|
cpdef enum LexOrthFlags:
|
|
|
|
LexOrth_alpha
|
|
|
|
LexOrth_ascii
|
|
|
|
LexOrth_digit
|
|
|
|
LexOrth_lower
|
|
|
|
LexOrth_punct
|
|
|
|
LexOrth_space
|
|
|
|
LexOrth_title
|
|
|
|
LexOrth_upper
|
|
|
|
LexOrth_N
|
|
|
|
|
|
|
|
|
|
|
|
cpdef enum LexDistFlags:
|
|
|
|
LexDist_adj
|
|
|
|
LexDist_adp
|
|
|
|
LexDist_adv
|
|
|
|
LexDist_conj
|
|
|
|
LexDist_det
|
|
|
|
LexDist_noun
|
|
|
|
LexDist_num
|
|
|
|
LexDist_pdt
|
|
|
|
LexDist_pos
|
|
|
|
LexDist_pron
|
|
|
|
LexDist_prt
|
|
|
|
LexDist_punct
|
|
|
|
LexDist_verb
|
|
|
|
|
|
|
|
LexDist_lower
|
|
|
|
LexDist_title
|
|
|
|
LexDist_upper
|
|
|
|
|
|
|
|
LexDist_N
|
|
|
|
|
|
|
|
|
2014-09-10 18:41:37 +00:00
|
|
|
cdef struct LexemeC:
|
2014-10-09 08:53:30 +00:00
|
|
|
int[<int>LexInt_N] ints
|
|
|
|
float[<int>LexFloat_N] floats
|
|
|
|
utf8_t[<int>LexStr_N] strings
|
|
|
|
flag_t orth_flags
|
|
|
|
flag_t dist_flags
|
|
|
|
|
2014-10-09 21:11:31 +00:00
|
|
|
cpdef dict get_lexeme_dict(size_t i, unicode string)
|
2014-10-09 08:53:30 +00:00
|
|
|
|
|
|
|
cdef char* intern_and_encode(unicode string, size_t* length) except NULL
|
2014-09-10 18:41:37 +00:00
|
|
|
|
2014-10-09 08:53:30 +00:00
|
|
|
cdef int lexeme_get_int(LexemeC* lexeme, size_t i) except *
|
2014-09-10 18:41:37 +00:00
|
|
|
|
2014-10-09 08:53:30 +00:00
|
|
|
cdef float lexeme_get_float(LexemeC* lexeme, size_t i) except *
|
2014-09-10 18:41:37 +00:00
|
|
|
|
2014-10-09 08:53:30 +00:00
|
|
|
cdef unicode lexeme_get_string(LexemeC* lexeme, size_t i)
|
2014-09-10 18:41:37 +00:00
|
|
|
|
2014-10-09 08:53:30 +00:00
|
|
|
cdef bint lexeme_check_orth_flag(LexemeC* lexeme, size_t flag_id) except *
|
2014-10-09 03:10:46 +00:00
|
|
|
|
2014-10-09 08:53:30 +00:00
|
|
|
cdef bint lexeme_check_dist_flag(LexemeC* lexeme, size_t flag_id) except *
|
2014-10-09 03:10:46 +00:00
|
|
|
|
|
|
|
cdef dict lexeme_pack(LexemeC* lexeme)
|
2014-10-09 03:51:35 +00:00
|
|
|
cdef int lexeme_unpack(LexemeC* lexeme, dict p) except -1
|