Fast, pure C trie
Project description
Pyctrie
===================
Fast, pure C [Trie](http://en.wikipedia.org/wiki/Trie) dictionary
Features:
===================
* Very fast. Same performance characteristics with Python's **dict**.
* Supports fast **suffix**, **prefix**, **correction** (spell) operations.
* Supports Python 2.6 <= x <= 3.4
Example:
===================
It is just like a dict:
```python
import triez
tr = triez.Trie()
tr[u"foo"] = 1
del trie[u"foo"]
```
But with extra features:
```python
tr[u"foo"] = 1
tr.corrections(u"fo")
{'foo'}
tr[u"foobar"] = 1
tr.prefixes(u"foobar")
{'foo', 'foobar'}
tr.suffixes(u"foo")
{'foo', 'foobar'}
```
Generator support:
```python
tr[u"foo"] = 1
tr[u"foobar"] = 1
for x in tr.iter_suffixes(u"foo"):
print(x)
foo
foobar
```
License
===================
MIT
===================
Fast, pure C [Trie](http://en.wikipedia.org/wiki/Trie) dictionary
Features:
===================
* Very fast. Same performance characteristics with Python's **dict**.
* Supports fast **suffix**, **prefix**, **correction** (spell) operations.
* Supports Python 2.6 <= x <= 3.4
Example:
===================
It is just like a dict:
```python
import triez
tr = triez.Trie()
tr[u"foo"] = 1
del trie[u"foo"]
```
But with extra features:
```python
tr[u"foo"] = 1
tr.corrections(u"fo")
{'foo'}
tr[u"foobar"] = 1
tr.prefixes(u"foobar")
{'foo', 'foobar'}
tr.suffixes(u"foo")
{'foo', 'foobar'}
```
Generator support:
```python
tr[u"foo"] = 1
tr[u"foobar"] = 1
for x in tr.iter_suffixes(u"foo"):
print(x)
foo
foobar
```
License
===================
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyctrie-0.1.tar.gz
(13.5 kB
view details)
File details
Details for the file pyctrie-0.1.tar.gz.
File metadata
- Download URL: pyctrie-0.1.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a3f7d9801dbf4c9e74084b513edc7f4439d75daee1f304b9bd469d7da2cc0da
|
|
| MD5 |
a7418137b2c637008be0bf63891e1fe3
|
|
| BLAKE2b-256 |
a137d733c147323bf4a10057db17f1a73906c05010155b04171c6d0132edc088
|