dictcc-cli
Purpose
dictcc-cli is a command line interface to dict.cc. As such, it provides the capability to translate words and phrases between languages. However, instead of interacting with the online service it relies on its database for the translation. This database has to be retrieved manually.
Usage
Being intended to be simple and fast to use, translating a term using dictcc-cli is as simple as providing it as an argument to the program:
$ dictcc-cli dictcc-lp1.db durchgeknallt
> durchgeknallt [ugs.] (adj): crazed
> durchgeknallt [ugs.] (adj): cuckoo [coll.]
> durchgeknallt [ugs.] (adj adv): loopy [coll.]
Note that the source an destination languages depends on the database being used. In the example above the German database maps from German to English and so this is the default direction of translation.
To translate the other way, the -r/--reverse
option can be used:
$ dictcc-cli dictcc-lp1.db --reverse dorky
> dorky [coll.] (adj): bekloppt [ugs.]
> dorky [coll.] (adj): idiotisch
> dorky [coll.] (adj): deppert [österr.] [südd.]
Installation
From Source
In order to compile the program the sqlite
crate needs to be available
which allows access to the dict.cc database. This crate and its dependencies
are contained in the form of subrepos in compatible and tested versions. Cargo
is required to build the program.
The build is as simple as running:
$ cargo build --release
Language Database
The database containing the translations has to be retrieved separately
as there are various languages and sizes available. One possible way is
to install the dict.cc app on an Android phone, install the desired
language pack, and then copy the file cc.dict.dictcc/dictcc-lp1.db
to
the device running dictcc-cli.