#script #charset #hiragana #katakana #convert #kanji #different

japanese

Recognize the different Japanese scripts and convert between hiragana/katakana

3 releases

0.1.2 Apr 17, 2023
0.1.1 Mar 11, 2022
0.1.0 Mar 11, 2022

#151 in Internationalization (i18n)

Download history 3/week @ 2024-06-19 38/week @ 2024-06-26 57/week @ 2024-07-03 16/week @ 2024-07-10 17/week @ 2024-07-17 10/week @ 2024-07-24 10/week @ 2024-07-31 51/week @ 2024-08-07 26/week @ 2024-09-04 80/week @ 2024-09-11 21/week @ 2024-09-18 19/week @ 2024-09-25

146 downloads per month

MIT license

19KB
435 lines

rust-japanese

CI Crate License

Recognize the different Japanese scripts and convert between hiragana/katakana.

Install

Add this to your Cargo.toml:

[dependencies]
japanese = "{version}"

Visit the crate page to copy the latest version.

Documentation

https://docs.rs/japanese

Usage

There are two primary modules you'll be using from this crate:

  • charset: Contains functions that detect different scripts (hiragana, katakana, kanji, jp punctuation, etc).
  • converter: Contains functions that convert between different scripts, in addition to other useful utilities.

charset

use japanese::charset;

charset::is_japanese('') // -> true
charset::is_japanese_punctuation('') // -> true
charset::is_hiragana_string("あまり") // -> true
// ...

converter

use japanese::converter;

converter::convert_hiragana_to_katakana_string("もん") // -> モン
converter::convert_katakana_to_hiragana_string("キョービ") // -> きょうび
// ...

Dependencies

~59KB