top | item 33547729

(no title)

jacobevelyn | 3 years ago

Thanks for the thoughtful feedback and questions! The meter detection algorithm is by far the most complex piece of this code, and you're right that it still sometimes generates unintuitive results. I'm always looking for more examples to add to my test suite to make improvements, so I really appreciate you sharing what you tried.

It tends to behave poorly when there's a word it doesn't recognize (like "doll'd"—I hope to add support for more of these poetic spellings just as I added support for spelling words like "dancing" as "dancin'"), so that might be partly at play with some of what you're seeing. But I think there's also something else going on here—it previously didn't ever generate so many consecutive syllables with the same stress, so I probably introduced a regression at some point. I'll investigate and add more tests for that too!

Lastly, a byproduct of my own background and the corpuses I use is that this does work better with "modern" poetry. For example, Shakespeare's Sonnet 29 starts with this line:

> When, in disgrace with fortune and men’s eyes

In the intended iambic pentameter, it would be:

> when, IN disGRACE with FORtune AND men's EYES

I don't know enough history to know if people ever spoke English like that, but that interpretation is way off to a modern reader. If I didn't know it was supposed to be iambic and was trying to diagram the stresses, I'd do something like:

> WHEN, in disGRACE with FORtune and MEN'S EYES

Meter is hard!

discuss

order

No comments yet.