WordTriePy
This is a small Python package that implements a trie filled with words from several languages (English - en, German - de , French - fr, Spanish - es, Portuguese - pt) implemented as nested dictionaries.
Install
pip install wordtriepy
Usage
To find all characters that could follow the partial word "chair" in the English language, use the get_next_chars() method:
from wordtriepy import WordTrie
t = WordTrie()
print(t.get_next_chars("chair"))
# outputs: ['_end', 'b', 'e', '-', 'i', 'l', 'm', 'p', 's', 'w']
The _end token tells us that "chair" itself is a valid word and there are 4 other characters ('b', 'e', '-', 'i', 'l', 'm', 'p', 's', 'w') that could follow the word "chair" in the English language that could form new valid words.
To get a list of words that can be formed by the partial word "salz" in the German language, use the get_next_words() method:
from wordtriepy import WordTrie
t = WordTrie(language="de")
print(t.get_next_words("salz", topn=5))
# outputs: ['salz', 'salze', 'salzt', 'salzen', 'salzes']
This returns the top 5 words after a breadth-first-search in the German word trie.
Metadata
Release files for wordtriepy 0.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 | Provenance | Actions |
|---|---|---|---|---|
| wordtriepy-0.0.3.tar.gz | 6.8 MB | Without provenance | Details for wordtriepy-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wordtriepy-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for wordtriepy-0.0.3-py3-none-any.whl |
Total release size: 14.4 MB
Release files / wordtriepy-0.0.3.tar.gz
| Download URL | wordtriepy-0.0.3.tar.gz |
|---|---|
| Size | 6.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d4ba16a50001a11138fd7c2544ca50d3271ea29dee7a564139265d0999e0261
|
|
BLAKE2b-256 checksum How to use checksums |
5c8fe4ee86290d69c87ebbb355aff6c6f9cb8492d0453bd69202410cd62b909e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.0
|
Release files / wordtriepy-0.0.3-py3-none-any.whl
| Download URL | wordtriepy-0.0.3-py3-none-any.whl |
|---|---|
| Size | 7.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
092768e8e3c439d3a3dc4c18f5825b1bd7afe74ff70b22602fa850cd115f02aa
|
|
BLAKE2b-256 checksum How to use checksums |
11ed8807da40962fe6fc9ed95c2ebbd9651a636e4022f358310f1f99989c15ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.0
|
Security for wordtriepy 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.