예제 #1
0
 /// <summary>
 /// Test if input is kanji.
 /// </summary>
 /// <param name="input">Input.</param>
 /// <returns>A value indicating whether input is kanji.</returns>
 public static bool IsKanji(string input) => KanjiChecker.IsKanji(input);
예제 #2
0
 private static string GetTokenType(char character, bool compact = false)
 {
     if (compact)
     {
         if (IsJaNumber(character))
         {
             return(TokenTypes.Other);
         }
         if (IsEnNumber(character))
         {
             return(TokenTypes.Other);
         }
         if (IsEnSpace(character))
         {
             return(TokenTypes.English);
         }
         if (SpecialCharacterChecker.IsEnglishPunctuation(character))
         {
             return(TokenTypes.Other);
         }
         if (IsJaSpace(character))
         {
             return(TokenTypes.Japanese);
         }
         if (SpecialCharacterChecker.IsJapanesePunctuation(character))
         {
             return(TokenTypes.Other);
         }
         if (JapaneseChecker.IsJapanese(character))
         {
             return(TokenTypes.Japanese);
         }
         if (RomajiChecker.IsRomaji(character))
         {
             return(TokenTypes.English);
         }
     }
     else
     {
         if (IsJaSpace(character))
         {
             return(TokenTypes.Space);
         }
         if (IsEnSpace(character))
         {
             return(TokenTypes.Space);
         }
         if (IsJaNumber(character))
         {
             return(TokenTypes.JapaneseNumber);
         }
         if (IsEnNumber(character))
         {
             return(TokenTypes.EnglishNumber);
         }
         if (SpecialCharacterChecker.IsEnglishPunctuation(character))
         {
             return(TokenTypes.EnglishPunctuation);
         }
         if (SpecialCharacterChecker.IsJapanesePunctuation(character))
         {
             return(TokenTypes.JapanesePunctuation);
         }
         if (KanjiChecker.IsKanji(character))
         {
             return(TokenTypes.Kanji);
         }
         if (HiraganaChecker.IsHiragana(character))
         {
             return(TokenTypes.Hiragana);
         }
         if (KatakanaChecker.IsKatakana(character))
         {
             return(TokenTypes.Katakana);
         }
         if (JapaneseChecker.IsJapanese(character))
         {
             return(TokenTypes.Japanese);
         }
         if (RomajiChecker.IsRomaji(character))
         {
             return(TokenTypes.English);
         }
     }
     return(TokenTypes.Other);
 }
예제 #3
0
 /// <summary>
 /// Test if input is kanji.
 /// </summary>
 /// <param name="input">Input.</param>
 /// <returns>A value indicating whether input is kanji.</returns>
 public static bool IsKanji(char input) => KanjiChecker.IsKanji(input);