public void Wagahai_HiraganaKatakana_HankakuZenkaku_Test() { Bench(ExampleText.WAGAHAI, 10, new[] { new Pair <string, Func <string, string> >("StrConv", targetText => { var s = Strings.StrConv(targetText, VbStrConv.Hiragana, 0x411); s = Strings.StrConv(s, VbStrConv.Katakana, 0x411); s = Strings.StrConv(s, VbStrConv.Narrow, 0x411); return(Strings.StrConv(s, VbStrConv.Wide, 0x411)); }), new Pair <string, Func <string, string> >("kanaxs", targetText => { var s = Kana.ToHiragana(targetText); s = Kana.ToKatakana(s); s = Kana.ToHankakuKana(s); return(Kana.ToZenkakuKana(s)); }), new Pair <string, Func <string, string> >("Kanaria", targetText => { return(UcsString.From(targetText) .Hiragana() .Katakana() .Narrow() .Wide() .ToString()); }), }); }
public static string toHiragana(string s) { s = Kana.ToHiragana(s); s = toNormalizedHyphen(s); return(s); }
/// <summary> /// 全角を半角、カタカナをひらがな、大文字を小文字、に変換した文字列を返却します /// </summary> /// <param name="str">対象の文字列</param> /// <returns>変換後の文字列</returns> private static string ToComparable(this string value) { return(Kana.ToHiragana(Kana.ToHankaku(value.ToLower()))); }