Crates.io | dictcc |
lib.rs | dictcc |
version | 0.1.1 |
source | src |
created_at | 2017-12-14 19:42:43.300675 |
updated_at | 2018-02-12 16:27:15.07929 |
description | Rust API for reading and querying the dict.cc offline translation database. |
homepage | |
repository | https://github.com/kedeggel/dictcc-rust |
max_upload_size | |
id | 43117 |
size | 119,702 |
Rust API for reading and querying the dict.cc offline 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.
Install using cargo:
cargo install --features=cli dictcc
or download precompiled binaries.
Run dictcc --help
for further usage information.
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());
}