• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This file was automatically generated by SWIG (http://www.swig.org).
2# Version 1.3.40
3#
4# Do not make changes to this file unless you know what you are doing--modify
5# the SWIG interface file instead.
6# This file is compatible with both classic and new-style classes.
7
8from sys import version_info
9if version_info >= (2,6,0):
10    def swig_import_helper():
11        from os.path import dirname
12        import imp
13        fp = None
14        try:
15            fp, pathname, description = imp.find_module('_marisa', [dirname(__file__)])
16        except ImportError:
17            import _marisa
18            return _marisa
19        if fp is not None:
20            try:
21                _mod = imp.load_module('_marisa', fp, pathname, description)
22            finally:
23                fp.close()
24            return _mod
25    _marisa = swig_import_helper()
26    del swig_import_helper
27else:
28    import _marisa
29del version_info
30try:
31    _swig_property = property
32except NameError:
33    pass # Python < 2.2 doesn't have 'property'.
34def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
35    if (name == "thisown"): return self.this.own(value)
36    if (name == "this"):
37        if type(value).__name__ == 'SwigPyObject':
38            self.__dict__[name] = value
39            return
40    method = class_type.__swig_setmethods__.get(name,None)
41    if method: return method(self,value)
42    if (not static) or hasattr(self,name):
43        self.__dict__[name] = value
44    else:
45        raise AttributeError("You cannot add attributes to %s" % self)
46
47def _swig_setattr(self,class_type,name,value):
48    return _swig_setattr_nondynamic(self,class_type,name,value,0)
49
50def _swig_getattr(self,class_type,name):
51    if (name == "thisown"): return self.this.own()
52    method = class_type.__swig_getmethods__.get(name,None)
53    if method: return method(self)
54    raise AttributeError(name)
55
56def _swig_repr(self):
57    try: strthis = "proxy of " + self.this.__repr__()
58    except: strthis = ""
59    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
60
61try:
62    _object = object
63    _newclass = 1
64except AttributeError:
65    class _object : pass
66    _newclass = 0
67
68
69OK = _marisa.OK
70STATE_ERROR = _marisa.STATE_ERROR
71NULL_ERROR = _marisa.NULL_ERROR
72BOUND_ERROR = _marisa.BOUND_ERROR
73RANGE_ERROR = _marisa.RANGE_ERROR
74CODE_ERROR = _marisa.CODE_ERROR
75RESET_ERROR = _marisa.RESET_ERROR
76SIZE_ERROR = _marisa.SIZE_ERROR
77MEMORY_ERROR = _marisa.MEMORY_ERROR
78IO_ERROR = _marisa.IO_ERROR
79FORMAT_ERROR = _marisa.FORMAT_ERROR
80MIN_NUM_TRIES = _marisa.MIN_NUM_TRIES
81MAX_NUM_TRIES = _marisa.MAX_NUM_TRIES
82DEFAULT_NUM_TRIES = _marisa.DEFAULT_NUM_TRIES
83HUGE_CACHE = _marisa.HUGE_CACHE
84LARGE_CACHE = _marisa.LARGE_CACHE
85NORMAL_CACHE = _marisa.NORMAL_CACHE
86SMALL_CACHE = _marisa.SMALL_CACHE
87TINY_CACHE = _marisa.TINY_CACHE
88DEFAULT_CACHE = _marisa.DEFAULT_CACHE
89TEXT_TAIL = _marisa.TEXT_TAIL
90BINARY_TAIL = _marisa.BINARY_TAIL
91DEFAULT_TAIL = _marisa.DEFAULT_TAIL
92LABEL_ORDER = _marisa.LABEL_ORDER
93WEIGHT_ORDER = _marisa.WEIGHT_ORDER
94DEFAULT_ORDER = _marisa.DEFAULT_ORDER
95class Key(_object):
96    __swig_setmethods__ = {}
97    __setattr__ = lambda self, name, value: _swig_setattr(self, Key, name, value)
98    __swig_getmethods__ = {}
99    __getattr__ = lambda self, name: _swig_getattr(self, Key, name)
100    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
101    __repr__ = _swig_repr
102    def str(self): return _marisa.Key_str(self)
103    def id(self): return _marisa.Key_id(self)
104    def weight(self): return _marisa.Key_weight(self)
105    __swig_destroy__ = _marisa.delete_Key
106    __del__ = lambda self : None;
107Key_swigregister = _marisa.Key_swigregister
108Key_swigregister(Key)
109
110class Query(_object):
111    __swig_setmethods__ = {}
112    __setattr__ = lambda self, name, value: _swig_setattr(self, Query, name, value)
113    __swig_getmethods__ = {}
114    __getattr__ = lambda self, name: _swig_getattr(self, Query, name)
115    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
116    __repr__ = _swig_repr
117    def str(self): return _marisa.Query_str(self)
118    def id(self): return _marisa.Query_id(self)
119    __swig_destroy__ = _marisa.delete_Query
120    __del__ = lambda self : None;
121Query_swigregister = _marisa.Query_swigregister
122Query_swigregister(Query)
123
124class Keyset(_object):
125    __swig_setmethods__ = {}
126    __setattr__ = lambda self, name, value: _swig_setattr(self, Keyset, name, value)
127    __swig_getmethods__ = {}
128    __getattr__ = lambda self, name: _swig_getattr(self, Keyset, name)
129    __repr__ = _swig_repr
130    def __init__(self):
131        this = _marisa.new_Keyset()
132        try: self.this.append(this)
133        except: self.this = this
134    __swig_destroy__ = _marisa.delete_Keyset
135    __del__ = lambda self : None;
136    def push_back(self, *args): return _marisa.Keyset_push_back(self, *args)
137    def key(self, *args): return _marisa.Keyset_key(self, *args)
138    def key_str(self, *args): return _marisa.Keyset_key_str(self, *args)
139    def key_id(self, *args): return _marisa.Keyset_key_id(self, *args)
140    def num_keys(self): return _marisa.Keyset_num_keys(self)
141    def empty(self): return _marisa.Keyset_empty(self)
142    def size(self): return _marisa.Keyset_size(self)
143    def total_length(self): return _marisa.Keyset_total_length(self)
144    def reset(self): return _marisa.Keyset_reset(self)
145    def clear(self): return _marisa.Keyset_clear(self)
146Keyset_swigregister = _marisa.Keyset_swigregister
147Keyset_swigregister(Keyset)
148
149class Agent(_object):
150    __swig_setmethods__ = {}
151    __setattr__ = lambda self, name, value: _swig_setattr(self, Agent, name, value)
152    __swig_getmethods__ = {}
153    __getattr__ = lambda self, name: _swig_getattr(self, Agent, name)
154    __repr__ = _swig_repr
155    def __init__(self):
156        this = _marisa.new_Agent()
157        try: self.this.append(this)
158        except: self.this = this
159    __swig_destroy__ = _marisa.delete_Agent
160    __del__ = lambda self : None;
161    def set_query(self, *args): return _marisa.Agent_set_query(self, *args)
162    def key(self): return _marisa.Agent_key(self)
163    def query(self): return _marisa.Agent_query(self)
164    def key_str(self): return _marisa.Agent_key_str(self)
165    def key_id(self): return _marisa.Agent_key_id(self)
166    def query_str(self): return _marisa.Agent_query_str(self)
167    def query_id(self): return _marisa.Agent_query_id(self)
168Agent_swigregister = _marisa.Agent_swigregister
169Agent_swigregister(Agent)
170
171class Trie(_object):
172    __swig_setmethods__ = {}
173    __setattr__ = lambda self, name, value: _swig_setattr(self, Trie, name, value)
174    __swig_getmethods__ = {}
175    __getattr__ = lambda self, name: _swig_getattr(self, Trie, name)
176    __repr__ = _swig_repr
177    def __init__(self):
178        this = _marisa.new_Trie()
179        try: self.this.append(this)
180        except: self.this = this
181    __swig_destroy__ = _marisa.delete_Trie
182    __del__ = lambda self : None;
183    def build(self, *args): return _marisa.Trie_build(self, *args)
184    def mmap(self, *args): return _marisa.Trie_mmap(self, *args)
185    def load(self, *args): return _marisa.Trie_load(self, *args)
186    def save(self, *args): return _marisa.Trie_save(self, *args)
187    def common_prefix_search(self, *args): return _marisa.Trie_common_prefix_search(self, *args)
188    def predictive_search(self, *args): return _marisa.Trie_predictive_search(self, *args)
189    def lookup(self, *args): return _marisa.Trie_lookup(self, *args)
190    def reverse_lookup(self, *args): return _marisa.Trie_reverse_lookup(self, *args)
191    def num_tries(self): return _marisa.Trie_num_tries(self)
192    def num_keys(self): return _marisa.Trie_num_keys(self)
193    def num_nodes(self): return _marisa.Trie_num_nodes(self)
194    def tail_mode(self): return _marisa.Trie_tail_mode(self)
195    def node_order(self): return _marisa.Trie_node_order(self)
196    def empty(self): return _marisa.Trie_empty(self)
197    def size(self): return _marisa.Trie_size(self)
198    def total_size(self): return _marisa.Trie_total_size(self)
199    def io_size(self): return _marisa.Trie_io_size(self)
200    def clear(self): return _marisa.Trie_clear(self)
201Trie_swigregister = _marisa.Trie_swigregister
202Trie_swigregister(Trie)
203
204INVALID_KEY_ID = _marisa.INVALID_KEY_ID
205
206
207