src/main/java/org/wltea/analyzer/core/CharacterUtil.java
static int identifyCharType(char input){
		if(input >= '0' && input <= '9'){
			return CHAR_ARABIC;
			
		}else if((input >= 'a' && input <= 'z')
				|| (input >= 'A' && input <= 'Z')){
			return CHAR_ENGLISH;
			
		}else {
			Character.UnicodeBlock ub = Character.UnicodeBlock.of(input);
			
			if(ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS  
					|| ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS  
					|| ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A){
				//目前已知的中文字符UTF-8集合
				return CHAR_CHINESE;
				
			}else if(ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS //全角数字字符和日韩字符
					//韩文字符集
					|| ub == Character.UnicodeBlock.HANGUL_SYLLABLES 
					|| ub == Character.UnicodeBlock.HANGUL_JAMO
					|| ub == Character.UnicodeBlock.HANGUL_COMPATIBILITY_JAMO
					//日文字符集
					|| ub == Character.UnicodeBlock.HIRAGANA //平假名
					|| ub == Character.UnicodeBlock.KATAKANA //片假名
					|| ub == Character.UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS){
				return CHAR_OTHER_CJK;
				
			}
		}
		//其他的不做处理的字符
		return CHAR_USELESS;
	}
static int identifyCharType(char input){
		if(input >= '0' && input <= '9'){
			return CHAR_ARABIC;
			
		}else if((input >= 'a' && input <= 'z')
				|| (input >= 'A' && input <= 'Z')){
			return CHAR_ENGLISH;
			
		}else {
			Character.UnicodeBlock ub = Character.UnicodeBlock.of(input);
			
			if(ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS  
					|| ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS  
					|| ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A){
				//目前已知的中文字符UTF-8集合
				return CHAR_CHINESE;
				
			}else if(ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS //全角数字字符和日韩字符
					//韩文字符集
					|| ub == Character.UnicodeBlock.HANGUL_SYLLABLES 
					|| ub == Character.UnicodeBlock.HANGUL_JAMO
					|| ub == Character.UnicodeBlock.HANGUL_COMPATIBILITY_JAMO
					//日文字符集
					|| ub == Character.UnicodeBlock.HIRAGANA //平假名
					|| ub == Character.UnicodeBlock.KATAKANA //片假名
					|| ub == Character.UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS){
				return CHAR_OTHER_CJK;
				
			}
		}
		//其他的不做处理的字符
		return CHAR_USELESS;
	}
static int identifyCharType ( char input ) { if ( input >= ' ' && input <= ' ' ) { return CHAR_ARABIC ; } else if ( ( input >= ' ' && input <= ' ' ) || ( input >= ' ' && input <= ' ' ) ) { return CHAR_ENGLISH ; } else { Character . UnicodeBlock ub = Character . UnicodeBlock . of ( input ) ; if ( ub == Character . UnicodeBlock . CJK_UNIFIED_IDEOGRAPHS || ub == Character . UnicodeBlock . CJK_COMPATIBILITY_IDEOGRAPHS || ub == Character . UnicodeBlock . CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A ) { //目前已知的中文字符UTF-8集合
 return CHAR_CHINESE ; } else if ( ub == Character . UnicodeBlock . HALFWIDTH_AND_FULLWIDTH_FORMS //全角数字字符和日韩字符
 //韩文字符集
 || ub == Character . UnicodeBlock . HANGUL_SYLLABLES || ub == Character . UnicodeBlock . HANGUL_JAMO || ub == Character . UnicodeBlock . HANGUL_COMPATIBILITY_JAMO //日文字符集
 || ub == Character . UnicodeBlock . HIRAGANA //平假名
 || ub == Character . UnicodeBlock . KATAKANA //片假名
 || ub == Character . UnicodeBlock . KATAKANA_PHONETIC_EXTENSIONS ) { return CHAR_OTHER_CJK ; } } //其他的不做处理的字符
 return CHAR_USELESS ; }
识别字符类型
@param input
@return int CharacterUtil定义的字符类型常量
识别字符类型