Crates.io | dodo-zh |
lib.rs | dodo-zh |
version | 0.1.4 |
source | src |
created_at | 2023-11-26 20:45:48.23052 |
updated_at | 2024-10-27 21:04:48.606542 |
description | utility to operate on pinyin and cedict.u8 file |
homepage | |
repository | https://github.com/shigedangao/nomnom/tree/main/dodo-zh |
max_upload_size | |
id | 1049440 |
size | 48,236 |
Just a small util tool to convert the cedict_ts.u8 into a JSON or CSV file. Additionals features are:
Clone this project and run one of the cargo command below. If needed I could provided the generate json & csv file.
cargo run -- generate -e ../cedict_ts.u8 -o ../cedict.json -f json
cargo run -- generate -e ../cedict_ts.u8 -o ../cedict.csv -f csv
A small crate which allows to do several operations on the cedict.u8 file but also allows you to do some operations on chinese characters such as:
use dodo_zh;
use dodo_zh::variant::KeyVariant;
fn main() {
// The KeyVariant can either be Traditional or Simplified chinese
let cedict = dodo_zh::load_cedict_dictionary(path, KeyVariant::Traditional).unwrap();
let wo = cedict.items.get("我").unwrap();
// will return an Item struct
println!(wo.translations);
}
A set of example exist which can helps you to see how to do some pinyin manipulation. Namely convert the pinyin with tone number to a pinyin with tone marker etc...
You can run the example with the following command
cargo run --example dodo