#dict #command-line-utilities #cli

app dictcc-cli

A command line application for translating between languages using dict.cc's database

2 unstable releases

Uses old Rust 2015

0.2.0 Jan 14, 2018
0.1.0 Jan 9, 2018

#12 in #dict

GPL-3.0+

70KB
497 lines

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 (see [Database]).

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.

Dependencies

~12MB
~232K SLoC