Ngram TextGen
A simple n-gram-based random text generator written in Python.
Requirements and Installation
Requirements
This module requires Python 3.6+ due to the use of f-strings.
Installation
pip install ngramtg
Usage
Create a simple script, e.g.
from ngramtg.ngram import NgramTextGen
import sys
if __name__ == "__main__":
my_object = NgramTextGen(sys.argv[1], auto=True)
print(my_object.sentence())
Save it (e.g. myscript.py) and provide a corpus file to it:
$ python myscript.py corpus.txt
Compassion will make you.
Release History
- 2019.01
- Initial release
Development and License
Developed by Paul Wicking – @DocWicking.
Distributed under the MIT license. See LICENSE for more information.
The source code lives on GitHub.
Release files for ngramtg 2019.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ngramtg-2019.1.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ngramtg-2019.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / ngramtg-2019.1.tar.gz
| Download URL | ngramtg-2019.1.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9bf96d7ae543913dd118b3ccb01b8c3f0cf5919b00ba9576b41591f6d823da5
|
|
BLAKE2b-256 checksum How to use checksums |
f4f7a94a349a70d3821d6e5fc570456aad754d347263566997539537830052a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1
|
Release files / ngramtg-2019.1-py3-none-any.whl
| Download URL | ngramtg-2019.1-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e72ce04f0196368df863f63160bc48f4f5eea561f54994222c8cc5f497229e26
|
|
BLAKE2b-256 checksum How to use checksums |
a3d1c84669327c5b384a00e92583245e6543282f85de3393b9bd51d52a5cde33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1
|