cambridge is a terminal version of Cambridge Dictionary.
Project description
Cambridge
cambridge
is a terminal version of Cambridge Dictionary, with its data from https://dictionary.cambridge.org
By default, it is English to English translation. For English to Chinese, add '-c' or '--chinese' option.
Also supports the Merriam-Webster Dictionary. Webster has no foreign language translation in itself.
Screenshots
Look up Cambridge Dictionary (screenshot on DARK terminal background)
Look up Merriam-Webster Dictionary (screenshot on LIGHT terminal background)
Why This
I'm a terminal person tired of pulling out a GUI app or browser, inputting words in the search bar, hitting the search button and then waiting for the result to render with a bunch of unnecessary static files coming along. Not only is the time taken long, but also switching apps back and forth can be annoying. So I wrote this console application with features to my satisfaction.
Highlights
camb <word/phrase>
to initiate the lookup in Cambridge Dictionary by default-w
option to enable looking up in Merriam-Webster Dictionary- less than 2s taken to do all the work for the word, including fetching, parsing, printing, and writing cache
- less than 0.1s for the same word's later search by retrieving cache
- only the first dictionary from Cambridge (assuming the optimal) to avoid being confused by multiple dictionaries
- a list of suggestions will be given, if not found
camb l
to list cached words and phrases- support displaying spellcheck suggestion list, cache list, Webster's word of the day list by
fzf
- if
fzf
not installed, no worries, printing of the aforementioned lists on terminal has been beautified - well tuned to dark, light, blueish, grayish,
gruvbox
terminal colorschemes
Install & Uninstall
pip install cambridge
pip uninstall -r requirements.txt -y
rm -rf $HOME/.cache/cambridge
rm -rf $HOME/.cache/fakeua
# within the project
make install
make uninstall
make clean_cache
Usages
Command s
(hidden)
For looking up a dictionary. Options can be put before or after <word/phrase>
.
camb <word/phrase> # look up a word/phrase in Cambridge Dictionary
camb <word/phrase> -w # look up a word/phrase in Merriam-Webster Dictionary
camb <word/phrase> -c # look up a word/phrase in Cambridge with Chinese translation
camb <phrase with "'" > # camb "a stone's throw" | camb a stone\'s throw
camb <phrase with "/" > # camb "have your/its moments" | camb have your\/its moments
camb <word/phrase> -d # look up a word/phrase in debug mode
camb <word/phrase> -f # look up a word/phrase afresh without using cache
camb <word/phrase> -n # look up a word/phrase without showing suggestions if not found
Command l
For listing and deleting items in the cache.
camb l # list alphabetically ordered words/phrases you've found before
camb l -t # list words/phrases in reverse chronological order
camb l -r # list 20 words/phrases from the word list randomly
camb l -d # delete one or more words/phrases(separated by ", ") from the list
Command wod
For displaying 'Word of the Day' in the Merriam Webster Dictionary
camb wod # list today's Word of the Day from Merriam-Webster Dictionary
camb wod -l # list all words of the day
General options
camb -h, --help # show this help message and exit
camb -v, --version # print the current version of the program
TO-DOS
- input a new word/phrase when spelling suggestions are not satisfactory without restarting a new command line
- check a particular expression against all cached sentence examples, if found, we can confidently use it like that in our speaking or writing
- split and accumulate all sentences from a whole bulk of cache as independent Corpus, then we can use this Corpus outside this program
- strengthen 'Word of the Day' functionality from Webster
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cambridge-3.12.1.tar.gz
.
File metadata
- Download URL: cambridge-3.12.1.tar.gz
- Upload date:
- Size: 638.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e23a4ee38988d4cd0630553c6583fc391d69c7f4781648a64b009ddcca35d87 |
|
MD5 | 00ff440be6dd317f66bd4ec0bec39072 |
|
BLAKE2b-256 | a3754416669d163e9f3d7e34e78ba158f0b4377e28cac05dfe865dac02254a9c |
File details
Details for the file cambridge-3.12.1-py3-none-any.whl
.
File metadata
- Download URL: cambridge-3.12.1-py3-none-any.whl
- Upload date:
- Size: 39.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ac362f1b12a384e64a57779eeae03aaa2747c02d231fab53e08ca80f6c39017 |
|
MD5 | 66b77065d1917e62184c478231a7d800 |
|
BLAKE2b-256 | 3160493b7ac524f5f96b7c012dcb3bac40ef6ec4837a575230b89407ea5027ee |