本文整理汇总了Java中com.ibm.icu.lang.UScript.JAPANESE属性的典型用法代码示例。如果您正苦于以下问题:Java UScript.JAPANESE属性的具体用法?Java UScript.JAPANESE怎么用?Java UScript.JAPANESE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.ibm.icu.lang.UScript
的用法示例。
在下文中一共展示了UScript.JAPANESE属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScript
/**
* fast version of UScript.getScript(). Basic Latin is an array lookup
*/
private int getScript(int codepoint) {
if (0 <= codepoint && codepoint < basicLatin.length) {
return basicLatin[codepoint];
} else {
int script = UScript.getScript(codepoint);
if (combineCJ) {
if (script == UScript.HAN || script == UScript.HIRAGANA || script == UScript.KATAKANA) {
return UScript.JAPANESE;
} else if (codepoint >= 0xFF10 && codepoint <= 0xFF19) {
// when using CJK dictionary breaking, don't let full width numbers go to it, otherwise
// they are treated as punctuation. we currently have no cleaner way to fix this!
return UScript.LATIN;
} else {
return script;
}
} else {
return script;
}
}
}
示例2: reflectWith
@Override
public void reflectWith(AttributeReflector reflector) {
String name = code == UScript.JAPANESE ? "Chinese/Japanese" : getName();
reflector.reflect(ScriptAttribute.class, "script", name);
}
示例3: getScript
/** fast version of UScript.getScript(). Basic Latin is an array lookup */
private int getScript(int codepoint) {
if (0 <= codepoint && codepoint < basicLatin.length) {
return basicLatin[codepoint];
} else {
int script = UScript.getScript(codepoint);
if (combineCJ) {
if (script == UScript.HAN || script == UScript.HIRAGANA || script == UScript.KATAKANA) {
return UScript.JAPANESE;
} else if (codepoint >= 0xFF10 && codepoint <= 0xFF19) {
// when using CJK dictionary breaking, don't let full width numbers go to it, otherwise
// they are treated as punctuation. we currently have no cleaner way to fix this!
return UScript.LATIN;
} else {
return script;
}
} else {
return script;
}
}
}
示例4: getBreakIterator
@Override
public BreakIterator getBreakIterator(int script) {
switch(script) {
case UScript.KHMER: return (BreakIterator)khmerBreakIterator.clone();
case UScript.JAPANESE: return (BreakIterator)cjkBreakIterator.clone();
default: return (BreakIterator)defaultBreakIterator.clone();
}
}
示例5: reflectWith
@Override
public void reflectWith(AttributeReflector reflector) {
// when wordbreaking CJK, we use the 15924 code Japanese (Han+Hiragana+Katakana) to
// mark runs of Chinese/Japanese. our use is correct (as for chinese Han is a subset),
// but this is just to help prevent confusion.
String name = code == UScript.JAPANESE ? "Chinese/Japanese" : getName();
reflector.reflect(ScriptAttribute.class, "script", name);
}
示例6: getBreakIterator
@Override
public BreakIterator getBreakIterator(int script) {
switch (script) {
case UScript.KHMER:
return (BreakIterator) khmerBreakIterator.clone();
case UScript.MYANMAR:
return (BreakIterator) myanmarBreakIterator.clone();
case UScript.JAPANESE:
return (BreakIterator) cjkBreakIterator.clone();
default:
return (BreakIterator) defaultBreakIterator.clone();
}
}
示例7: getBreakIterator
@Override
public BreakIterator getBreakIterator(int script) {
switch(script) {
case UScript.KHMER: return (BreakIterator)khmerBreakIterator.clone();
case UScript.MYANMAR: return (BreakIterator)myanmarBreakIterator.clone();
case UScript.JAPANESE: return (BreakIterator)cjkBreakIterator.clone();
default: return (BreakIterator)defaultBreakIterator.clone();
}
}
示例8: getBreakIterator
@Override
public BreakIterator getBreakIterator(int script) {
switch (script) {
case UScript.MYANMAR:
if (myanmarAsWords) {
return (BreakIterator) defaultBreakIterator.clone();
} else {
return (BreakIterator) myanmarSyllableIterator.clone();
}
case UScript.JAPANESE:
return (BreakIterator) cjkBreakIterator.clone();
default:
return (BreakIterator) defaultBreakIterator.clone();
}
}