NaNoGenMo / 2019

National Novel Generation Month, 2019 edition.
97 stars 5 forks source link

Anne of Green Garbles #118

Open cpressey opened 4 years ago

cpressey commented 4 years ago

🙚 Anne of Green Garbles 🙘

Q: What do you get when you cross a Markov chain with a regular grammar?
A: You get a Markov chain that observes the rules of the regular grammar.

Specifically, if the Markov chain in question is based on the words and punctuation in Lucy Maud Montgomery's Anne of Green Gables, and the regular grammar in question describes some basic rules of punctuation in English writing, you get... well, you get paragraphs like

“Well now that was overcome it much, of it was redder,” said Miss Barry kept the rake and starry eyes at the lane, the dismissal of being a middle of June evening at once in from being something to nobody either question. “I was born to the rest and good girl.” said. Once, with a boy at him on Anne’s eager-looking, hunting out into the way—their brown beard which, one of the tears and then to studying it, “Yes,” protested Anne walked home through the self-haired Shirley at least. “This is the worst.”

The full novel (approx. 54,638 words) can be found here.
The code (in Python 3.6) that generated the novel can be found here.
An extensive write-up on the generator (approx. 2,263 words and 2 nifty diagrams) can be found here.

Satellite-of: #11

greg-kennedy commented 4 years ago

Really impressed with this one, as I first saw it in your other issue... Not only does it neatly solve the typical Markov problem of hanging-parentheses, but I thought it was really amazing how it also captures the different styles of dialogue and parenthetical writing.

serin-delaunay commented 4 years ago

Oh wow, looks like we independently chose very similar ways to punctuate our story words! Could be interesting to compare methods :)