Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Vocab: An online dictionary integration to the command line (github.com/mckinsey666)
42 points by Mckinsey666 on Feb 19, 2019 | hide | past | favorite | 17 comments


Slightly OT, just in case someone has a similar problem: I (ab)used Wikipedia as special dictionary (1) during my thesis by means of a script that looked up the english article to the search-word and extracted the title of the link to the article in my mother tongue out of it. Admittedly it was a crude solution but it worked well enough then.

(1) It was meant to be used for technical terms that wouldn't be in most normal dictionaries.


I used to use this trick as well. Wikipedia is easily the best jp <-> en technical dictionary I've ever used.


Is this using dedict? That is a tool released in 2015 that parses the Mac OS built-in dictionaries, including ODE.

"After I wrote my post about Apple's dictionary files, I got a mysterious email showing up in my inbox. The email was from someone who's spent some time writing code to do the same thing, but doesn't want to post it under his own name in case he falls fowl of his country's DMCA equivalent. Crazy. He said I could post his code under the condition that I took his name off it."

https://josephg.com/blog/apple-dictionaries-part-2/

Vocab adds a few other features such as adding new words, so it's a welcome addition to this space. It seems that most custom dictionaries use the Stardict format, so perhaps adding that file format would be a way to bring in more of the community.


Thanks for the feedback. I simply scraped the oxford online dictionary using requests and bs4, no fancy stuff. Also, thanks for your advice!


And what was wrong with dict?


Came here to say this! This program would be even cooler if it supported the dict protocol in addition to scraping OED.

The dict protocol and CLI tool [1] were invented to solve the exact problem of browsing dictionaries without a bloaty web browser. You may wish to check them out.

On debian, sudo apt-get install dict, and you're off and running.

The most popular dict server may also be queried via a web UI [2] if you'd like to try it out before installing any software. It queries a few public-domain dictionaries, WordNet, plus some fun stuff like the Jargon File.

This being an open standard, you may also run your own dict server if you wish. It's pretty cool. dict has become a vital part of my CLI workflow since I discovered it many years ago. Its only downside is that it's blocked by some corporate firewalls =(

[1] https://en.wikipedia.org/wiki/DICT

[2] http://www.dict.org/bin/Dict


Thanks for the feedback! I will definitely check them out. The problem you pointed out (firing up a bloaty browser) is exactly the problem I am facing, hence the birth of Vocab. I am not a native speaker, so one of my goals is also to add some supporting features to help people learn English.


What is the problem you are facing?


I think the question is how does this compare/contrast with the dict command, a common utility that uses the Dictionary Server Protocol to query dictionaries from the command line.


Getting a definition or spelling correction for a word or a list of synonyms and antonyms, maybe a brief etymology, without interrupting my workflow at the command line or opening a slow heavy program like a web browser or office suite.


Wow, thanks alot for the feedback. To be honest, I didn't know the 'dict' command prior to your reply (what a shame lol). It is true that 'dict' is much more lightweight and robust, but since I myself is ESL, this was initially aimed at ESL-people, so I added some features to help them learn English.


If this could have a thesaurus included, i'd set it up in a heartbeat.


Man, leaving in your typos in the first GIF "screen recording" is IMO just sloppy. It's the first thing I looked at on the page and, boom, it's a typo. Personally it gave me the impression of unprofessionality.


Thanks for the feedback. I will fix this issue.


Bah! It is not a "command line", it is a shell!


this is badass, thanks


Thanks. It's really just a simple script (less than 300 lines of Python).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: