aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/marisa-trie/keyset.pxd
blob: 1fb99a40c55860be80fefb61080bcd98f74453f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cimport key

cdef extern from "<marisa/keyset.h>" namespace "marisa" nogil:
    cdef cppclass Keyset:

#        cdef enum constants:
#            BASE_BLOCK_SIZE  = 4096
#            EXTRA_BLOCK_SIZE = 1024
#            KEY_BLOCK_SIZE   = 256

        Keyset()

        void push_back(key.Key &key)
        void push_back(key.Key &key, char end_marker)

        void push_back(char *str)
        void push_back(char *ptr, int length)
        void push_back(char *ptr, int length, float weight)

        key.Key &operator[](int i)

        int num_keys()
        bint empty()

        int size()
        int total_length()

        void reset()
        void clear()
        void swap(Keyset &rhs)