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


Java UCharacter.getIntPropertyValue方法代码示例

本文整理汇总了Java中com.ibm.icu.lang.UCharacter.getIntPropertyValue方法的典型用法代码示例。如果您正苦于以下问题:Java UCharacter.getIntPropertyValue方法的具体用法?Java UCharacter.getIntPropertyValue怎么用?Java UCharacter.getIntPropertyValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.icu.lang.UCharacter的用法示例。


在下文中一共展示了UCharacter.getIntPropertyValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handles

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
public boolean handles(int c, int breakType) {
    if (breakType == BreakIterator.KIND_WORD || breakType == BreakIterator.KIND_LINE) {
        int script = UCharacter.getIntPropertyValue(c, UProperty.SCRIPT);
        return (script == UScript.KHMER);
    }
    return false;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:8,代码来源:KhmerBreakEngine.java

示例2: handles

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
@Override
public boolean handles(int c, int breakType) {
    if (breakType == BreakIterator.KIND_WORD || breakType == BreakIterator.KIND_LINE) {
        int script = UCharacter.getIntPropertyValue(c, UProperty.SCRIPT);
        return (script == UScript.MYANMAR);
    }
    return false;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:9,代码来源:BurmeseBreakEngine.java

示例3: handleChar

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
public synchronized void handleChar(int c, int breakType) {
    if (breakType >= 0 && breakType < fHandled.length && c != DONE32) {
        if (!fHandled[breakType].contains(c)) {
            int script = UCharacter.getIntPropertyValue(c, UProperty.SCRIPT);
            fHandled[breakType].applyIntPropertyValue(UProperty.SCRIPT, script);
        }
    }
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:9,代码来源:UnhandledBreakEngine.java

示例4: handles

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
public boolean handles(int c, int breakType) {
    if (breakType == BreakIterator.KIND_WORD || breakType == BreakIterator.KIND_LINE) {
        int script = UCharacter.getIntPropertyValue(c, UProperty.SCRIPT);
        return (script == UScript.LAO);
    }
    return false;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:8,代码来源:LaoBreakEngine.java

示例5: handles

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
public boolean handles(int c, int breakType) {
    if (breakType == BreakIterator.KIND_WORD || breakType == BreakIterator.KIND_LINE) {
        int script = UCharacter.getIntPropertyValue(c, UProperty.SCRIPT);
        return (script == UScript.THAI);
    }
    return false;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:8,代码来源:ThaiBreakEngine.java

示例6: calcChainedFollowPos

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
void calcChainedFollowPos(RBBINode tree) {

           List<RBBINode> endMarkerNodes = new ArrayList<RBBINode>();
           List<RBBINode> leafNodes      = new ArrayList<RBBINode>();

            // get a list of all endmarker nodes.
           tree.findNodes(endMarkerNodes, RBBINode.endMark);

           // get a list all leaf nodes
           tree.findNodes(leafNodes, RBBINode.leafChar);

           // Collect all leaf nodes that can start matches for rules
           // with inbound chaining enabled, which is the union of the
           // firstPosition sets from each of the rule root nodes.

           List<RBBINode> ruleRootNodes = new ArrayList<RBBINode>();
           addRuleRootNodes(ruleRootNodes, tree);

           Set<RBBINode> matchStartNodes = new HashSet<RBBINode>();
           for (RBBINode node: ruleRootNodes) {
               if (node.fChainIn) {
                   matchStartNodes.addAll(node.fFirstPosSet);
               }
           }

           // Iterate over all leaf nodes,
           //
           for (RBBINode tNode : leafNodes) {
               RBBINode endNode = null;

               // Identify leaf nodes that correspond to overall rule match positions.
               //   These include an endMarkerNode in their followPos sets.
               for (RBBINode endMarkerNode : endMarkerNodes) {
                   if (tNode.fFollowPos.contains(endMarkerNode)) {
                       endNode = tNode;
                       break;
                   }
               }
               if (endNode == null) {
                   // node wasn't an end node.  Try again with the next.
                   continue;
               }

               // We've got a node that can end a match.

               // Line Break Specific hack:  If this node's val correspond to the $CM char class,
               //                            don't chain from it.
               // TODO:  Add rule syntax for this behavior, get specifics out of here and
               //        into the rule file.
               if (fRB.fLBCMNoChain) {
                   int c = this.fRB.fSetBuilder.getFirstChar(endNode.fVal);
                   if (c != -1) {
                       // c == -1 occurs with sets containing only the {eof} marker string.
                       int cLBProp = UCharacter.getIntPropertyValue(c, UProperty.LINE_BREAK);
                       if (cLBProp == UCharacter.LineBreak.COMBINING_MARK) {
                           continue;
                       }
                   }
               }


               // Now iterate over the nodes that can start a match, looking for ones
               //   with the same char class as our ending node.
               for (RBBINode startNode : matchStartNodes) {
                   if (startNode.fType != RBBINode.leafChar) {
                       continue;
                   }

                   if (endNode.fVal == startNode.fVal) {
                       // The end val (character class) of one possible match is the
                       //   same as the start of another.

                       // Add all nodes from the followPos of the start node to the
                       //  followPos set of the end node, which will have the effect of
                       //  letting matches transition from a match state at endNode
                       //  to the second char of a match starting with startNode.
                       endNode.fFollowPos.addAll(startNode.fFollowPos);
                   }
               }
           }
       }
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:82,代码来源:RBBITableBuilder.java

示例7: contains

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
@Override
public boolean contains(int ch) {
    return UCharacter.getIntPropertyValue(ch, prop) == value;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:5,代码来源:UnicodeSet.java

示例8: getLanguageBreakEngine

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
private LanguageBreakEngine getLanguageBreakEngine(int c) {

        // We have a dictionary character.
        // Does an already instantiated break engine handle it?
        for (LanguageBreakEngine candidate : fBreakEngines.values()) {
            if (candidate.handles(c, fBreakType)) {
                return candidate;
            }
        }

        // if we don't have an existing engine, build one.
        int script = UCharacter.getIntPropertyValue(c, UProperty.SCRIPT);
        if (script == UScript.KATAKANA || script == UScript.HIRAGANA) {
            // Katakana, Hiragana and Han are handled by the same dictionary engine.
            // Fold them together for mapping from script -> engine.
            script = UScript.HAN;
        }

        LanguageBreakEngine eng = fBreakEngines.get(script);
        /*
        if (eng != null && !eng.handles(c, fBreakType)) {
            fUnhandledBreakEngine.handleChar(c, getBreakType());
            eng = fUnhandledBreakEngine;
        } else  */  {
            try {
                switch (script) {
                case UScript.THAI:
                    eng = new ThaiBreakEngine();
                    break;
                case UScript.LAO:
                    eng = new LaoBreakEngine();
                    break;
                case UScript.MYANMAR:
                    eng = new BurmeseBreakEngine();
                    break;
                case UScript.KHMER:
                    eng = new KhmerBreakEngine();
                    break;
                case UScript.HAN:
                    if (getBreakType() == KIND_WORD) {
                        eng = new CjkBreakEngine(false);
                    }
                    else {
                        fUnhandledBreakEngine.handleChar(c, getBreakType());
                        eng = fUnhandledBreakEngine;
                    }
                    break;
                case UScript.HANGUL:
                    if (getBreakType() == KIND_WORD) {
                        eng = new CjkBreakEngine(true);
                    } else {
                        fUnhandledBreakEngine.handleChar(c, getBreakType());
                        eng = fUnhandledBreakEngine;
                    }
                    break;
                default:
                    fUnhandledBreakEngine.handleChar(c, getBreakType());
                    eng = fUnhandledBreakEngine;
                    break;
                }
            } catch (IOException e) {
                eng = null;
            }
        }

        if (eng != null && eng != fUnhandledBreakEngine) {
            LanguageBreakEngine existingEngine = fBreakEngines.putIfAbsent(script, eng);
            if (existingEngine != null) {
                // There was a race & another thread was first to register an engine for this script.
                // Use theirs and discard the one we just created.
                eng = existingEngine;
            }
            // assert eng.handles(c, fBreakType);
        }
        return eng;
    }
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:77,代码来源:RuleBasedBreakIterator.java

示例9: has

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
public boolean has(int codePoint, int value) {
    return UCharacter.getIntPropertyValue(codePoint, propertyId) == value;
}
 
开发者ID:anba,项目名称:es6draft,代码行数:4,代码来源:UnicodeData.java


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