Coder Social home page Coder Social logo

dictcc-cli's Introduction

dictcc-cli

Offline dictionary via dict.cc database

Features

  • Fuzzy search (kind of)
  • Tab completion

Import database

Go to https://www1.dict.cc/translation_file_request.php download the file and unpack it, if necessary. Then import it.

dictcc-cli import filename.txt

After the import has finished, you may delete the file if you want to.

Translate

Interactive

dictcc-cli --language-pair de-en --from en

Non-interactive

dictcc-cli --language-pair de-en --from en -- Hello

Help menu

Usage: dictcc-cli [OPTIONS] --language-pair <LANGUAGE_PAIR> --from <LANGUAGE> [SEARCH]
       dictcc-cli <COMMAND>

Commands:
  import  Import a dict.cc file
  delete  Delete an imported dict.cc database
  help    Print this message or the help of the given subcommand(s)

Arguments:
  [SEARCH]  Search without interactive mode

Options:
  -l, --language-pair <LANGUAGE_PAIR>
          Languages to translate between
  -f, --from <LANGUAGE>
          The source language to translate from
  -d, --distance <DISTANCE>
          Fuzzy distance to find entries [default: 0]
  -r, --limit-results <LIMIT>
          Limit the amount of results
  -s, --min-similarity <LIMIT>
          Only show results with a specific minimum of similarity [possible values: 0 to 1000]
  -c, --completion-type <TYPE>
          Tab completion style [default: list] [possible values: circular, list]
      --ascii
          Use ASCII tables
  -h, --help
          Print help information
  -V, --version
          Print version information

Example

$ dictcc-cli -l de-en -f en
> figment
┌──────────────────────────────┬───────────────────────────────────────────────┐
│ EN                           ┆ DE                                            │
╞══════════════════════════════╪═══════════════════════════════════════════════╡
│ figment                      ┆ Erfindung {f}                                 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment                      ┆ Produkt {n} der Einbildung                    │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment                      ┆ Gebilde {n} [Phantasie]                       │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment                      ┆ Fabelei {f} [oft pej.] [erfundene Geschichte] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment                      ┆ Hirngespinst {n}                              │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment of the imagination   ┆ Phantasiegebilde {n}                          │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment of the imagination   ┆ Fantasievorstellung {f}                       │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment of the imagination   ┆ pure Einbildung {f}                           │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment of the imagination   ┆ Ausgeburt {f} der Phantasie / Fantasie        │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ figment of the imagination   ┆ Fantasiegebilde {n}                           │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ a figment of his imagination ┆ ein Produkt {n} seiner Phantasie              │
└──────────────────────────────┴───────────────────────────────────────────────┘
> 

Build from source

  • Install rustup to get the rust compiler installed on your system. Install rustup
  • Rust version 1.63.0 or later is required
  • Build in release mode: cargo build --release
  • The resulting executable can be found at target/release/dictcc-cli

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.