News for hackers. Stuff that matters.
Re:Pentametron Reveals Unintended Poetry of Twitter Users by klenwell on Sunday February 17, 2013 @04:34PM (#5236823)
Here's some pythonesque pseudo-code that might do it:

    for tweet in twitter_api.latest_tweets():
        phonetic_tweet = convert_tweet_to_phonemes(tweet)
        
        if is_iambic(phonetic_tweet):
            end_rhymes = extract_end_rhymes(phonetic_tweet)
            db.insert_iambic_tweet(tweet, end_rhymes)
            
            for end_rhyme in end_rhymes:
                rhyming_tweets = db.select_rhyming_tweets(end_rhyme)
                if rhyming_tweets:
                    rhyming_tweet = random.choice(rhyming_tweets)
                    return [tweet, rhyming_tweet]
There are several open source word lists out there that make this feasible.

There are no comments on this comment yet.