Eden utilise witches.town. Vous pouvez læ suivre et interagir si vous possédez un compte quelque part dans le "fediverse".

I wrote a program that successfully tells me that the first quatrain in Shakespeare's Sonnet 130 is not in iambic pentameter.

Eden @edensaesthetic

@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 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".

@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?