當前位置: 首頁>>代碼示例>>Java>>正文


Java UnicodeBlock.HANGUL_JAMO屬性代碼示例

本文整理匯總了Java中java.lang.Character.UnicodeBlock.HANGUL_JAMO屬性的典型用法代碼示例。如果您正苦於以下問題:Java UnicodeBlock.HANGUL_JAMO屬性的具體用法?Java UnicodeBlock.HANGUL_JAMO怎麽用?Java UnicodeBlock.HANGUL_JAMO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.lang.Character.UnicodeBlock的用法示例。


在下文中一共展示了UnicodeBlock.HANGUL_JAMO屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setCharacterSubsets

/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:78,代碼來源:WInputMethod.java

示例2: symbolParsing

private boolean symbolParsing(Lattice lattice, char jaso, int idx) {

        Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.of(jaso);
        //숫자
        if (Character.isDigit(jaso)) {
            return false;
        } else if (unicodeBlock == Character.UnicodeBlock.BASIC_LATIN) {
            //영어
            if (((jaso >= 'A') && (jaso <= 'Z')) || ((jaso >= 'a') && (jaso <= 'z'))) {
                return false;
            } else if (this.resources.getObservation().getTrieDictionary().getValue("" + jaso) != null) {
                return false;
            } else if (jaso == ' ') {
                return false;
            }
            //아스키 코드 범위 내에 사전에 없는 경우에는 기타 문자
            else {
                lattice.put(idx, idx + 1, "" + jaso, SYMBOL.SW, this.resources.getTable().getId(SYMBOL.SW), SCORE.SW);
                return true;
            }
        }
        //한글
        else if (unicodeBlock == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO
                || unicodeBlock == UnicodeBlock.HANGUL_JAMO
                || unicodeBlock == UnicodeBlock.HANGUL_JAMO_EXTENDED_A
                || unicodeBlock == UnicodeBlock.HANGUL_JAMO_EXTENDED_B
                || unicodeBlock == UnicodeBlock.HANGUL_SYLLABLES) {
            return false;
        }
        //일본어
        else if (unicodeBlock == UnicodeBlock.KATAKANA
                || unicodeBlock == UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS) {
            return false;
        }
        //중국어
        else if (UnicodeBlock.CJK_COMPATIBILITY.equals(unicodeBlock)
                || UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS.equals(unicodeBlock)
                || UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A.equals(unicodeBlock)
                || UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B.equals(unicodeBlock)
                || UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS.equals(unicodeBlock)) {
            return false;
        }
        //그 외 문자인 경우
        else {
            lattice.put(idx, idx + 1, "" + jaso, SYMBOL.SW, this.resources.getTable().getId(SYMBOL.SW), SCORE.SW);
            return true;
        }
    }
 
開發者ID:shin285,項目名稱:KOMORAN,代碼行數:48,代碼來源:Komoran.java

示例3: setCharacterSubsets

/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
開發者ID:openjdk,項目名稱:jdk7-jdk,代碼行數:77,代碼來源:WInputMethod.java

示例4: symbolParsing

/**
 * 입력된 문자로부터 symbol을 구분하여 lattice에 삽입
 * @param in
 * @param i
 */
private void symbolParsing(String in, int i) {
	char ch = in.charAt(i);
	Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.of(ch);
	//숫자
	if(Character.isDigit(ch)){
		
	}
	else if(unicodeBlock == Character.UnicodeBlock.BASIC_LATIN){
		//영어
		if (((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'))) {
			;
		}
		else if(observation.getTrieDictionary().get(ch) != null){
			;
		}
		//symbol
		else{
			this.lattice.put(i, i+1, ""+ch, this.table.getId(SYMBOL.SW), SCORE.SW);
		}
	}
	//한글
	else if(unicodeBlock == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO 
			|| unicodeBlock == UnicodeBlock.HANGUL_JAMO
			|| unicodeBlock == UnicodeBlock.HANGUL_JAMO_EXTENDED_A
			||unicodeBlock == UnicodeBlock.HANGUL_JAMO_EXTENDED_B
			||unicodeBlock == UnicodeBlock.HANGUL_SYLLABLES){
		;
	}
	//일본어
	else if(unicodeBlock == UnicodeBlock.KATAKANA
			|| unicodeBlock == UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS){
		
	}
	//중국어
	else if(UnicodeBlock.CJK_COMPATIBILITY.equals(unicodeBlock)				
			|| UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS.equals(unicodeBlock)
			|| UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A.equals(unicodeBlock)
			|| UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B.equals(unicodeBlock)
			|| UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS.equals(unicodeBlock)){
		;
	}
	else{
		this.lattice.put(i, i+1, ""+ch, this.table.getId(SYMBOL.SW), SCORE.SW);
	}
}
 
開發者ID:shineware,項目名稱:komoran-2.0,代碼行數:50,代碼來源:Komoran.java

示例5: isKoreanUnicodeBlock

private static boolean isKoreanUnicodeBlock(UnicodeBlock unicodeBlock) {
    return unicodeBlock == UnicodeBlock.HANGUL_SYLLABLES ||
            unicodeBlock == UnicodeBlock.HANGUL_JAMO ||
            unicodeBlock == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO;
}
 
開發者ID:SilentCircle,項目名稱:silent-contacts-android,代碼行數:5,代碼來源:NameSplitter.java


注:本文中的java.lang.Character.UnicodeBlock.HANGUL_JAMO屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。