Dictionary query

0 views
Skip to first unread message

Matthew Fernandez

unread,
Sep 22, 2011, 1:45:28 AM9/22/11
to code-p...@googlegroups.com
Apologies there hasn't been much project action of late; uni has been
taking all my time. One of the things I wanted to look at, that I
would be interested in using myself, is a command line tool to look up
the meanings of words. I can imagine this would be handy for many of
us and could easily be incorporated into scripts or graphical
programs. I can knock this one out myself in the next few days, but
was thinking of committing this to the CPB github account if other
people are interested in using it or building things using it. Let me
know if you're interested.

One thing I've hit in 5 minutes of googling is that no one seems to
offer a free dictionary API. Google had an undocumented one for a
while that they didn't really like you using and I've found that other
sites explicitly block wget, which suggests they don't like this sort
of thing. Does anyone know of a free dictionary API that doesn't
require registering for an API key?

Billy Huang

unread,
Sep 22, 2011, 2:09:46 AM9/22/11
to code-p...@googlegroups.com
that is a brilliant idea, but rather than dictionary i was thinking reading off from a text file or something, so that we can use it as a API doc.

Julian G

unread,
Sep 22, 2011, 1:53:05 AM9/22/11
to code-p...@googlegroups.com
Hey,

You can access the OS X dictionary from the command line. While this isn't useful to everyone, and I can't remember the how-to of it, I know it's easily accessible.

J

Tom Allen

unread,
Sep 22, 2011, 2:23:27 AM9/22/11
to code-p...@googlegroups.com
You could always pass "define: <word>" to the Google web search API...

Matthew Fernandez

unread,
Sep 22, 2011, 3:16:02 AM9/22/11
to code-p...@googlegroups.com, Tom Allen

Billy, reading from a text file would work, but I'd prefer not to need one and rather query some online dictionary to get up to date definitions.

Julian, is that definitions or just spell check?

Tom, that needs an API key.

Andrew Hill

unread,
Sep 22, 2011, 4:59:25 AM9/22/11
to code-p...@googlegroups.com
Mac solution here (apparently — I've not built it myself)

Matthew Fernandez

unread,
Sep 22, 2011, 8:05:24 AM9/22/11
to code-p...@googlegroups.com
Ah, that'll teach me to email without searching my package
repositories. Dict does indeed do what I want and seems to be
available on all the unices. Thanks, Andrew!

Matthew Fernandez

unread,
Sep 23, 2011, 11:21:04 PM9/23/11
to code-p...@googlegroups.com
For anybody who wants to use this, I've written a script that suits
me: https://github.com/Smattr/mattutils/blob/master/defn.sh

Mac users may want to modify the notify-send bits to use growl instead.

On 22 September 2011 22:05, Matthew Fernandez

Reply all
Reply to author
Forward
0 new messages