geekpradd / PyDictionary

PyDictionary is a Dictionary Module for Python 2/3 to get meanings, translations, synonyms and antonyms of words
https://pypi.python.org/pypi/PyDictionary
MIT License
274 stars 65 forks source link

Issue in finding Synonyms of words using PyDictinary API #16

Open frenky13 opened 6 years ago

frenky13 commented 6 years ago

I have been working on a project for documents analysis and developing it in Python. For analysis, I have been using Pydictionary for finding the synonyms of adverbs and adjective words. Earlier the API was working good and gives good results and I appreciate the developer for developing such an optimized and fast API. But from past couple of days, the API is not working properly. It gives me unexpected errors like "word has no Synonyms in the API". Sometimes it finds synonyms and but sometimes not. Can you please suggest me some solution for the same. I have been using PyDictionary version 1.5.2 in my project. Attaching snippet.

screenshot_20180417_133411

Thanks!!

ShwetaNagdev commented 6 years ago

Yes I am facing the same issue. Sometimes it gives synonyms sometimes it doesn't. Is the API under maintenance or there is some other problem?. Please let us know as soon as possible about what is the problem and when it will be solved. Thank You

geekpradd commented 6 years ago

@above, Will get back to you soon.

Chmits commented 6 years ago

I'm facing the same issue !! what's wrong !!

Deepakdubey90 commented 6 years ago

@geekpradd , I was looking into it, found some index related error in both case antonyms/synonyms both, due to that exception its getting outside from try-block and return the result as None.

terms = data.select("section.antonyms")[1].findAll("li") IndexError: list index out of range

BillBrazerZhang commented 6 years ago

@geekpradd I come with the same problem. I found that in function synonym(term):

terms = data.select("div#filters-0")[0].findAll("li") just return an empty list, i.e. len(terms) = 0

I don't know much about searching text in website and what "div#filters-0" means, so can anyone know what's wrong with this instruction?

WittmannF commented 6 years ago

Same here:

from PyDictionary import PyDictionary as P
d = P()
d.synonym("Life")

gives:

Life has no Synonyms in the API
cratervale commented 6 years ago

Same Error

Bhamil07734 commented 6 years ago

I'm a bit new to python and html, but through stumbling around a bit I was able to alter the original code to this point:

SynAntDictionary.txt

Before I was getting no results. I assume that thesaurus.com must have changed their code significantly enough to throw off the original selection/filter method. With this code I get results for every word that i've been able to access while browsing thesaurus.com manually during my limited testing. Of course It will still give the same error if theasurus.com does not return results. I would appreciate any further improvements/debugging. Thanks