A computer-generated book produced for NaNoGenMo 2017
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
content
data
fonts
lib
.gitignore
Gemfile
Gemfile.lock
README.md
Rakefile

README.md

Thematic Automata

This is a computer-generated book produced for NaNoGenMo 2017.

Details

Summary

The book is generated using elementary cellular automata with two contrasting elements randomly selected from a set of common literary themes. Each generation of the automaton represents a single chapter, with the individual cells representing sentences and sequences of cells with the same state representing paragraphs. Each paragraph thus flips from one theme to the next, depending on the pattern generated by the automaton.

Sentences are generated using word frequency n-grams chained from a corpus of sentences sourced from public domain fiction on Project Gutenberg. Each theme has a number of registered synonyms which are used to select a subset of potential sentences from the broader corpus. This is fairly brute force and inexact. It relies on the dubious assumption that a matching word in a sentence means that sentence relates to the theme. The diversity or uniformity of the source sentences thus has a massive impact on the quality and coherence of the resulting output.

Source Material

Tools

Install

Use Bundler to install the required gems:

bundle

Or install them manually:

gem install rake calyx png prawn punkt-segmenter

Run

Run the generate task using Rake to output a PDF. By default, it goes into the output directory.

mkdir output
rake generate

License

The MIT License (MIT)

Copyright © 2017 Mark Rickerby https://maetl.net

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.