General Purpose Trie Data Structure in Python
Project description
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.
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
pythontrie-0.3.tar.gz
(6.7 kB
view details)
Built Distribution
File details
Details for the file pythontrie-0.3.tar.gz
.
File metadata
- Download URL: pythontrie-0.3.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc1424b35176e2e25a120c4d38dc047e2b6317d41d94031e9ce78f0ad50ce8bc |
|
MD5 | d91c17482a1e831bbe35d0fd7bb248f5 |
|
BLAKE2b-256 | 11e97c315b247d975044b776b9a6ec54cb3d5fafbdf424a2cb085692595fa38e |
File details
Details for the file pythontrie-0.3-py3-none-any.whl
.
File metadata
- Download URL: pythontrie-0.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a31f3500b8da6a0476be3624f562999d873e68e321d859c9ce32f27ddbc0b154 |
|
MD5 | a2166c7c6d3e664788ed499eafdc4562 |
|
BLAKE2b-256 | f597499d6232303b568812035d2acb891e3c33f9cf09e972ec924d3a11ca0328 |