Skip to main content

A package to generate text via Markov chain using sample text

Project description

https://travis-ci.org/kwkelly/MarkovText.svg?branch=master

MarkovText is a simple Python library for reandomly generating strings of text based on sample text. A Markov chain text generator uses the frequency of words following the current state to generate plausible sentences that hopefully are passable as human text. For example, given the input text “Hello, how are you today? You look well.” and a seed of “you”, there is a 50% chance that the next word is either “look” or “today”. The current state may consist of more than just a single word.

MarkovText is written in Python, and requires numpy (though this may be changed in the future).

Main Features

  • Simple API to generate single or multiple sentences.

  • Ability to add to the sample corpus at any time.

Future Needs

  • Remove dependency on numpy

  • Create sentences that are related to each other

Installation

The recommended way to install this package is with pip

$ pip install MarkovText

Alternatively you can download and instll it manually (not recommended)

$ git clone https://github.com/kwkelly/MarkovText.git
$ cd MarkovText
$ python setup.py

Project details


Download files

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

Source Distribution

MarkovText-0.1.dev7.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

MarkovText-0.1.dev7-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file MarkovText-0.1.dev7.tar.gz.

File metadata

  • Download URL: MarkovText-0.1.dev7.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for MarkovText-0.1.dev7.tar.gz
Algorithm Hash digest
SHA256 de0b9f055d4f5220ccd117423920a33f19829625905996d542179d2d1410e5f1
MD5 64b8fb51c992dbe664f41b244acfc781
BLAKE2b-256 156d86888fe2cc036f60ffdccff108aeff9906d51f055dec4f35a1c51fba0f2c

See more details on using hashes here.

File details

Details for the file MarkovText-0.1.dev7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for MarkovText-0.1.dev7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 42e4dbf53ef3e8845653a1ed8a5218ab365e71c36d7263bd81ab90a1e03e90c8
MD5 1e469e2d28666ad8b8426ad7a82e1abe
BLAKE2b-256 14c4588d18302c8a09e6b9b970ad028e540a58da330f0bd942fb305a8291f8a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page