aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/marisa-trie/trie.pxd
blob: f525caf8ad6a0e9039141fcb37d4b9acb37cf6d0 (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
31
32
33
34
35
36
37
38
39
40
41
cimport agent
cimport base
cimport keyset


cdef extern from "<marisa/trie.h>" namespace "marisa" nogil:

    cdef cppclass Trie:
        Trie()

        void build(keyset.Keyset &keyset, int config_flags) except +
        void build(keyset.Keyset &keyset) except +

        void mmap(char *filename) except +
        void map(void *ptr, int size) except +

        void load(char *filename) except +
        void read(int fd) except +

        void save(char *filename) except +
        void write(int fd) except +

        bint lookup(agent.Agent &agent) except +
        void reverse_lookup(agent.Agent &agent) except +KeyError
        bint common_prefix_search(agent.Agent &agent) except +
        bint predictive_search(agent.Agent &agent) except +

        int num_tries() except +
        int num_keys() except +
        int num_nodes() except +

        base.TailMode tail_mode()
        base.NodeOrder node_order()

        bint empty() except +
        int size() except +
        int total_size() except +
        int io_size() except +

        void clear() except +
        void swap(Trie &rhs) except +