spaCy/spacy/word.pxd

26 lines
698 B
Cython
Raw Normal View History

2014-08-25 18:42:22 +04:00
from .typedefs cimport hash_t, utf8_t, flag_t, id_t
2014-08-24 20:14:08 +04:00
2014-08-25 18:42:22 +04:00
DEF MAX_FLAG = 64
2014-08-24 20:14:08 +04:00
2014-08-25 18:42:22 +04:00
cdef class Lexeme:
2014-08-24 20:14:08 +04:00
# NB: the readonly keyword refers to _Python_ access. The attributes are
# writeable from Cython.
2014-08-25 18:42:22 +04:00
cdef readonly id_t id
2014-08-24 20:14:08 +04:00
cdef readonly size_t length
cdef readonly double prob
2014-08-25 18:42:22 +04:00
cdef readonly size_t cluster
2014-08-25 18:42:22 +04:00
cdef readonly utf8_t* strings
cdef readonly size_t nr_strings
2014-08-24 20:14:08 +04:00
2014-08-25 18:42:22 +04:00
cdef readonly flag_t flags
2014-08-24 20:14:08 +04:00
2014-08-25 18:42:22 +04:00
cpdef bint check_flag(self, size_t flag_id) except *
cpdef int set_flag(self, size_t flag_id) except -1
cpdef unicode get_string(self, size_t i) except *
cpdef id_t get_id(self, size_t i) except 0
cpdef int add_strings(self, list strings) except -1