当前位置: 首页>>代码示例>>Java>>正文


Java UScript.JAPANESE属性代码示例

本文整理汇总了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;
        }
    }
}
 
开发者ID:jprante,项目名称:elasticsearch-icu,代码行数:23,代码来源:ScriptIterator.java

示例2: reflectWith

@Override
public void reflectWith(AttributeReflector reflector) {
    String name = code == UScript.JAPANESE ? "Chinese/Japanese" : getName();
    reflector.reflect(ScriptAttribute.class, "script", name);
}
 
开发者ID:jprante,项目名称:elasticsearch-plugin-bundle,代码行数:5,代码来源:ScriptAttributeImpl.java

示例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;
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:21,代码来源:ScriptIterator.java

示例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();
    }
}
 
开发者ID:jprante,项目名称:elasticsearch-icu,代码行数:8,代码来源:DefaultIcuTokenizerConfig.java

示例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);
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:ScriptAttributeImpl.java

示例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();
    }
}
 
开发者ID:jprante,项目名称:elasticsearch-analysis-german,代码行数:13,代码来源:DefaultICUTokenizerConfig.java

示例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();
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:9,代码来源:DefaultICUTokenizerConfig.java

示例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();
    }
}
 
开发者ID:jprante,项目名称:elasticsearch-plugin-bundle,代码行数:15,代码来源:DefaultIcuTokenizerConfig.java


注:本文中的com.ibm.icu.lang.UScript.JAPANESE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。