japanese

Crates.iojapanese
lib.rsjapanese
version0.1.2
sourcesrc
created_at2022-03-11 15:44:17.200023
updated_at2023-04-17 16:20:18.326156
descriptionRecognize the different Japanese scripts and convert between hiragana/katakana.
homepagehttps://github.com/mrahhal/rust-japanese
repositoryhttps://github.com/mrahhal/rust-japanese
max_upload_size
id548262
size20,452
Mohammad Rahhal (mrahhal)

documentation

https://docs.rs/japanese/latest/japanese/

README

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("キョービ") // -> きょうび
// ...
Commit count: 54

cargo fmt