Package: cambridge
Cambridgecambridgeis a terminal version of Cambridge Dictionary, with its data fromhttps://dictionary.cambridge.orgBy default, it is English to English translation. For English to Chinese, add '-c' or '--chinese' option.Supports looking up the Merriam-Webster Dictionary, with-wor--websteroption. Webster has no foreign language translation in itself.ScreenshotsLook up Cambridge DictionaryLook up Merriam-Webster DictionaryWhy ThisI'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.Highlightscamb <word/phrase>to look it up in Cambridge Dictionary by default-wflag to fetch Merriam-Webster Dictionaryless than 2s taken to do all the work for the word, including fetching, parsing, printing, and writing cacheless than 0.1s for the same word's later searchonly the first dictionary from Cambridge, avoiding confuses by multiple dictionariesa list of word/phrase suggestions will be given, if not foundcamb lto list words and phrases you've found beforecolorscheme well customized to dark, light, blue, grey, gruvbox terminal backgroundsfzfWithfzfinstalled,camb l | fzf --preview 'camb {}'will get you a taste of thefzfmagic:display the whole word listfuzzy find a word from the word list & preview its meaning instantlypreview each word definition instantly as you scroll through the listalias cambl="camb l | fzf --preview 'camb {}'"can be added in your bashrc for convenienceInstall & Uninstallpipinstallcambridge# installpipuninstallcambridge&&rm-rf$HOME/.cache/cambridge# uninstall and remove cacheUsagesCommand s (hidden)For looking up a dictionary. Flags can be put before or after<word/phrase>.camb<word/phrase># look up a word/phrase in Cambridge Dictionarycamb<word/phrase>-w# look up a word/phrase in Merriam-Webster Dictionarycamb<word/phrase>-c# look up a word/phrase in Cambridge with Chinese translationcamb<phrasewith"'"># camb "a stone's throw" | camb a stone\'s throwcamb<phrasewith"/"># camb "have your/its moments" | camb have your\/its momentscamb<word/phrase>-d# look up a word/phrase in debug modecamb<word/phrase>-f# look up a word/phrase afresh without using cachecamb<word/phrase>-n# look up a word/phrase without showing suggestions if not foundCommand lFor listing and deletinng items in the cache.cambl# list words/phrases found before in alphabetical ordercambl-t# list words/phrases found before in reverse chronological ordercambl-r# list 20 words/phrases from the word list randomlycambl-d# delete one or more words/phrases(separated by ", ") from the listCommand wodFor displaying 'Word of the Day' in the Merriam Webster DictionaryGeneral optionscamb-h,--help# show this help message and exitcamb-v,--version# print the current version of the programLatest version v3.8.2Fixed incorrect line wrapping on terminal for some long lines of "Webster's recent examples on the web" section caused by third party libraryrich'sconsole.print()default behaviorsoft_wrap. For a very long time, I thought it was terminal's wrapping kinks independent of this program, but after deep digging intoterminfo, I found the devil is actually not in terminal, but in therich's insensible default setting, which is very hard to find and took me a lot of time.If you use Webster dictionary a lot, I strongly recommend you make an upgrade.TO-DOSinput a new word/phrase when spelling suggestions are not satisfactory without restarting a new command linecheck a particular expression against all cached sentence examples, if found, we can confidently use it like that in our speaking or writingsplit and accumulate all sentences from a whole bulk of cache as independent Corpus, then we can use this Corpus outside this programstrengthen 'Word of the Day' functionality from Webster