Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

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


This module requires Python 3.6+ due to the use of f-strings.


pip install ngramtg


Create a simple script, e.g.

from ngramtg.ngram import NgramTextGen
import sys

if __name__ == "__main__":
    my_object = NgramTextGen(sys.argv[1], auto=True)

Save it (e.g. and provide a corpus file to it:

$ python 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ngramtg, version 2019.1
Filename, size File type Python version Upload date Hashes
Filename, size ngramtg-2019.1-py3-none-any.whl (7.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size ngramtg-2019.1.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page