Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anne of Green Garbles #118

cpressey opened this issue Nov 26, 2019 · 2 comments

Anne of Green Garbles #118

cpressey opened this issue Nov 26, 2019 · 2 comments


Copy link

@cpressey cpressey commented Nov 26, 2019

馃櫄 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

鈥淲ell 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. 鈥淚 was born to the rest and good girl.鈥 said. Once, with a boy at him on Anne鈥檚 eager-looking, hunting out into the way鈥攖heir brown beard which, one of the tears and then to studying it, 鈥淵es,鈥 protested Anne walked home through the self-haired Shirley at least. 鈥淭his 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

Copy link

@greg-kennedy greg-kennedy commented Nov 30, 2019

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.

Copy link

@serin-delaunay serin-delaunay commented Dec 2, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

4 participants