Discover
/
Article

The computation of poetry

NOV 02, 2012
Could a computer be programmed to write Welsh poetry in English? And if so, could a reader tell the difference?

DOI: 10.1063/PT.5.010198

18779/pt5010198_lastword_06_fig11.jpg

My nadir as a programmer happened in grad school. I’d written a Fortran program to calculate the column density of a stellar atmosphere—at least, that’s what the program was supposed to do, but it had a bug. Fortunately, the VAX I was using had a chatty, helpful compiler that told me where the bug was and what was wrong—sort of.

The trouble was that even when I printed the code and stared at the recalcitrant line, the bug remained hidden. In the end, I finally saw my error: I’d spelled “GOTO” with two zeros instead of two Os. The characters are next to each other on the keyboard, and when printed, they looked almost identical. The error was trivial—even funny—but it soured my view of programming forever. Now, as a writer and editor, I reassure myself that writing is so much more forgiving than coding. If a word doesn’t fit, I can pick another. English is much more flexible than Fortran.

But one form of literary endeavor, poetry, shares some properties with programming. “Predict” has several synonyms, for example—including foretell, prophesy, forecast—Shakespeare picked “prognosticate” for his 14th sonnet:

Or else of thee this I prognosticate:

Thy end is truth’s and beauty’s doom and date.

Unlike the alternatives, “prognosticate” fits the rhyme and meter. It also echoes a four-syllable word that appears near the beginning of the poem (“astronomy”).

The English sonnet is nicely balanced between form and function. Its 14 lines, typically in iambic pentameter, can have any one of several rhyme schemes with strictures light enough to inspire poets to artful, not forced, contrivances.

But some poetic forms in other languages are difficult to follow in English, the top of my list being cynghanedd. This centuries-old Welsh form stipulates the order in which consonants should appear within lines. Gerard Manley Hopkins, an English poet who learned Welsh, wrote cynghanedd-like lines, but not in full accordance to the rules.

Which makes me wonder: Could a computer be programmed to write cynghanedd in English (or German, for that matter)? What would such a feat mean? If a reader couldn’t tell the difference—that is, if our computer bard passed a Turing test—would it matter?

And then there’s the authorship. Whoever programmed the poetry generator must know and appreciate the rules and subtleties of cynghanedd, so whatever art and skill a computer cynghanedd might show lies as much in the program as in the poem itself. Freed by the power of computation, you could conceivably invent poetic forms so complex that only a computer could write in them.

These speculations aren’t wholly whimsical. Just as a particular poetic form might stipulate rhyme scheme, meter, length of lines, length of poem, and, yes, the pattern of consonants, so, too, might an accurate, complete model of human consciousness. What would it mean if only a computer could follow those rules?

Cynghanedd example

One form of cynghanedd requires repeating the order of consonants in the first and second halves of a line, as in this example from Tudur Aled (c. 1465–1525):

Os marw bun, oes mwy o’r byd? Mae’r haf wedi marw hefyd.
If the girl dies, what’s left in the world? Summer has died as well.

Some leeway is allowed for rhyming.

This essay by Charles Day first appeared on page 96 of the November/December 2007 issue of Computing in Science & Engineering , a bimonthly magazine published jointly by the American Institute of Physics and IEEE Computer Society.

Related content
/
Article
The scientific enterprise is under attack. Being a physicist means speaking out for it.
/
Article
Clogging can take place whenever a suspension of discrete objects flows through a confined space.
/
Article
A listing of newly published books spanning several genres of the physical sciences.
/
Article
Unusual Arctic fire activity in 2019–21 was driven by, among other factors, earlier snowmelt and varying atmospheric conditions brought about by rising temperatures.

Get PT in your inbox

Physics Today - The Week in Physics

The Week in Physics" is likely a reference to the regular updates or summaries of new physics research, such as those found in publications like Physics Today from AIP Publishing or on news aggregators like Phys.org.

Physics Today - Table of Contents
Physics Today - Whitepapers & Webinars
By signing up you agree to allow AIP to send you email newsletters. You further agree to our privacy policy and terms of service.