Open johnmastri opened 10 years ago
There are soundex and metaphone implementations in Natural. Both can be used. I find this (non Natural) article pretty explainatory for differences and why one is better and both are not 100% covering rhymes a good read. http://www.blackbeltcoder.com/Articles/algorithms/phonetic-string-comparison-with-soundex .
If you want better results you might want to check the soundex of the last part of the word rather than the full word this might help apparent rhyme as well.
Seems to me the problem with Rhyme is that most (at least the ones in natural) phonetic algorithms ignore all but the first vowel except inasmuch as determining the hardness of an adjacent consonant. Reversing words would potentially work if you reversed the order inside the rules perhaps.
One option would be to try to integrate with some online rhyme dictionary's API, but another would be to try to dig up a phonetic algorithm that concerns itself more with vowel pronunciation.
Trying to find a solution to determine if two words rhyme - is it possible to do this with the current functionality of natural?
Thanks