pythontrie : Python Implementation of Trie Data Structure
pythontrie includes sweet implementation of our favourite data structure trie in python.
Usage:
>>> from pythontrie import trie
>>> sample_trie = trie()
>>> sample_strings = ['heyy', 'heyay', 'heyey', 'hyyy', 'yoyo', 'heeyy', 'hoeyy']
>>> for sample_string in sample_strings:
>>> sample_trie.insert(sample_string)
Then printing suggestions is as simple as:
>>> print(sample_trie.suggestions(prefix='he')
['heyy', heyay', heyey', 'heeyy']
Current Features
- Adding arbitrary strings into trie
- Searching for suggestion using prefix
- Search whether any string is present in trie or not
pythontrie right now supports all python versions
Installation
To install pythontrie, simply use all time favorite pip and type :
$ pip install pythontrie
✨🍰✨
Documentation
Coming Soon.
How to Contribute
- Initial plan is to integrate all necessary functionality that trie can offer into this library so that it can act as one place shot for everyone who is playing with trie.
- Please propose and feel free to raise an issue and submit a PR for some sensible feature. Try to elaborate the the area where this feature would be applicable so that all of us can be enlightened :).
- I am planning to integrate research work done on tries into this library as well so that it can provide advanced functionalities with tight algorithmic complexity bounds. Please feel free to share any paper.
Release files for pythontrie 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pythontrie-0.3.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pythontrie-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:13.8 kB
Release files / pythontrie-0.3.tar.gz
| Download URL | pythontrie-0.3.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc1424b35176e2e25a120c4d38dc047e2b6317d41d94031e9ce78f0ad50ce8bc
|
|
BLAKE2b-256 checksum How to use checksums |
11e97c315b247d975044b776b9a6ec54cb3d5fafbdf424a2cb085692595fa38e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|
Release files / pythontrie-0.3-py3-none-any.whl
| Download URL | pythontrie-0.3-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a31f3500b8da6a0476be3624f562999d873e68e321d859c9ce32f27ddbc0b154
|
|
BLAKE2b-256 checksum How to use checksums |
f597499d6232303b568812035d2acb891e3c33f9cf09e972ec924d3a11ca0328
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|