All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.util.chardet.LangHint Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy