6 ms·
Anyone who finds this interesting might enjoy playing around with the meter analysis feature of my side project poetry text editor: https://versepad.com https:/
by jacobevelyn 7y ago
Anyone who finds this interesting might enjoy playing around with the meter analysis feature of my side project poetry text editor: https://versepad.com https://versepad.com
(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.
- klenwell 7y agoPretty cool. Evergreen workshop debates about stress and meter were one of the things that drew me back to programming while I was pursuing my MFA years ago. Care to share what dataset you're using to identify meter? 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.
- jacobevelyn 7y agoThanks for the feedback! I really appreciate your input. 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 http://www.speech.cs.cmu.edu/cgi-bin/cmudict
- klenwell 7y agoYes, that was the error. 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!"
- jacobevelyn 7y agoAgreed! And thanks for the tip—a UI spinner of some sort would definitely be helpful.
- pjungwir 7y agoHey this is cool! I tried Shakespeare's Sonnet 29 and it thinks only half the lines have the correct meter---which partly goes to show how flexible real poems can be but also could highlight places your tool could be refined. I think line 1 ends in a spondee. Also in sonnets starting a line with trochee-iamb is so common you might want to accept that as metrical too. Does it use punctuation as hints? In line 6 the comma at "Featured like him," seems important to the rythym. 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! ;-)
- jacobevelyn 7y agoWow, your search engine project sounds really neat! What a cool idea. 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!
- pjungwir 7y agoI was an English major in college, so maybe I'm taking some background for granted here: no one expected that good poetry had 5x14 da-DUMs without relief. (Certainly you wouldn't want to force Shakespeare to sound that way when you read it aloud.) But the most common variations were well-known and tended to feel right, letting the poet vary things enough to avoid sing-songiness but still not stand out as wrong. So a trochee in the first foot is very common. Same with a spondee in the last foot. Other feet can flip to become trochees too, but people have pointed out that it is more common in some feet than others. For example (IIRC but it's been a long time) I don't think the fourth foot flips very often, because it's hard to make it not sound bad. But those changes are "allowed" and so "it's still iambic pentameter." So it'd be cool if your algorithms could acknowledge those deviations, e.g. maybe give the line a purple-and-white shading instead of just white, or an asterisk. 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-pentameter-the-principles-of-metrical-variation-part-1-feminine-endings-simple-variations/ https://versemeter.wordpress.com/2016/09/20/iambic-pentamete...
- johnisgood 7y agoThank you for this, it looks great! I cannot wait for the improvements! :) 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!
- jacobevelyn 7y agoHey, thanks for the kind words. I hadn't really planned to share this project today, which is why there's no mention of privacy on the site. 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 https://usefathom.com [2]: https://www.bugsnag.com https://www.bugsnag.com [3]: https://www.appzi.com https://www.appzi.com
- johnisgood 7y agoThank you for the answer! Yes, it was helpful. :) Keep up the good work and thank you again for sharing!
- abecedarius 7y agoWow, this is great! I wanted to make an assistant like this out of my own meter/rhyme code, but was too lazy. (Said code is at https://github.com/darius/languagetoys https://github.com/darius/languagetoys if anyone wants some hacky old open source. The biggest lacuna is that it gives up on unknown words.)
- tekkk 7y agoHah cool that so many people have been working on this. I had the same "original" idea and put some hours during the summer into my implementation of an editor to help me write metered poetry. But anyway, it's a damn huge job to code the actual logic to calculate the meters robustly so I never feel like working on it.
- jacobevelyn 7y agoWow, haha very cool that we're all trying to scratch the same itch!
- jfk13 7y agoPretty cool, though when I tried pasting in a Shakespeare sonnet, it didn't think he'd done a very good job. ;) Also, I was sad that "Limerick" wasn't among the forms it knows.
- jacobevelyn 7y agoThanks for checking it out! Limericks are actually a surprisingly ill-defined form, but I'll be adding what I consider an "80% correct" limerick feature soonish. And yeah, I mentioned Shakespeare in this other thread: https://news.ycombinator.com/item?id=21093024 https://news.ycombinator.com/item?id=21093024 Who'da thought that analyzing art objectively would be hard?