Inspiration

We were pressed for ideas, when we stumbled upon a random idea generator. One of the ideas it spat out was making poetry from Wikipedia articles. So that's what we set out to do.

What it does

Our program is a Java terminal application. It is tailored for Wikipedia articles of people. You can generate 3 types of poems: limericks, haikus, and free verse.

How we built it

Our application uses two different APIs. First is the Wikipedia API, which we used to generate a JSON file with the contents of the article. We then parse this, removing undesired characters. Then we split the text into phrases separated by periods, commas and common conjunctions. Then we used the Datamuse API to find words that rhyme with the end of each phrase (for limericks and free verse) and find the number of syllables in each phrase (for haikus)

Challenges we ran into

learning how to use the APIs, finding ways to split the article into coherent phrases, removing undesired characters, optimizing runtime with so many queries.

Accomplishments that we're proud of

Haikus are working much better than we initially expected.

What we learned

What's next for WikiPoetry

Finalizing free verse and limericks, finding ways to parse and clean phrases better, implementing a score system for rhyme quality and meter, and many more random ideas.

Built With

  • datamuse-api
  • java
  • wikipedia-api
Share this project:

Updates