コード例 #1
0
ファイル: Kakasi.cs プロジェクト: sasaji/NKakasi
 private IConverter CreateKanjiConverter(CharacterSet characterSet)
 {
     if (characterSet.Equals(CharacterSet.ASCII))
     {
         return(new CompoundConverter(CreateKanjiConverter(CharacterSet.HIRAGANA), CreateHiraganaConverter(CharacterSet.ASCII)));
     }
     else if (characterSet.Equals(CharacterSet.KANJI))
     {
         return(new DelegateConverter(kanjiConverterImpl.ToKanji));
     }
     else if (characterSet.Equals(CharacterSet.HIRAGANA))
     {
         return(new DelegateConverter(kanjiConverterImpl.ToHiragana));
     }
     else if (characterSet.Equals(CharacterSet.KATAKANA))
     {
         return(new CompoundConverter(CreateKanjiConverter(CharacterSet.HIRAGANA), CreateHiraganaConverter(CharacterSet.KATAKANA)));
     }
     else if (characterSet.Equals(CharacterSet.HALFKANA))
     {
         return(new CompoundConverter(CreateKanjiConverter(CharacterSet.HIRAGANA), CreateHiraganaConverter(CharacterSet.HALFKANA)));
     }
     else
     {
         return(null);
     }
 }
コード例 #2
0
ファイル: Kakasi.cs プロジェクト: sasaji/NKakasi
 private IConverter CreateKatakanaConverter(CharacterSet characterSet)
 {
     if (characterSet.Equals(CharacterSet.ASCII))
     {
         return(new DelegateConverter(kanaToRomanConverterImpl.ConvertKatakana));
     }
     else if (characterSet.Equals(CharacterSet.HIRAGANA))
     {
         return(new DelegateConverter(katakanaConverterImpl.ToHiragana));
     }
     else if (characterSet.Equals(CharacterSet.KATAKANA))
     {
         return(new DelegateConverter(katakanaConverterImpl.ToKatakana));
     }
     else
     {
         return(null);
     }
 }