You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can view examples at [examples directory](./examples).
174
174
175
+
### Prefix Tree (Trie)
176
+
Prefix Tree data structure (this structure also used in pyechonext routing system)
177
+
178
+
```python
179
+
from pyechonext.utils.trie import PrefixTree
180
+
181
+
if__name__=='__main__':
182
+
trie = PrefixTree()
183
+
trie.insert('apple')
184
+
trie.insert('app')
185
+
trie.insert('aposematic')
186
+
trie.insert('appreciate')
187
+
trie.insert('book')
188
+
trie.insert('bad')
189
+
trie.insert('bear')
190
+
trie.insert('bat')
191
+
print(trie.starts_with('app'))
192
+
193
+
router_tree = PrefixTree()
194
+
router_tree.insert('index')
195
+
router_tree.insert('users')
196
+
router_tree.insert('transactions')
197
+
router_tree.insert('wallets')
198
+
router_tree.insert('wallets/create')
199
+
200
+
print(router_tree.starts_with('wa'))
201
+
202
+
```
203
+
175
204
### i18n with hermes-langlib
176
205
Hermes LangLib - a fast and light python library for translating, localizing and internationalizing your applications. The library is aimed at high speed and stability; it can be used in highly loaded projects.
0 commit comments