![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Has anybody played with a poem generator in Python?
I need a hint to get one started.
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
#2 |
|
Professional Programmer
|
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 |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Feb 2005
Posts: 67
Rep Power: 4
![]() |
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).
|
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
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! |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Feb 2005
Posts: 74
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#7 |
|
Programming Guru
![]() |
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....
__________________
|
|
|
|
|
|
#8 |
|
Programmer
Join Date: Feb 2005
Posts: 74
Rep Power: 4
![]() |
Yeah what tempest said!
You should add a feature to choose what type of poem you want to create! ![]() |
|
|
|
|
|
#9 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You should also buy about a year's worth of coffee - you'll need it.
|
|
|
|
|
|
#10 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|