I wrote a program that successfully tells me that the first quatrain in Shakespeare's Sonnet 130 is not in iambic pentameter.
@lambdagrrl Are you going from machine learning and then applying to new cases, or do you have a definition? cos I literally never understood iambic, so I would love
a definition
@edensaesthetic I'm programming in the definition. So a line is in iambic pentameter if it can be said in five iambs, i.e. five pairs of syllables with the stress falling on the second of each pair. I'm using CMU's pronunciation dictionary to look up the possible pronunciations of each word, and then seeing if there's a way to say the line that fits the pattern.
@edensaesthetic My program catches that this isn't strict pentameter, but doesn't yet tell you why. Ideally I'd like it to print out an error message highlighting the offending word, like a compiler would for a programming language. You could then use that as a tool to help write poems or teach people about the rules of meter.
@lambdagrrl That sounds amazing?! Legitimately, that would be really cool as an explanation of different meters and like 'warnings' for partial matches in meter and 'errors' for harsh breaks?