Goldendict: command line version

Created on 9 Aug 2011  Â·  36Comments  Â·  Source: goldendict/goldendict

in addtion to the gui interface would it be possible to adapt the existing code to provide a cli interface ?

stardict has one, called sdcv, http://en.wikipedia.org/wiki/Sdcv

This is something tremendously useful, for use in scripts, and integrate with text processing utilities (grep, awk sed etc)

Feature Request Popular

Most helpful comment

as the author hasn't replied, i think the best option is to use sdcv https://en.wikipedia.org/wiki/Sdcv

All 36 comments

I have the same question too.

Same here. This would be great. :)

+1

yeah, it would be great

Please clarify. GoldenDict supports many different dictionary formats, and they include audio, images, videos, advanced HTML formatting, etc. This is close to impossible to render in the console.

Or do you mean that GoldenDict needs console command line interface that launches the UI with appropriate word? This is already implemented, AFAIK. Just invoke goldendict "you_word_here".

As a start we could have a cmd line version that allowed to display the results in plain text (no images, videos or links) and a switch to output the raw html.
Later we could add additional option so the program could output the embedded resources in binary to the stdout, or encode the binary in a URI in base64 encoding or just print their URI to the resource.

Bump.

Bump. Still relevant.

Marking as Popular since many users requested. I am still surprised that folks need that. :)

Some people are just keyboard junkies. They love their CLI. This also makes integration really easy, specially in *nix environment.

This is something tremendously useful, for use in scripts, and integrate with text processing utilities (grep, awk sed etc)

I think what the OP is looking for is a way to exact res from the dictionaries. That sounds more like a parser with look-up interface. How the content is presented is not important at all.

Bump.

+1

I also want this feature. +1

I would like this feature to be able to implement osX dashboard widget for goldendict

Necrobump!! Actually it's a really good feature so that it could be used in Vim/Emacs.

Still looking forward to this...

bump

:+1: :accept: :fire: :up: :cool: :orange_book:
Necrobump!! Actually it's a really good feature so that it could be used in Naughty of Awesome WM.

I was temped to start filtering stdout messages with sed but didn't. At the least a switch or two to print without e.g. the http header data would be nice. I guess, if available, a computer readable format is cool, I've seen some dicts with extensive HTML which is less useful (images, media) but any XML or RDF can be easily understood by other (selection) tools as well (I'm thinking e.g. xmlstarlet). Besides that, plain text is always welcome - anything less than the full soup we currently get. Also, with me it seems that the goldendict "word" lookup isn't working. But it might be that I have an outdated ArchLinux package version, dunno. Anyway, not every format is equally useful on the cli, is my point I guess. So a switch to pass argument output format, plus one to limit the dictionary used would be very preferable (much like sdvc - stardict for the virtual console, I would guess it means - does)

+1

A benefit of a cli based dictionary implementation is the ability to use shell history and grep to review looked up words.

+1. Another reason for this that hasn't been mentioned above is that it would allow for accessing goldendict dictionaries through ssh (i.e. remotely).

Since I actually have a pressing need for this feature on a daily basis, I hacked together a Ruby script called gdcl ("Goldendict Command-Line") that allows me to search my dictionaries over ssh. It has the added benefit that I can also pipe the results to files or other programs and so on.

Right now it only works with DSL dictionaries in the Goldendict folder, but there are a bunch of options and a growing list of features, and it would be great to eventually support all the formats that Goldendict does (bgl, dict, etc). Since almost all of my dictionaries are in dictzipped dsl format, this is already quite functional for me, but in the absence of an official command-line version I'll continue to work on expanding options and features for gdcl.

In response to @Tvangeste's comment, as @chulai suggested the script currently strips out dsl dictionary markup, and it could easily do the same with html (online dictionaries are the next feature I'd like to include). The result is very clean -- just the content appears in the terminal, suitable for redirecting to a text file or whatever. Hopefully this can serve as a proof-of-concept for the usefulness of this feature that so many above would like to see.

What would be particularly great about an official command-line version is that we could leverage the existing index files and other internals that Goldendict uses, but I understand if there is no interest in working on such a feature at the moment.

:+1: :accept: :fire: :up: :cool: :orange_book:
Necrobump!! gdcl("GoldenDict Command-Line") is available in Arch Linux now. Σ( ° △ °|||)︴ Thx @dohliam !  ̄ 3 ̄

I've added the binary package to my own repository.
Pls visit http://git.io/-1 and add my repository, then execute sudo pacman -Syu gdcl to install the package.

See https://aur.archlinux.org/packages/gdcl/ for detail.

Bump!

+1

bump =]

Bump.

Bump, as I am a blind Linux user and there are some problems with accessibility of some QT widgets, I would also like to have a cli version.

as the author hasn't replied, i think the best option is to use sdcv https://en.wikipedia.org/wiki/Sdcv

need this too

Definitely need this. I am a newbie in IT. But maybe w3m or browsh could give a little bit inspiration?

necro bumb

2020!

2021!

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Spirituaway picture Spirituaway  Â·  4Comments

gitbuh1 picture gitbuh1  Â·  8Comments

Tvangeste picture Tvangeste  Â·  3Comments

Letiliel picture Letiliel  Â·  7Comments

mrLuyao picture mrLuyao  Â·  7Comments