A system for generating sentences similar to those from the hitchhikers series of books. Based on the emojipasta.club service.
TowelDay uses Markovify to generate a text model from a corpus of text from the Hitchhikers novels by Douglas Adams.
A version of the text with punctuation removed, and one sentence per line is available in the corpus subdirectory of this repository. It was obtained by copying this text into a plain text file, followed by this file and this file.
Sadly, I have only found the first three books in the trilogy. If anyone knows where to find plaintext version of the others, I'll add them to the corpus, and link to them above.
TowelDay exposes two RESTful API endpoints, at http://towel.wasv.me/gen/
and http://towel.wasv.me/gen/s/
respectively.
/gen/<int:num>/<string:corpus>/
produces a block of text of the specified sentence length. If no length is provided, the default length of 2 is used.
/gen/s/<int:char>/<string:corpus>/
produces a sentence of the specified maximum character length. If no length is provided, the default length of 140 is used.