tasdikrahman / vocabulary Goto Github PK
View Code? Open in Web Editor NEW[Not Maintained anymore] Python Module to get Meanings, Synonyms and what not for a given word
Home Page: https://vocabulary.readthedocs.io/en/latest/
License: MIT License
[Not Maintained anymore] Python Module to get Meanings, Synonyms and what not for a given word
Home Page: https://vocabulary.readthedocs.io/en/latest/
License: MIT License
Hi ๐
This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.
Once you have closed this issue, I'll create seperate pull requests for every update as soon as I find one.
That's it for now!
Happy merging! ๐ค
Why do all the methods return a string of JSON? What advantage does this have over returning plain Python objects (dicts, lists, etc)?
It seems a little backwards to return JSON as part of the API that's supposed to be easy to use - now I also have to parse that myself. If you require JSON strings, perhaps you could provide a keyword argument, eg json=True
or json=False
that will handle this accordingly.
How are they dealt with?
Looking at
vocabulary/vocabulary/vocabulary.py
Line 89 in 9d8870c
the current way of running tests in the CI is kind of hacky. Using nose
for finding/running tests is desirable
While this isn't really a huge problem, you may wish to reformat your docstrings according to the established formats.
PEP 287 recommends that reST (reStructuredText) format be used, but Epytext is popular as well - They're used because Python IDEs are often able to parse them to get more information about the things they document, for example, for auto-completion.
Faced the following error while installing via pip:
Collecting vocabulary
Using cached Vocabulary-1.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-PWXQ1D/vocabulary/setup.py", line 19, in
with open(path.join(here, 'requirements.txt')) as f:
IOError: [Errno 2] No such file or directory: '/tmp/pip-build-PWXQ1D/vocabulary/requirements.txt'
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-PWXQ1D/vocabulary/
I ran pip install requests
before this since it failed with the error "No such module : requests" earlier.
Hey,
I tried to install the package using pip but I'm getting an error. I have added the traceback below:
$ pip3 install vocabulary
Collecting vocabulary
Downloading Vocabulary-1.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-4zb4lgql/vocabulary/setup.py", line 22, in <module>
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-4zb4lgql/vocabulary/requirements.txt'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-4zb4lgql/vocabulary/
I wasn't able to install Vocabulary
in a clean virtual environment (with no installations of requests
and mock
) either.
$ pip install vocabulary
Collecting vocabulary
Using cached Vocabulary-1.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-erniz75j/vocabulary/setup.py", line 12, in <module>
from vocabulary.version import VERSION
File "/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-erniz75j/vocabulary/vocabulary/__init__.py", line 5, in <module>
from .vocabulary import Vocabulary
File "/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-erniz75j/vocabulary/vocabulary/vocabulary.py", line 25, in <module>
import requests
ImportError: No module named 'requests'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-erniz75j/vocabulary/
As can be observed in the traceback, this issue is due to the import statement in __init__.py
module which .
How about we move define the version and release in the setup.py
itself so as to keep things condensed ?
On a separate note, I believe that we are using rather constrained dependency package versions.
For example, any version of requests
above 2.0.0
should work fine as a dependency.
What's your take on this?
For generating docs using sphinx, one has to manually run the make html
command if some changes are made.
Using CI/CD would remove this manual work
On Windows using Python 3.4, I get an error during installation.
The error happens during install through pip, as well as installation through git-clone / setup.py.
See #1 for fix - explicitly passing encoding="utf8"
to the open
method when reading the README file.
When using the Vocabulary.meaning() function there is an enormous amount of duplicates. In some cases like the word cat
, some meanings are duplicated 4 or even 5 times. Is there any way to only display one of the similar meanings?
Hello,
When I try to use:
from vocabulary.vocabulary import Vocabulary as vb
print vb.antonym("insane")
I get the error:
Connection Lost
False
Thanks in advance for your help,
Amal
This is similar to the issue #23
I installed vocabulary on 3 different machines. On each machine, I could obtain the meaning, synonym, etc. of the word for only a few function calls (around 800 requests). I then receive 'False' for all the subsequent calls except hyphenation()
Is there a rate limit? If so, can we include it in the docs?
I've looked over your project and it seems to be very interesting. In fact I've done something similar for my own purposes. My goal, however, was to build a small set of tools to 1) extract words from my dictionary 2) obtain translation/usage/examples/synonyms etc 3) show that in conky 4) convert that to Anki format for future learning. Take a look if you're interested: https://github.com/balta2ar/yandex-slovari-tetradki/
I've implemented a small set of backends for slightly different sites, the implementation might be not very robust and production ready (it rather scrapes the HTML code, not API), but I still think we have common ideas in our implementations. In this issue I wanted to inquire whether you think that support for additional sites (something along the sites that my script supports) would be appropriate in your project?
Is there anyway to have the case of words ignored when searching for the part of speech?
The requirements.txt
file should be a list of packages required by your package, for parsing by pip
.
In your requirements.txt
, we have the following:
requests==2.8.1
Vocabulary==0.0.3
wheel==0.26.0
requests==2.8.1
- Why this version? Is there some quirk you require? If you're just using the normal API, you can leave out the explicit version and just use requests
here.Vocabulary==0.0.3
- This is your package, right? This could cause some nasty dependency loops in pip
, it shouldn't be here.wheel==0.26.0
- Why? Where are you using wheel
?Here's some examples.
There's a lot of this. Why False
? Shouldn't you be returning None
instead? None
is still "falsey", so you can still say if not result:
, but more correctly denotes the lack of any data to return.
This is currently done manually
Hi. I installed successfully this package. (no errors). I try your examples
from vocabulary import Vocabulary as vb
print(vb.meaning('car'))
print(vb.synonym('car'))
Python version 3.5.2 (2.7.12) - I tried it on windows and linux and same result.
It returns me always false no matter what word I use.
only this works:
print(vb.hyphenation('car'))
[{"text": "car", "seq": 0}]
Thanks for help
Hi,
Love this library and thank god it exists! However, the synonyms don't seem to be very accurate. For example, "small" returns "fly" as the first result, and "bridge" as the second. Whilst I can see how the "fly" can be a synonym (at a stretch), not sure how bridge is "synonymous" with "small"? Am wondering if there is anyway to improve the accuracy of synonyms?
Cheers
usage_example doesn't work, it only returns False.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.