Thanks to visit codestin.com
Credit goes to lib.rs

3 releases

Uses new Rust 2024

0.1.2 Aug 21, 2025
0.1.1 Aug 6, 2025
0.1.0 Jul 12, 2025

#3 in #romaji


Used in ib-matcher

MIT license

2MB
32K SLoC

ib-romaji

crates.io Documentation License

A fast Japanese romanizer.

Usage

use ib_romaji::HepburnRomanizer;

let romanizer = HepburnRomanizer::default();

let mut romajis = Vec::new();
romanizer.romanize_and_try_for_each("日本語", |len, romaji| {
    romajis.push((len, romaji));
    None::<()>
});
assert_eq!(romajis, vec![(9, "nippongo"), (3, "a"), (3, "aki"), (3, "bi"), (3, "chi"), (3, "he"), (3, "hi"), (3, "iru"), (3, "jitsu"), (3, "ka"), (3, "kou"), (3, "ku"), (3, "kusa"), (3, "nchi"), (3, "ni"), (3, "nichi"), (3, "nitsu"), (3, "su"), (3, "tachi")]);

assert_eq!(romanizer.romanize_vec("日本語"), vec![(9, "nippongo"), (3, "a"), (3, "aki"), (3, "bi"), (3, "chi"), (3, "he"), (3, "hi"), (3, "iru"), (3, "jitsu"), (3, "ka"), (3, "kou"), (3, "ku"), (3, "kusa"), (3, "nchi"), (3, "ni"), (3, "nichi"), (3, "nitsu"), (3, "su"), (3, "tachi")]);

Comparison with other crates

The following crates are kana (仮名) only. They don't support kanjis like 日本語:

Dependencies

~1–2.5MB
~50K SLoC