mojimoji-rs

Rust implementation of a fast converter between Japanese hankaku and zenkaku characters, mojimoji.

Installation

In Cargo.toml, [dependencies] mojimoji-rs = "*"

Zenkaku to Hankaku

Definition

rust pub fn zen_to_han(text: String, ascii: bool, digit: bool, kana: bool) -> String

Arguments

rust use mojimoji_rs::zen_to_han; assert_eq!(zen_to_han("アイウabc012".to_string(), true, true, true), "アイウabc012".to_string()); assert_eq!(zen_to_han("アイウabc012".to_string(), true, true, false), "アイウabc012".to_string()); assert_eq!(zen_to_han("アイウabc012".to_string(), true, false, true), "アイウabc012".to_string()); assert_eq!(zen_to_han("アイウabc012".to_string(), false, true, true), "アイウabc012".to_string());

Hankaku to Zenkaku

Definition

rust pub fn han_to_zen(text: String, ascii: bool, digit: bool, kana: bool) -> String

Arguments

rust use mojimoji_rs::zen_to_han; assert_eq!(han_to_zen("アイウabc012".to_string(), true, true, true), "アイウabc012".to_string()); assert_eq!(han_to_zen("アイウabc012".to_string(), true, true, false), "アイウabc012".to_string()); assert_eq!(han_to_zen("アイウabc012".to_string(), true, false, true), "アイウabc012".to_string()); assert_eq!(han_to_zen("アイウabc012".to_string(), false, true, true), "アイウabc012".to_string());