Haiku Machines (posted 4 September 2004)
I've been writing Haiku for the past few years and typing them into my computer, so I have quite a few sitting on my harddrive. I got bored the other day and made a Haiku-Machine-Program that will generate Haiku out of the ones I've written, the way our Haiku machines in class do. You can try it at http://archetype.student.umd.edu/cgi-bin/cyberhaiku.py?
Well aren't you Mr. Initiative...seriously, though--is that your second name?
Posted by: Kelly Naber on September 10, 2004 12:16 PM | Permalink to CommentMatt,
You're one step ahead of me--this is what we're doing tomorrow!
How about a button that lets the user generate a new poem automatically?
Posted by: MGK on September 14, 2004 08:01 PM | Permalink to CommentThe button is added. Next, we're working on a way for people to be able to vote on how much they like the poems. I'll link a description of the idea when I've written it out more.
Posted by: Matt Bowen on September 15, 2004 12:07 AM | Permalink to CommentMatt (B.), you should check out Darwinian Poetry if you haven't already... http://www.codeasart.com/poetry/darwin.html
Posted by: Jess on September 17, 2004 04:28 PM | Permalink to CommentThanks Jess. That's a lot like what we're doing. Infact, that pretty much is what we're trying to do.
Posted by: Matt Bowen on September 20, 2004 02:24 PM | Permalink to Commenthere's the Haiku thing from class:
http://archetype.student.umd.edu/cgi-bin/hotornothaiku.py?
If it acts weird on your computer, let me know.
Posted by: Matt Bowen on September 23, 2004 12:26 AM | Permalink to Commenthttp://grahame.angrygoats.net/lj-haiku/index.py
This is pretty crazy. It takes a blog/live journal feed, counts syllables and calculates word frequencies, then makes Haiku based on the word frequencies and the the syllable count. I sortof understand how it works, but I asked the guy who wrote it for help on a syllable counter because I've always wanted to write one.
Posted by: Matt Bowen on September 23, 2004 07:13 PM | Permalink to CommentThe syllable counter seems to split words into component letters, and then parse it for vowel chunks.
It seems to me that it increments the syllable counter every time it encounters a vowel that is not immediately next to a consonant. For example, "bear" is only one syllable, while "retype" is two. Normally, "beware" would be considered three syllables, but he also has an if statement near the end of the function that searches the word for the last e, and other structures like it, and subtracts one syllable.
It's written in python, which I'm not too familiar with, but I believe array[-1] means the last element of the array. If that's not true, then ignore me because I completely misunderstood the algorithm.
Posted by: David on September 26, 2004 09:15 PM | Permalink to CommentI ended up finding some python syllable counters online that use a phonetic dictionary from some university. It reads the phonetic respellings of the words using regex and gets reliable syllable counts that way. I don't know if that's how the angry-goats one works, but I'll probably end up using the phonetic one, or at least phonetic dictionary-based stuff, or at least playing with that.
Posted by: Matt Bowen on September 27, 2004 12:02 AM | Permalink to Commenthopefully it won't use up astronomical amounts of cpu time. pattern matching against each individual word and then searching the whole dictionary could add up for long pages/feeds.
the angry-goats one uses a set of explicit deductive rules to match against, such as adjacent vowels and ending characters.
Posted by: David on September 27, 2004 12:19 AM | Permalink to Comment