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
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.
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.
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'.
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With