rocktimsaikia / cambd Goto Github PK
View Code? Open in Web Editor NEWCambridge dictionary cli app
License: MIT License
Cambridge dictionary cli app
License: MIT License
related to #5
This will fix errors that occur on selecting a plural word in the suggestions menu list.
Extend the User-Agent
to be more platform specific and add Accept-Language
Currently, it shows only two definitions per word by default. We want to add a flag that will show the rest of the definitions.
The average response time is: 2.01s
cambd.py", line 85, in get_definitions
definition = dcon.find(attrs={"class": "ddef_d"}).get_text()
AttributeError: 'NoneType' object has no attribute 'get_text'
raise FeatureNotFound(
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?
This results in a bug where looking up the same misspelt word gives the definition of the related word that was selected initially.
I use CPython version 3.9.10.
I get the following stack trace when running cambd sappy
:
Traceback (most recent call last):
File "/home/daniel/.local/python/bin/cambd", line 8, in <module>
sys.exit(main())
File "/home/daniel/.local/python/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/daniel/.local/python/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/daniel/.local/python/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/daniel/.local/python/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/daniel/.local/python/lib/python3.9/site-packages/cambd/cambd.py", line 210, in main
print_definition(word_filtered, wanted_definitions[0], True, verbose)
IndexError: list index out of range
It's only showing the first info on the site. If you look at https://dictionary.cambridge.org/dictionary/english/stick you will see about 10 definitions.
And this is the cli output:
stick (noun)
A thin piece of wood or other material.
Examples:
• The old man was carrying a load of sticks.
• Police said that the child had been beaten with a stick.
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.