Demystifying Poetic Meter
theparisreview.org
theparisreview.org
(The meter analysis is the most complex part of the codebase, but that doesn't mean it's perfect. If you find a case that it's not handling well, please let me know so I can improve it!)
Fair warning: this project is very rough around the edges. But I'll be releasing some big improvements in the near future.
The rhyme scheme feature is throwing an error in the console. And I initially had some trouble with the Show Meter feature on Firefox but it's working on Chrome. Neat!
When you've polished this up a little and worked out the kinks, I'd recommend sharing it on Show HN.
The console error I'm aware of (assuming the error you're seeing is `newTree should be an object`); it doesn't seem to be actually breaking anything (as far as I can tell?), so I've just been planning to fix it when I release some other improvements over the coming days. Thanks for the tip on Firefox—will take a look and see what's going on there!
And to your question about the meter dataset, it's mostly using the CMU Pronouncing Dictionary: http://www.speech.cs.cmu.edu/cgi-bin/cmudict
I tried it again with Firefox and it worked. It was just slow. Maybe a UI doodad to indicate it's processing.
Thanks for sharing the cmudict. Yes, I think that was the one I downloaded back when I was tinkering in this domain. Discovering the various English language datasets was one of those things that made me say, "Hey, the internet is pretty cool!"
For the ultimate challenge you should see if you can make any sense of Hopkins. :-)
When I was in Classics grad school I started a metrical search engine project. The idea was to give scholars a search box with a regex-like syntax for finding lines in a corpus matching metrical features. For example you could find all the lines in Homer with feminine endings. With Perseus it's easy to get lots of Greek & Latin texts. Then you just have to scan everything, but you can program that. I had an on-paper program to do dactylic hexameter. If anyone else thinks that might be a helpful tool, let me know. (Also if you work for Thesaurus Linguae Graecae and want to hire me to write this thing, I can make availability! ;-)
Thanks for the tips re: Shakespeare and Hopkins. I'll definitely dig in there. One of the tricky things with poets like Shakespeare is that many of his sonnets' lines I personally wouldn't consider to be iambic pentameter. Take the first line of Sonnet 29 for example: if I were reading that without affectation I'd put emphasis on "When" and "men's," while iambic requires that those be unstressed.
I don't know if speech patterns were different enough in Shakespeare's day that it sounded more natural with different stresses than we'd use today, but if I were evaluating that poem blind and didn't know it was Shakespeare I'd give it low marks for requiring a relatively forced inflection. Just my opinion, though!
EDIT: A quick Google turned up this article that has a lot of the patterns I remember: https://versemeter.wordpress.com/2016/09/20/iambic-pentamete...
I'd be interested if anyone has other recommendations?
[0]: https://www.ohioswallow.com/book/All+the+Fun%E2%80%99s+in+Ho...
> but people have pointed out that it is more common in some feet than others
You might enjoy this: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.149...
And the follow-up, a longer examination of iambic pentameter: http://linguistica.sns.it/RdL/9.1/Hanson.pdf
By the way, is the text entered sent to any servers? Not that it matters to me much when it comes to poems, but as someone who cares about privacy, I have to ask. :D
Regardless, this looks awesome and useful!
To answer your question: all of the "computation" is done client-side, but depending on which features you use, the client might ask the server for data at a word level (like "give me all the rhymes of 'trust'" or "how many syllables are in 'privacy'"), so I guess in a sense your text can be sent to the servers, but never in an aggregated way.
Also, as someone who also cares about privacy, I can tell you:
- I don't keep any server logs - The only tracking I do (to get traffic numbers) is self-hosted and uses Fathom[1] (which respects privacy in a variety of ways) - I jump through a fair number of hoops to prevent the other third-party tools (Bugsnag[2] and Appzi[3]) from collecting personally identifiable information
While the details of the above might change at some point (I may eventually add some basic server logging, for example), the spirit will not. I don't want to collect any data that I don't absolutely need.
Hope that's helpful!
[1]: https://usefathom.com [2]: https://www.bugsnag.com [3]: https://www.appzi.com
(Said code is at https://github.com/darius/languagetoys if anyone wants some hacky old open source. The biggest lacuna is that it gives up on unknown words.)
Also, I was sad that "Limerick" wasn't among the forms it knows.
And yeah, I mentioned Shakespeare in this other thread: https://news.ycombinator.com/item?id=21093024
Who'da thought that analyzing art objectively would be hard?
When I had to write some sonnets in pentameter, I had to find some web pages that diagrammed out what the "proper" structure of words was, so I could pick out synonyms that might work...
One other practical impact of this is trying to learn languages like Chinese where a stressed versus unstressed syllable is very often the difference between two completely unrelated words.
You sure can tell a waltz (3/4) from a house track (4/4, usually solid 4 on the floor)
Most words of more than one syllable have one primary stress. (Sometimes longer ones have a second, weaker stress, too.) In words of more than one syllable, the stress more often than not falls on the second syllable, though this is far from universal.
[0] https://en.wikipedia.org/wiki/Initial-stress-derived_noun
The best (short) explanation I can think of is: if you were to read the line like you were saying it in normal, fairly fast speech, which syllables would have ever so slightly more oomph ? For example, the sentence "I want to go to the museum." to me sounds most natural as:
i WANT to GO to the muSEum
then for iambic you just see if that follows a pattern of unstressed/stressed (it doesn't here). An example that is iambic would be: "You'd rather eat than see the show?" you'd RAther EAT than SEE the SHOW
Hope that's more helpful than hurtful! :)For some reason, the fact that "penta" stands for "five" (like the Pentagon!) seems to get lost in a lot of these discussions. They must be teaching poetry these days without explaining the Greek/Latin origin of the terms they use.
Word roots are fascinating. Epics were written in dactylic hexameter. Dactyls mean fingers. You know, as in pterodactyls. They're called pterodactyls because their wings (ptero-) were supported by their long fingers. A dactyl has three syllables, DA-da-da, just like the sections of your fingers.
It’s a distraction from an otherwise interesting piece.
https://news.ycombinator.com/item?id=21085940
It's a less concrete essay about the technical specifics, but it communicates a lot about how poets think about their word choices. (Ignore the confusing title.)