예제 #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);
     }
 }