I've been playing with generating poetry using spreadsheet formulae for a year or more.
Coming from a software development background, I have an uncomfortable relationship with the idea of anything automatic. The work that goes into a button you can push to automagically do something, is often complex and subject to variation.
Automating anything to do with the english language implies even more complexity. The language, in a word, is irregular - making it beautiful and a major pain to codify.
Here's how I approached "automatic poetry".
- provide input to the spreadsheet about the structure of a poem.
- provide data that the spreadsheet can use to construct its own poem.
The next, most laborious, step is to collect and curate replacement words that can be "randomly" drawn upon as alternative words to fit into the structure.
In short, I collect hundreds of words, store them in the spreadsheet in columns labeled with the part of speech.
I have several tabs of parts of speech. Nouns, verbs, adjectives, adverbs, pronouns, etc. Each tab, contains many columns. each column representing a wide variety of variations on a particular part of speech. Verbs are particularly numerous, as I found factors like tense, plurality, transitivity, action, and context weigh heavily in producing more pleasing "automatic" poems.
For each part of speech I have two column. The first column is a raw list of all the words I've gathered. The second column draws on the first using a formula that select a random word from that column. I apply a formula to the second column to populate is with 25 random words for each part of speech.
=ARRAY_CONSTRAIN(ARRAYFORMULA(INDEX($BD$2:$BD$1000,RANDBETWEEN(1,COUNTA($BD$2:$BD$1000)),1)), 1, 1)
note: all formulae apply to Google sheets
bringing data into the structure
the last step is to bring the words into the structure of the poem. Here I create formula that draw from the part of speech tabs the randomly curated word.
Finally I aggregate the words into lines so I can cut and paste them into a plain text editor.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LOWER(CONCATENATE(A1," ",B1," ",C1," ",D1," ",E1," ",F1," ",G1," ",H1," ",I1," ",J1))," ,",",")," .",".")," ?","?")
The results are not always pretty and are subject to some pretty dramatic editing before I might consider submitting to a journal. But it is a new and interesting way to start a poem.
Post a Comment