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

Make rhymes return rhymes for all pronunciations #46

Merged
merged 7 commits into from Sep 5, 2018

Conversation

Projects
None yet
3 participants
@jdbean
Copy link
Contributor

commented Aug 31, 2018

Rhymes now returns a single, flat, sorted list that contains the words rhyming with all pronunciations of the given word.

Closes #45

jdbean added some commits Aug 31, 2018

Make rhymes return rhymes for all pronunciations
Rhymes now returns a single, flat, sorted list that contains the words rhyming with all pronunciations of the given word.
Show resolved Hide resolved pronouncing/__init__.py Outdated
Update __init__.py
Correcting erroneous  indent
element), []) if w != word])
combined_rhymes = list(chain.from_iterable(combined_rhymes))
combined_rhymes.sort()
unique_combined_rhymes = set(combined_rhymes)

This comment has been minimized.

Copy link
@aparrish

aparrish Sep 1, 2018

Owner

iirc, I'm not sure if using set/list to remove duplicates will produce the desired results across all the versions of python that we're targeting—probably best to sort the list post-dedup.

This comment has been minimized.

Copy link
@jdbean

jdbean Sep 2, 2018

Author Contributor

Thanks! I switched the order of operations and I think it should be working correctly now.

@aparrish

This comment has been minimized.

Copy link
Owner

commented Sep 1, 2018

also this needs an update to the test_rhymes test (which is why the CI is currently failing). can you update that test and push to this same PR? (If you don't have time or prefer not to, that's fine—I can do it, but it might take a while for me to get around to it.)

Update __init__.py
Accounting sorting unique_combine_rhymes after dedup in order to account for behavior of set
@jdbean

This comment has been minimized.

Copy link
Contributor Author

commented Sep 2, 2018

This newest push seems to have resolved the CI failures. I may be able to look into updating the tests to avoid future regressions if you're not comfortable merging as is.

@aparrish

This comment has been minimized.

Copy link
Owner

commented Sep 3, 2018

actually if you could add a test to avoid regressions on this that would be great!

jdbean added some commits Sep 3, 2018

@jdbean

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2018

I think that should do it! 😄 Please let me know if you have any feedback.

Show resolved Hide resolved tests/test_pronouncing.py Outdated
Spliting rhymes tests
Breaking up rhymes test assertions into independent methods
@jdbean

This comment has been minimized.

Copy link
Contributor Author

commented Sep 4, 2018

@hugovk Thanks for the feedback. I agree that the rhymes tests are better off being split into their own methods. I've pushed a new commit which splits them out as such.

@aparrish aparrish merged commit 9a1c5ff into aparrish:master Sep 5, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 100.0%
Details
@aparrish

This comment has been minimized.

Copy link
Owner

commented Sep 5, 2018

looks good, thanks! will include in next release.

@jdbean

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2018

Most welcome. Glad I could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.