2014-08-01 06:27:21 +00:00
|
|
|
from libc.stdint cimport uint64_t
|
|
|
|
|
2014-08-16 17:59:38 +00:00
|
|
|
from chartree cimport CharTree
|
|
|
|
|
2014-08-01 06:27:21 +00:00
|
|
|
|
|
|
|
cdef class FixedTable:
|
|
|
|
cdef size_t size
|
|
|
|
cdef uint64_t* keys
|
|
|
|
cdef size_t* values
|
|
|
|
|
2014-08-01 06:37:50 +00:00
|
|
|
cdef size_t insert(self, uint64_t key, size_t value) nogil
|
2014-08-01 06:27:21 +00:00
|
|
|
cdef size_t get(self, uint64_t key) nogil
|
|
|
|
cdef int erase(self, uint64_t key) nogil
|
2014-08-16 17:59:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
cdef class WordTree:
|
|
|
|
cdef size_t max_length
|
|
|
|
cdef size_t default
|
|
|
|
cdef CharTree* _trees
|
|
|
|
cdef dict _dict
|
|
|
|
|
|
|
|
cdef size_t get(self, unicode string) except *
|
|
|
|
cdef int set(self, unicode string, size_t value) except *
|
|
|
|
cdef bint contains(self, unicode string) except *
|
|
|
|
|