Crate to_kana

Source
Expand description

English lettering to Kana converter. Please see the wiki to view supported inputs.

§Examples

use to_kana::to_kana;

let hello_world = to_kana!("{:H}{:K}", "konnichiha,", "wa-rudo!").unwrap();
assert_eq!("こんにちは、ワールド!", hello_world);
use to_kana::ToKana;

let hello = "konnichiha,".hira().unwrap(); // Works on &str
let world = String::from("wa-rudo!").kata().unwrap(); // And String!

assert_eq!("こんにちは、ワールド!", format!("{}{}", hello, world));
use to_kana::{
    hira, // Hiragana
    kata, // Katakana
};

let hello = hira("konnichiha,").unwrap();
let world = kata("wa-rudo!").unwrap();

assert_eq!("こんにちは、ワールド!", format!("{}{}", hello, world));
use to_kana::{
    ToKana,
    SmallKana,
    HalfWidth,
};

assert_eq!("ャ", "ya".kata().small().half_width().unwrap());

Modules§

fmt

Macros§

to_kana
Functions similarly to format!, except it converts args to Hiragana and Katakana.

Traits§

HalfWidth
Defines a type as being able to convert to half-width katakana.
SmallKana
Defines a type as being able to convert to small kana.
ToKana
Trait to make a type translatable to kana

Functions§

hira
Converts an English alphabet string to Hiragana
kata
Converts an English alphabet string to Katakana

Type Aliases§

Error
The type inside Result::Err returned by this library’s functions
Result
The Result type returned by this library’s functions