Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing a rhyme finder [closed]

Was wondering if anyone had any tips or could point me in the right direction to finding/creating some sort of algorithm to find rhyming words.

I specifically do not want to use an API, as creating the algorithm just to create it is my end goal.

Not that it should be important but I'm coding in java.

Thank you

like image 763
Gagan Singh Avatar asked Dec 19 '12 21:12

Gagan Singh


People also ask

What is it called when something is close to rhyming but doesn't completely?

A slant rhyme is also called a half rhyme, near rhyme, sprung rhyme, off rhyme, lazy rhyme, oblique rhyme, or approximate rhyme. Slant rhyme is also called imperfect rhyme in contrast to perfect rhyme.

How do you know if 2 words rhyme?

If two words sound the same or have the same ending sound, they rhyme. To figure out if two or more words rhyme, use your ears to listen to the words as you say them. For example: when we say car, bar, far, we hear that the 'ar' is the same sound to our ears, so these words rhyme.

How do you find the rhyme scheme of a poem?

You can work out the rhyme scheme of a poem by labelling the words that rhyme with each other. It will help you see the pattern of the poem. For example, if a poem's first and third lines rhyme you should label those 'A'. If the second and fourth lines of the poem rhyme, label these 'B'.


2 Answers

This seems like it could be a huge project if you don't want to use an API. The challenging step would be to determine the phonetics of a word (two words rhyme if their endings are phonetically similar). If you can do this, you can compare the endings of their pronunciation. You could possibly find an API that would convert known words to their phonetic spellings but if you don't want to use APIs you have to do it yourself and it's no small task... not to mention, hasn't been perfect by anyone.

The other method would be to research the Metaphone algorithm, explained here: http://www.blackbeltcoder.com/Articles/algorithms/phonetic-string-comparison-with-soundex

like image 59
Foggzie Avatar answered Sep 24 '22 06:09

Foggzie


Best algorithm will use a dictionary of words classified on groups with rhymes. It's very hard problem and need linguistics background. I suppose you want some, probably not the best, algorithm for automatic finding the rhymes.

Basic idea to code pronunciation of the word (not the word itself) with some value. And values that ends with equal codes identify words rhymes.

From my perspective it is more researching than finding the correct algorithm.

Take a look at that paper: A System for the Automatic Identification of Rhymes

like image 37
mishadoff Avatar answered Sep 22 '22 06:09

mishadoff