A simple ngram-based random text generator.
Project description
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ngramtg-2019.1.tar.gz.
File metadata
- Download URL: ngramtg-2019.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9bf96d7ae543913dd118b3ccb01b8c3f0cf5919b00ba9576b41591f6d823da5
|
|
| MD5 |
579b5f6d816002f09e5062bce5eea4f2
|
|
| BLAKE2b-256 |
f4f7a94a349a70d3821d6e5fc570456aad754d347263566997539537830052a9
|
File details
Details for the file ngramtg-2019.1-py3-none-any.whl.
File metadata
- Download URL: ngramtg-2019.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e72ce04f0196368df863f63160bc48f4f5eea561f54994222c8cc5f497229e26
|
|
| MD5 |
a3a378307e8f42684a74b8f287a6302c
|
|
| BLAKE2b-256 |
a3d1c84669327c5b384a00e92583245e6543282f85de3393b9bd51d52a5cde33
|