]> granicus.if.org Git - icu/commitdiff
ICU-13194 RBBI safe table generation, all tests passing.
authorAndy Heninger <andy.heninger@gmail.com>
Mon, 2 Apr 2018 20:54:56 +0000 (20:54 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Mon, 2 Apr 2018 20:54:56 +0000 (20:54 +0000)
X-SVN-Rev: 41187

icu4j/main/classes/core/src/com/ibm/icu/text/RBBIDataWrapper.java
icu4j/main/classes/core/src/com/ibm/icu/text/RBBIRuleBuilder.java
icu4j/main/classes/core/src/com/ibm/icu/text/RBBIRuleScanner.java
icu4j/main/classes/core/src/com/ibm/icu/text/RBBITableBuilder.java

index 200f814fd49e3f8eeac58bfa4f10e00f5a267a85..22263c9cd78bd6b70601df83bc6ed98f2f3d7827 100644 (file)
@@ -352,7 +352,7 @@ public final class RBBIDataWrapper {
         }
 
         // Current position in the buffer.
-        int pos = 24 * 4;     // offset of end of header, which has 24 fields, all int32_t (4 bytes)
+        int pos = DH_SIZE * 4;     // offset of end of header, which has DH_SIZE fields, all int32_t (4 bytes)
 
         //
         // Read in the Forward state transition table as an array of shorts.
index 12e7b0e0b5886eb820b49cec00d9be583b0dd2aa..65bd1f77374a57b362607a7aa02d18dc9e2e2fe9 100644 (file)
@@ -43,8 +43,8 @@ class RBBIRuleBuilder {
     RBBINode[]         fTreeRoots = new RBBINode[4];
     static final int   fForwardTree = 0;  // Indexes into the above fTreeRoots array
     static final int   fReverseTree = 1;  //   for each of the trees.
-    static final int   fSafeFwdTree = 3;  //   (in C, these are pointer variables and
-    static final int   fSafeRevTree = 4;  //    there is no array.)
+    static final int   fSafeFwdTree = 2;  //   (in C, these are pointer variables and
+    static final int   fSafeRevTree = 3;  //    there is no array.)
     int fDefaultTree = fForwardTree;      // For rules not qualified with a !
                                           //   the tree to which they belong to.
 
@@ -59,7 +59,7 @@ class RBBIRuleBuilder {
                                           // longest match.
 
     RBBISetBuilder fSetBuilder;           // Set and Character Category builder.
-    List<RBBINode> fUSetNodes;            // Vector of all uset nodes.
+    List<RBBINode> fUSetNodes;            // Vector of all used nodes.
     RBBITableBuilder fForwardTable;       // State transition tables
 
     //
@@ -99,7 +99,7 @@ class RBBIRuleBuilder {
     /**< Syntax error in RBBI rule.                        */
 
     static final int U_BRK_UNCLOSED_SET = 0x10205;
-    /**< UnicodeSet witing an RBBI rule missing a closing ']'.  */
+    /**< UnicodeSet writing an RBBI rule missing a closing ']'.  */
 
     static final int U_BRK_ASSIGN_ERROR = 0x10206;
     /**< Syntax error in RBBI rule assignment statement.   */
index 8fb44c71a3f71f05fbcfa155c74d9908b7dd7315..5751e4183c4b8498d3aa94471398827c5a750137 100644 (file)
@@ -285,7 +285,7 @@ class RBBIRuleScanner {
             // All rule expressions are ORed together.
             // The ';' that terminates an expression really just functions as a
             // '|' with
-            //   a low operator prededence.
+            //   a low operator precedence.
             //
             // Each of the four sets of rules are collected separately.
             //  (forward, reverse, safe_forward, safe_reverse)
index a40a1bff46a73bcfef63515671be141ca830a52e..c511a5a16cebf54c800b43b2405a9fa7d2918dae 100644 (file)
@@ -1004,7 +1004,7 @@ class RBBITableBuilder {
         */
        void removeSafeState(int keepState, int duplState) {
            assert(keepState < duplState);
-           assert(duplState < fDStates.size());
+           assert(duplState < fSafeTable.size());
 
            fSafeTable.remove(duplState);
            int numStates = fSafeTable.size();