poet is a command line tool that analyzes plain text files containing english language writing and uses the text to randomly generate poetry using Markov Chains.
poet -f book.txt poem
: generates a poem (a haiku by default) using the words in book.txt.
poet -f book.txt info
: prints the Gunning-Fog Index of book.txt (a readability metric).
poet -f book.txt count
: counts the number of occurrences of each word in book.txt and displays them in descending order of count.
poet -f book.txt count -t c
: counts the number of occurrences of each character in book.txt and displays them in descending order of count.
poet -f book.txt count -e the
: counts the number of occurrences of the word "the" in book.txt and displays the total count.
poet -f book.txt match e
: counts the number of occurrences of the character "e" in each word in book.txt and displays them in descending order of count.
Download the source code and run pip3 install .
from within the folder containing the source code. This will install poet and its dependencies.
- Add code/options for rhyming
- Fail gracefully when nothing is piped into poet