| Crates.io | mojimoji-rs |
| lib.rs | mojimoji-rs |
| version | 0.1.1 |
| created_at | 2022-05-16 11:23:39.921313+00 |
| updated_at | 2022-05-16 12:08:29.000672+00 |
| description | Rust implementation of a fast converter between Japanese hankaku and zenkaku characters, mojimoji. |
| homepage | |
| repository | https://github.com/europeanplaice/mojimoji-rs |
| max_upload_size | |
| id | 587598 |
| size | 25,637 |
Rust implementation of a fast converter between Japanese hankaku and zenkaku characters, mojimoji.
In Cargo.toml,
[dependencies]
mojimoji-rs = "*"
pub fn zen_to_han(text: String, ascii: bool, digit: bool, kana: bool) -> String
text - text to convert.ascii - indicates whether to convert ascii characters.digit - indicates whether to convert digits.kana - indicates whether to convert Japanese characters.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());
pub fn han_to_zen(text: String, ascii: bool, digit: bool, kana: bool) -> String
text - text to convert.ascii - indicates whether to convert ascii characters.digit - indicates whether to convert digits.kana - indicates whether to convert Japanese characters.use mojimoji_rs::han_to_zen;
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());