panda.util.chardet.LangHint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-core Show documentation
Show all versions of panda-core Show documentation
Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.
package panda.util.chardet;
import panda.lang.Strings;
/**
*
*
*/
public enum LangHint {
ALL,
JAPANESE,
CHINESE,
SIMPLIFIED_CHINESE,
TRADITIONAL_CHINESE,
KOREAN;
public static LangHint parse(String hint) {
if (Strings.isNotEmpty(hint)) {
char c = Character.toUpperCase(hint.charAt(0));
switch (c) {
case 'J':
return JAPANESE;
case 'C':
case 'Z':
return CHINESE;
case 'S':
return SIMPLIFIED_CHINESE;
case 'T':
return TRADITIONAL_CHINESE;
case 'K':
return KOREAN;
}
}
return ALL;
}
}