Utilities for working with the Electronic Dictionary Research and Development Group (EDRDG) radical decomposition files.
The kradical_converter tool can convert EDRDG radical files to various formats. Use multiple --inputs flags to process multiple files together.
The JSON and UTF8 txt files are created under /assets/outputs/ with the below commands.
With output extension .json and json option:
# Generate krad.json
cargo run -p kradical_converter -- --inputs ./assets/edrdg_files/kradfile --inputs ./assets/edrdg_files/kradfile2 --output ./assets/outputs/krad.json krad json
# Generate radk.json
cargo run -p kradical_converter -- --inputs ./assets/edrdg_files/radkfile --inputs ./assets/edrdg_files/radkfile2 --output ./assets/outputs/radk.json radk jsonWith output extension .txt and unicode option:
# Generate krad_utf8.txt (kanji → radicals mapping)
cargo run -p kradical_converter -- --inputs ./assets/edrdg_files/kradfile --inputs ./assets/edrdg_files/kradfile2 --output ./assets/outputs/krad_utf8.txt krad unicode
# Generate radk_utf8.txt (radical → kanji mapping)
cargo run -p kradical_converter -- --inputs ./assets/edrdg_files/radkfile --inputs ./assets/edrdg_files/radkfile2 --output ./assets/outputs/radk_utf8.txt radk unicodeWith output extension .rs and rust option:
# Generate decompositions.rs (for kradical_static crate)
cargo run -p kradical_converter -- --inputs ./assets/edrdg_files/kradfile --inputs ./assets/edrdg_files/kradfile2 --output ./kradical_static/src/decompositions.rs krad rust
# Generate memberships.rs (for kradical_static crate)
cargo run -p kradical_converter -- --inputs ./assets/edrdg_files/radkfile --inputs ./assets/edrdg_files/radkfile2 --output ./kradical_static/src/memberships.rs radk rust- First, build the release version of the converter:
cargo build --release- Then replace
cargo run -p kradical_converter -- --inputswith./target/release/kradical_converter --inputsin the above commands.- On Windows also replace
/with\for the path.
- On Windows also replace
More information about each crate included with the project in the associated readme files:
Included with this project under assets/outputs are several UTF-8-encoded variants of the source files in a more convenient format.
krad_utf8.txtfollows the same format as the originalkradfile. Each line contains the following:- The kanji
- A colon
- Each of constituent radicals separated by spaces
radk_utf8.txtdiffers from the originalradkfileand instead mirrors thekradfileformat. Each line contains the following:- The radical
- The number of strokes in the radical
- A colon
- Each of the kanji that contain the radical separated by spaces
In accordance with the EDRDG license statement, this project is distributed under the Attribution-ShareAlike 3.0 Unported license. The files included under assets/edrdg_files were downloaded from the Monash Nihongo FTP Archive and are the property of EDRDG.
JIS X 0212 conversion tables are distributed under the Unicode license.