3 ms·
Here's some pythonesque pseudo-code that might do it: for tweet in twitter_api.latest_tweets(): phonetic_tweet = convert_tweet_to_phonemes(tweet)
by klenwell 14y ago
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.