dariusk / NaNoGenMo-2015

National Novel Generation Month, 2015 edition.
340 stars 21 forks source link

Expand-filter: a novel-length expansion of a sentence #66

Open enkiv2 opened 8 years ago

enkiv2 commented 8 years ago

Filter source: https://github.com/enkiv2/NaNoGenMo-2015/blob/master/expand-filter.py

Main program: https://github.com/enkiv2/NaNoGenMo-2015/blob/master/expand-filter.sh

Finished novel (expanded from "The spirit is willing but the flesh is weak"): https://github.com/enkiv2/NaNoGenMo-2015/blob/master/expanded.md

This filter expands text piped into it by looking up each word on wordnik and replacing it with a randomly chosen definition. Definitions are memoized and stored (along with wordnik authentication info and a list of words with no wordnik definitions) in a pickle file, to minimize api accesses. The expand-filter.sh script takes input from stdin and, upon stdin being closed, runs that text through many iterations of expand-filter.py until the result is more than 50k words.

ikarth commented 8 years ago

I'm reminded of Gnostic letter expansion, as described in Irenaeus's Adversus haereses (Book 1, Chapter 14):

He also maintains that the letter itself, the sound of which followed that sound below, was received up again by the syllable to which it belonged, in order to the completion of the whole, but that the sound remained below as if cast outside. But the element itself from which the letter with its special pronunciation descended to that below, he affirms to consist of thirty letters, while each of these letters, again, contains other letters in itself, by means of which the name of the letter is expressed. And thus, again, others are named by other letters, and others still by others, so that the multitude of letters swells out into infinitude. You may more clearly understand what I mean by the following example:— The word Delta contains five letters, viz., D, E, L, T, A: these letters again, are written by other letters, and others still by others.

greg-kennedy commented 8 years ago

Similar as well to NaNoGenMo-2014 entry "The Definition Book" by @samcoppini https://github.com/dariusk/NaNoGenMo-2014/issues/48

enkiv2 commented 8 years ago

I knew the idea seemed familiar :D

On Sat, Nov 7, 2015 at 10:59 PM Greg Kennedy notifications@github.com wrote:

Similar as well to NaNoGenMo-2014 entry "The Definition Book" by @samcoppini https://github.com/samcoppini dariusk/NaNoGenMo-2014#48 https://github.com/dariusk/NaNoGenMo-2014/issues/48

— Reply to this email directly or view it on GitHub https://github.com/dariusk/NaNoGenMo-2015/issues/66#issuecomment-154774391 .