8000 GitHub - kedeggel/dictcc-rust: Rust API for use of dict.cc translation data
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kedeggel/dictcc-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dictcc-rust

Crates.io dictcc Build Status Build status

Rust API for reading and querying the dict.cc offline translation database.

Download dict.cc translation database

Due to licensing requirements of dict.cc, we are not allowed to provide the database as part of the crate.

You need to request a download link on dict.cc.

CLI

Install using cargo:

cargo install --features=cli dictcc

or download precompiled binaries.

Run dictcc --help for further usage information.

API Example usage

extern crate dictcc;

use dictcc::Dict;

fn main() {
    let dict = Dict::create("test/database/test_database.txt").unwrap();

    let query_result = dict.query("Wort").execute().unwrap();

    for entry in query_result.entries() {
        println!("Plain word: {}", entry.left_word.plain_word());
        println!("The word with optional parts: {}", entry.left_word.word_with_optional_parts());
        println!("Acronyms: {:?}", entry.left_word.acronyms());
        println!("Comments: {:?}", entry.left_word.comments());
        println!("Gender Tags: {:?}", entry.left_word.genders());
    }

    // Pretty table printing
    println!("{}", query_result.into_grouped());
}

About

Rust API for use of dict.cc translation data

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0