public static byte getType(int ch) {switch (Character.getType(ch)) {case Character.UPPERCASE_LETTER: return UPPER;case Character.LOWERCASE_LETTER: return LOWER;case Character.TITLECASE_LETTER:case Character.MODIFIER_LETTER:case Character.OTHER_LETTER:case Character.NON_SPACING_MARK:case Character.ENCLOSING_MARK:  case Character.COMBINING_SPACING_MARK:return ALPHA;case Character.DECIMAL_DIGIT_NUMBER:case Character.LETTER_NUMBER:case Character.OTHER_NUMBER:return DIGIT;case Character.SURROGATE:  return ALPHA|DIGIT;default: return SUBWORD_DELIM;}}

public static byte GetType(int ch){switch (CharUnicodeInfo.GetUnicodeCategory((char)ch)){case UnicodeCategory.UppercaseLetter:return WordDelimiterFilter.UPPER;case UnicodeCategory.LowercaseLetter:return WordDelimiterFilter.LOWER;case UnicodeCategory.TitlecaseLetter:case UnicodeCategory.ModifierLetter:case UnicodeCategory.OtherLetter:case UnicodeCategory.NonSpacingMark:case UnicodeCategory.EnclosingMark: case UnicodeCategory.SpacingCombiningMark:return WordDelimiterFilter.ALPHA;case UnicodeCategory.DecimalDigitNumber:case UnicodeCategory.LetterNumber:case UnicodeCategory.OtherNumber:return WordDelimiterFilter.DIGIT;case UnicodeCategory.Surrogate:return WordDelimiterFilter.ALPHA | WordDelimiterFilter.DIGIT;default:return WordDelimiterFilter.SUBWORD_DELIM;}}
