]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/rbbisetb.h
ICU-62108.0.1.tar.gz
[apple/icu.git] / icuSources / common / rbbisetb.h
index a7d1e7af3bcfb217596f2d5a95cadc6e2d727fb9..ed6a76b12146214e8be6d14d8d82afac43169090 100644 (file)
 #define RBBISETB_H
 
 #include "unicode/utypes.h"
+
+#if !UCONFIG_NO_BREAK_ITERATION
+
 #include "unicode/uobject.h"
 #include "rbbirb.h"
+#include "utrie2.h"
 #include "uvector.h"
 
-struct  UNewTrie;
-
 U_NAMESPACE_BEGIN
 
 //
@@ -80,7 +82,8 @@ public:
     RBBISetBuilder(RBBIRuleBuilder *rb);
     ~RBBISetBuilder();
 
-    void     build();
+    void     buildRanges();
+    void     buildTrie();
     void     addValToSets(UVector *sets,      uint32_t val);
     void     addValToSet (RBBINode *usetNode, uint32_t val);
     int32_t  getNumCharCategories() const;   // CharCategories are the same as input symbol set to the
@@ -91,6 +94,15 @@ public:
     UChar32  getFirstChar(int32_t  val) const;
     UBool    sawBOF() const;                 // Indicate whether any references to the {bof} pseudo
                                              //   character were encountered.
+    /**
+     * Merge two character categories that have been identified as having equivalent behavior.
+     * The ranges belonging to the second category (table column) will be added to the first.
+     * @param categories the pair of categories to be merged.
+     */
+    void     mergeCategories(IntPair categories);
+
+    static constexpr int32_t DICT_BIT = 0x4000;
+
 #ifdef RBBI_DEBUG
     void     printSets();
     void     printRanges();
@@ -109,8 +121,8 @@ private:
 
     RangeDescriptor       *fRangeList;      // Head of the linked list of RangeDescriptors
 
-    UNewTrie              *fTrie;           // The mapping TRIE that is the end result of processing
-    uint32_t              fTrieSize;        //  the Unicode Sets.
+    UTrie2                *fTrie;           // The mapping TRIE that is the end result of processing
+    uint32_t               fTrieSize;       //  the Unicode Sets.
 
     // Groups correspond to character categories -
     //       groups of ranges that are in the same original UnicodeSets.
@@ -129,4 +141,7 @@ private:
 
 
 U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
+
 #endif