public void IsJapanesePunctuationAllJapanesePunctuationsAreRecognized() { foreach (var range in CharacterRanges.JapanesePunctuationRanges) { for (char character = range.Start; character <= range.End; character++) { Assert.True(SpecialCharacterChecker.IsJapanesePunctuation(character)); } } }
public void IsJapanesePunctuationAllEnglishPunctuationsAreInvalid() { foreach (var range in CharacterRanges.EnglishPunctuationRanges) { for (char character = range.Start; character <= range.End; character++) { Assert.False(SpecialCharacterChecker.IsJapanesePunctuation(character)); } } }
public void IsJapanesePunctuationVarious(char character, bool expectedResult) { Assert.Equal(expectedResult, SpecialCharacterChecker.IsJapanesePunctuation(character)); }
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); }