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 Sonnet 130 begins:
My mistress’ eyes are nothing like the sun;
Coral is far more red than her lips’ red;
If snow be white, why then her breasts are dun;
If hairs be wires, black wires grow on her head.
The second line is not strict iambic pentameter, because you cannot say "co-RAL", only "CO-ral". But Shakespeare wrote it anyway because it sounded better that way. Stressing the first beat instead of the second in that manner is called "inversion" or "substitution".
@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?
@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.