Skip to main content

Witter - generate random text in the style of the document you provide.

Project description

Witter

What's Witter?

Witter accepts text input, splits it into sections, or "chains", and then works out which character is most likely to follow that "chain" whenever it appears in the source text.

Once it has analyzed the source text, it generates a number of random sample pieces of text based on it.

Because of the way it uses the source text, the text that it produces will be "in the style" of the original text. It may, or may not, make sense.

It's worth noting that this isn't Machine Learning (ML), or any kind of Artificial Intelligence (AI). It's statistics, with some Monte Carlo methods thrown in.

How Do I Use Witter?

Run witter from within a virtual environment using the syntax:

witter --help

or from the command line using:

python -m witter --help

Both of these examples will display the command line options.

A simple example to get you started is:

In Windows or Linux, in a Python virtual environment, the following command will produce samples:

witter filepath.txt

or, if you want to use piping in Linux:

cat filepath.txt | witter

So, if you want to generate text from The Complete Works of William Shakespeare, and why wouldn't you?

wget https://www.gutenberg.org/cache/epub/100/pg100.txt
cat pg100.txt | witter

or if A Christmas Carol by Charles Dickens is more your thing:

wget https://www.gutenberg.org/ebooks/24022.txt.utf-8
cat 24022.txt.utf-8 | witter

You've probably noticed the utf-8 extension on one of the text files. This is a way that Project Gutenberg uses to denote UTF-8-encoded text files. witter can handle UTF-8 with no problems.

Download Statistics

Downloads Downloads Downloads

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

witter-0.0.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

witter-0.0.4-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file witter-0.0.4.tar.gz.

File metadata

  • Download URL: witter-0.0.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-40-generic

File hashes

Hashes for witter-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8357d6310f852d8e29f692c5b8ac16bd325eac642180338da7145584e7f7e890
MD5 941c91c71f3c86da88d0ea578e8c4cef
BLAKE2b-256 3fbb4be65b4d4415da4ecf02e732f684dfae2dd7c94d22f37a32487c318be798

See more details on using hashes here.

File details

Details for the file witter-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: witter-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-40-generic

File hashes

Hashes for witter-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1957addd2bbf628b6a53fe6a9c7835e7ce7825f25c95b0c3b687126a6867f93a
MD5 9cf6a2cab7b11f0c1d77dc922745e522
BLAKE2b-256 e5555b9a539b9df77acc1ec5c221b867eb3c5d76828437d3f2edfb1ea67ef091

See more details on using hashes here.

Supported by

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