November 30, 2008
Three 1K Story Generators
To follow up on the 1K story generator I posted ten days ago, here is a slightly revised version of that generator and two new ones.
- story1.py – Story generation by elision. This is a slightly modified version of the November 20 “original.” It uses a sequence of (specially written) sentences; all but 5-9 sentences are removed and the remaining text is presented as the story.
- story2.py – Story generation by segments. This chooses a beginning, middle, and end. A sentence is chosen from a pool of beginnings. A middle is generated by joining “He” or “She” to a verb or other middle section and concluding that with “he” or “she.” Then, an ending is chosen from a pool of endings. This was inspired by some of Nanette Wylde’s minimal and clever programs, such as Storyland and about so many things.
- story3.py – Story generation by elision & addition. This, like story1.py, uses a sequence of (specially written) sentences; all but 5-8 sentences are removed. These sentences were written by Beth Cardier. After each of these 5-8 sentences is printed, an “atmospheric” text is, with 50% probability, removed from an unordered pool and printed.
On a Mac or Linux system, you can run one of these, for instance, story2.py, by downloading it to the Desktop, opening a terminal Window, typing “cd Desktop”, and typing “python story2.py”. These run on Windows, too, but you will need to have Python installed, either by having already installed it or by installing it (e.g., version 2.6) yourself