2014-08-02 20:51:52 +00:00
|
|
|
from libc.stdint cimport uint32_t
|
2014-07-05 18:51:42 +00:00
|
|
|
from libc.stdint cimport uint64_t
|
|
|
|
|
2014-08-20 11:39:39 +00:00
|
|
|
|
2014-07-05 18:51:42 +00:00
|
|
|
ctypedef int ClusterID
|
2014-08-02 20:51:52 +00:00
|
|
|
ctypedef uint32_t StringHash
|
2014-08-20 11:39:39 +00:00
|
|
|
ctypedef size_t LexID
|
|
|
|
ctypedef char OrthFlags
|
|
|
|
ctypedef char DistFlags
|
|
|
|
ctypedef uint64_t TagFlags
|
2014-07-07 14:58:48 +00:00
|
|
|
|
|
|
|
|
2014-07-05 18:51:42 +00:00
|
|
|
cdef struct Lexeme:
|
2014-08-20 11:39:39 +00:00
|
|
|
StringHash lex
|
2014-08-19 02:21:20 +00:00
|
|
|
char* string
|
|
|
|
size_t length
|
2014-08-20 11:39:39 +00:00
|
|
|
double prob
|
|
|
|
ClusterID cluster
|
|
|
|
TagFlags possible_tags
|
|
|
|
DistFlags dist_flags
|
|
|
|
OrthFlags orth_flags
|
|
|
|
StringHash* string_views
|
2014-07-07 18:27:02 +00:00
|
|
|
|
2014-08-19 00:40:37 +00:00
|
|
|
|
2014-08-20 11:39:39 +00:00
|
|
|
cpdef char first_of(LexID lex_id) except 0
|
|
|
|
cpdef size_t length_of(LexID lex_id) except 0
|
|
|
|
cpdef double prob_of(LexID lex_id) except 0
|
|
|
|
cpdef ClusterID cluster_of(LexID lex_id) except 0
|
2014-08-19 00:40:37 +00:00
|
|
|
|
2014-08-20 11:39:39 +00:00
|
|
|
cpdef bint check_tag_flag(LexID lex, TagFlags flag) except *
|
|
|
|
cpdef bint check_dist_flag(LexID lex, DistFlags flag) except *
|
|
|
|
cpdef bint check_orth_flag(LexID lex, OrthFlags flag) except *
|
2014-08-19 00:40:37 +00:00
|
|
|
|
2014-08-20 11:39:39 +00:00
|
|
|
cpdef StringHash view_of(LexID lex_id, size_t view) except 0
|