Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command line version #37

Open
m040601 opened this issue Aug 9, 2011 · 48 comments
Open

command line version #37

m040601 opened this issue Aug 9, 2011 · 48 comments

Comments

@m040601
Copy link

m040601 commented Aug 9, 2011

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)

@yangyingchao
Copy link

I have the same question too.

@RFDAJE
Copy link

RFDAJE commented Jun 28, 2012

+1

@vazgen
Copy link

vazgen commented Aug 27, 2012

yeah, it would be great

@Tvangeste
Copy link
Member

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".

@chulai
Copy link
Member

chulai commented Jan 30, 2013

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.

@omeid
Copy link

omeid commented Jun 3, 2013

Bump.

@wildeyes
Copy link

Bump. Still relevant.

@Tvangeste
Copy link
Member

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

@omeid
Copy link

omeid commented Aug 24, 2013

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

@zcattacz
Copy link

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.

@naszar
Copy link

naszar commented Feb 6, 2014

Bump.

@viktor-arsanov
Copy link

+1

@SuperBo
Copy link

SuperBo commented Mar 25, 2014

I also want this feature. +1

@maslennikov
Copy link

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

@Firef0x
Copy link

Firef0x commented Jun 24, 2014

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

@omeid
Copy link

omeid commented Jun 24, 2014

Still looking forward to this...

@clojens
Copy link

clojens commented Sep 19, 2014

bump

@Firef0x
Copy link

Firef0x commented Sep 19, 2014

👍 🉑 🔥 🆙 🆒 📙
Necrobump!! Actually it's a really good feature so that it could be used in Naughty of Awesome WM.

@clojens
Copy link

clojens commented Sep 21, 2014

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)

@crodjer
Copy link

crodjer commented Sep 23, 2014

+1

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

@dohliam
Copy link

dohliam commented Jan 14, 2015

+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).

@dohliam
Copy link

dohliam commented Feb 24, 2015

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.

@Firef0x
Copy link

Firef0x commented Mar 1, 2015

👍 🉑 🔥 🆙 🆒 📙
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.

@coiby
Copy link

coiby commented Jan 1, 2016

Bump!

@titusfx
Copy link

titusfx commented Jan 14, 2016

+1

@ejiektpobehuk
Copy link

bump =]

@scinart
Copy link

scinart commented Sep 26, 2016

Bump.

@vojtapolasek
Copy link

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.

@monolithpl
Copy link

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

@TTTPOB
Copy link

TTTPOB commented Feb 26, 2019

need this too

@elvis-wenhao-wu
Copy link

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

@ghost
Copy link

ghost commented May 21, 2020

necro bumb

@Kienyew
Copy link

Kienyew commented Sep 1, 2020

2020!

@Eitetsu0
Copy link

Eitetsu0 commented Jan 5, 2021

2021!

@alancaldas84
Copy link

+1

@tareefdev
Copy link

this is another great temp solution (with emacs interface too!) https://github.com/konstare/gdcv

@alancaldas84
Copy link

+1

3 similar comments
@SevenChalices
Copy link

+1

@nanjigen
Copy link

nanjigen commented Aug 3, 2021

+1

@hanleylee
Copy link

+1

@benthamite
Copy link

Since this was requested back in 2011 and it hasn't yet been implemented, Laplace's rule of succession predicts it is only ~8% likely to happen by the end of 2022. :(

@xiaoyifang
Copy link
Contributor

I got an idea to ease the command line goldendict.
what about embed an webserver in goldendict. such as http://localhost:6666/[word]
the local web server will use all the existed indexes、configurations whcih can be configured via goldendict gui.

now the problem has change from offer a goldendict command line to a more common issue:
how to make a command line to a http web server. eg. to strip html element etc.
also offers great possibilty to offer goldendict query online.

@qyqx
Copy link

qyqx commented Jun 10, 2023

+1

@Vilhelm-Ian
Copy link

bump

@benthamite
Copy link

Note that goldendict-ng has a command line version.

@terokarvinen
Copy link

Thanks for the link, benthamite. The linked page does not seem to document a command line version. Instead, it says "You can send word to mainwindow to popup via goldendict .".

A command line version would be nice. It would mean you could command 'goldendictcli permutation", and get explanations of the word "permutation" printed on standard output, in the terminal.

@benthamite
Copy link

Ah, you are right. Perhaps this could be requested, though? goldendict-ng seems much more actively maintained than this version.

@nonwill
Copy link

nonwill commented Nov 19, 2023

goldendict-ng seems much more actively maintained than this version.

It'll suspend your expectations for goldendict-ng to go end:
#1400 -->#1424 -->#1447 --> #1616 --> #1618 --> #1619 --> #1620 --> #1622 --> "features"? --> 🪓🔨⛏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests