Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 10th, 2005, 9:31 AM   #1
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Smile Poem Generator

Has anybody played with a poem generator in Python?
I need a hint to get one started.
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Old Mar 10th, 2005, 10:39 AM   #2
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
well, two words that rhyme usually end with the same syllable, so you're gonna need a way to search words that end in a certain syllable. Ponder about that..
Good luck
Dizz
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Mar 10th, 2005, 3:43 PM   #3
Fred
Programmer
 
Fred's Avatar
 
Join Date: Feb 2005
Posts: 67
Rep Power: 4 Fred is on a distinguished road
Well, I don't think that you can get python to write any senseful poems by itself... But you sure can rhyme words, and maybe even make a poem out of a text by using dictionnaries and databases (searching for rhymes, and if none found, replace word with eqivalent stored in a database or dictionary).
Fred is offline   Reply With Quote
Old Mar 11th, 2005, 12:26 AM   #4
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Smile

Well I don't expect the thing to create a finished poem. It is meant more as an idea generator. Needs to have a database of words and structures one could tax from existing poems.
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Old Apr 8th, 2005, 4:27 PM   #5
dmorales
Programmer
 
Join Date: Feb 2005
Posts: 74
Rep Power: 4 dmorales is on a distinguished road
I'm not a python person myself, but as an idea, have a database of words set by categories. (nouns, verbs, adjectives, etc.) Formulate a 'sentence' structure for each line, each ending word in the sentence must rhyme with the previous. To go along with Dizzuth's idea.

Just an idea though.
dmorales is offline   Reply With Quote
Old Apr 8th, 2005, 6:04 PM   #6
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Yeah sure, just insert loads of lines from poems into a list, shuffle it, then pick out lines that rhyme based on your current rhyme scheme. There may be some decent libraries that can help you with that (TTS engines would be a good place to start looking), or you may just have to code it yourself.
Interesting project though, may give it a go myself some time.
Cerulean is offline   Reply With Quote
Old Apr 8th, 2005, 6:34 PM   #7
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Get all of the words in the english language, categorize them by type and put in the basic sentence structures (orders of verbs, adverbs, adjectives, nouns, and pronouns) and then create a sorting algorithm to pick a random one for each spot but the last one. For the last one pick a random word for the first type you need, and get the last syllable. With that last syllable, search for the new type you need finding every word that can work and place it into a temporary array. Now pick a random ending word for the second sentence....
__________________

tempest is offline   Reply With Quote
Old Apr 9th, 2005, 12:02 PM   #8
dmorales
Programmer
 
Join Date: Feb 2005
Posts: 74
Rep Power: 4 dmorales is on a distinguished road
Yeah what tempest said!

You should add a feature to choose what type of poem you want to create!
dmorales is offline   Reply With Quote
Old Apr 10th, 2005, 5:01 PM   #9
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
You should also buy about a year's worth of coffee - you'll need it.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 10th, 2005, 6:49 PM   #10
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
does seem like a fairly detailed / time consuming project.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:50 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC