Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve rhyme function #3

Open
hyperreality opened this issue Dec 20, 2016 · 4 comments
Open

Improve rhyme function #3

hyperreality opened this issue Dec 20, 2016 · 4 comments

Comments

@hyperreality
Copy link
Owner

hyperreality commented Dec 20, 2016

At the moment, the rhyme function compares whether the final two syllables from the CMU dictionary are equal. This works for the majority of words, but many cause problems. For instance:

fire -> [[u'F', u'AY1', u'ER0'], [u'F', u'AY1', u'R']]
admire -> [[u'AE0', u'D', u'M', u'AY1', u'R']]
desire -> [[u'D', u'IH0', u'Z', u'AY1', u'ER0']]

Fire matches both admire and desire, but admire doesn't rhyme with desire...

Furthermore, for two syllable words, checking only the last syllable would probably improve things.

@oscardssmith
Copy link

I just found a really interesting article that's related. Anything useful here?
http://graphics.wsj.com/hamilton-methodology/

@hyperreality
Copy link
Owner Author

hyperreality commented Mar 27, 2017

@oscardssmith Thanks, that looks really useful. I'll be thinking about it over the next few days, and also happy to review and merge a patch if you want to try implementing it.

@rsrobbins
Copy link

rsrobbins commented Sep 23, 2017

I found that the rhyme function did not work for me until I changed it from level=2 to level=1
def rhymes(word1, word2, level=1):

@hyperreality
Copy link
Owner Author

The rhymes function compares the last x phonemes of the word. So for monosyllabic words, like "show" and "low", it may only report a rhyme if you use level 1. Maybe level 1 is a better default setting to use than level 2, but I think it was too permissive. A system like RhymeBrain which scores rhymes on a scale is probably what we need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants