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

find_definitions can returns antonyms #14

Closed
drewvid opened this issue Oct 28, 2022 · 5 comments
Closed

find_definitions can returns antonyms #14

drewvid opened this issue Oct 28, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@drewvid
Copy link

drewvid commented Oct 28, 2022

Find definitions will sometimes return antonyms because the antonym cache is checked by mistake.

Returns
----------
:return: list of definitions
:rtype: list
"""
valid_word = self._validate_word()
if valid_word:
check_cache = caching.cache_antonyms(self._word)

@johnbumgarner
Copy link
Owner

johnbumgarner commented Oct 28, 2022

Thanks for pointing this out. Let me look at this issue.

@drewvid
Copy link
Author

drewvid commented Oct 29, 2022

Sure.

from pprint import pprint

from wordhoard import Antonyms, Definitions

if name == "main":

# does not work
word = "walk"
antonyms = Antonyms(word).find_antonyms()
definitions = Definitions(word).find_definitions()
print("Antonyms: ", antonyms)
print("Definitions: ", definitions)

# works
word = "talk"
definitions = Definitions(word).find_definitions()
antonyms = Antonyms(word).find_antonyms()
print("Antonyms: ", antonyms)
print("Definitions: ", definitions)

@drewvid
Copy link
Author

drewvid commented Oct 29, 2022

I fixed the problem locally by editing line 150 in "dictionary.py":

was: check_cache = caching.cache_antonyms(self._word)
is now: check_cache = caching.cache_definition(self._word)

@johnbumgarner
Copy link
Owner

Thanks. I will make this change and push out an update. Is there anything else that this package is missing that would be useful?

@johnbumgarner
Copy link
Owner

This issue was fixed in WordHoard v1.5.2, which was pushed to GitHub this morning. This release will be pushed to PyPi today.

@johnbumgarner johnbumgarner self-assigned this Jun 1, 2023
@johnbumgarner johnbumgarner added the bug Something isn't working label Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants