1 /*
2 *******************************************************************************
3 * Copyright (C) 2012-2014, International Business Machines
4 * Corporation and others.  All Rights Reserved.
5 *******************************************************************************
6 * CollationFCD.java, ported from collationfcd.h/.cpp
7 *
8 * C++ version created on: 2012aug18
9 * created by: Markus W. Scherer
10 */
11 
12 package com.ibm.icu.impl.coll;
13 
14 import com.ibm.icu.text.UTF16;
15 
16 /**
17  * Data and functions for the FCD check fast path.
18  *
19  * The fast path looks at a pair of 16-bit code units and checks
20  * whether there is an FCD boundary between them;
21  * there is if the first unit has a trailing ccc=0 (!hasTccc(first))
22  * or the second unit has a leading ccc=0 (!hasLccc(second)),
23  * or both.
24  * When the fast path finds a possible non-boundary,
25  * then the FCD check slow path looks at the actual sequence of FCD values.
26  *
27  * This is a pure optimization.
28  * The fast path must at least find all possible non-boundaries.
29  * If the fast path is too pessimistic, it costs performance.
30  *
31  * For a pair of BMP characters, the fast path tests are precise (1 bit per character).
32  *
33  * For a supplementary code point, the two units are its lead and trail surrogates.
34  * We set hasTccc(lead)=true if any of its 1024 associated supplementary code points
35  * has lccc!=0 or tccc!=0.
36  * We set hasLccc(trail)=true for all trail surrogates.
37  * As a result, we leave the fast path if the lead surrogate might start a
38  * supplementary code point that is not FCD-inert.
39  * (So the fast path need not detect that there is a surrogate pair,
40  * nor look ahead to the next full code point.)
41  *
42  * hasLccc(lead)=true if any of its 1024 associated supplementary code points
43  * has lccc!=0, for fast boundary checking between BMP & supplementary.
44  *
45  * hasTccc(trail)=false:
46  * It should only be tested for unpaired trail surrogates which are FCD-inert.
47  */
48 public final class CollationFCD {
hasLccc(int c)49     public static boolean hasLccc(int c) {
50         assert c <= 0xffff;
51         // c can be negative, e.g., Collation.SENTINEL_CP from UCharIterator;
52         // that is handled in the first test.
53         int i;
54         return
55             // U+0300 is the first character with lccc!=0.
56             c >= 0x300 &&
57             (i = lcccIndex[c >> 5]) != 0 &&
58             (lcccBits[i] & (1 << (c & 0x1f))) != 0;
59     }
60 
hasTccc(int c)61     public static boolean hasTccc(int c) {
62         assert c <= 0xffff;
63         // c can be negative, e.g., Collation.SENTINEL_CP from UCharIterator;
64         // that is handled in the first test.
65         int i;
66         return
67             // U+00C0 is the first character with tccc!=0.
68             c >= 0xc0 &&
69             (i = tcccIndex[c >> 5]) != 0 &&
70             (tcccBits[i] & (1 << (c & 0x1f))) != 0;
71     }
72 
mayHaveLccc(int c)73     static boolean mayHaveLccc(int c) {
74         // Handles all of Unicode 0..10FFFF.
75         // c can be negative, e.g., Collation.SENTINEL_CP.
76         // U+0300 is the first character with lccc!=0.
77         if(c < 0x300) { return false; }
78         if(c > 0xffff) { c = UTF16.getLeadSurrogate(c); }
79         int i;
80         return
81             (i = lcccIndex[c >> 5]) != 0 &&
82             (lcccBits[i] & (1 << (c & 0x1f))) != 0;
83     }
84 
85     /**
86      * Tibetan composite vowel signs (U+0F73, U+0F75, U+0F81)
87      * must be decomposed before reaching the core collation code,
88      * or else some sequences including them, even ones passing the FCD check,
89      * do not yield canonically equivalent results.
90      *
91      * This is a fast and imprecise test.
92      *
93      * @param c a code point
94      * @return true if c is U+0F73, U+0F75 or U+0F81 or one of several other Tibetan characters
95      */
maybeTibetanCompositeVowel(int c)96     static boolean maybeTibetanCompositeVowel(int c) {
97         return (c & 0x1fff01) == 0xf01;
98     }
99 
100     /**
101      * Tibetan composite vowel signs (U+0F73, U+0F75, U+0F81)
102      * must be decomposed before reaching the core collation code,
103      * or else some sequences including them, even ones passing the FCD check,
104      * do not yield canonically equivalent results.
105      *
106      * They have distinct lccc/tccc combinations: 129/130 or 129/132.
107      *
108      * @param fcd16 the FCD value (lccc/tccc combination) of a code point
109      * @return true if fcd16 is from U+0F73, U+0F75 or U+0F81
110      */
isFCD16OfTibetanCompositeVowel(int fcd16)111     static boolean isFCD16OfTibetanCompositeVowel(int fcd16) {
112         return fcd16 == 0x8182 || fcd16 == 0x8184;
113     }
114 
115     // CollationFCD();  // No instantiation.
116 
117     // TODO: machine-generate by: icu/tools/unicode/c/genuca/genuca.cpp
118 
119     private static final byte[] lcccIndex={
120 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
121 0,0,0,0,0,0,0,0,1,1,2,3,0,0,0,0,
122 0,0,0,0,4,0,0,0,0,0,0,0,5,6,7,0,
123 8,0,9,0xa,0,0,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0x10,
124 0x11,0x12,0x13,0,0,0,0,0x14,0,0x15,0x16,0,0,0x15,0x17,0,
125 0,0x15,0x17,0,0,0x15,0x17,0,0,0x15,0x17,0,0,0,0x17,0,
126 0,0,0x18,0,0,0x15,0x17,0,0,0,0x17,0,0,0,0x19,0,
127 0,0x1a,0x1b,0,0,0x1c,0x1b,0,0x1c,0x1d,0,0x1e,0x1f,0,0x20,0,
128 0,0x21,0,0,0x17,0,0,0,0,0,0,0,0,0,0,0,
129 0,0,0,0,0,0,0,0,0,0,0x22,0,0,0,0,0,
130 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
131 0,0,0,0,0,0,0,0,0x23,0x23,0,0,0,0,0x24,0,
132 0,0,0,0,0,0x25,0,0,0,0x13,0,0,0,0,0,0,
133 0x26,0,0,0x27,0,0x28,0,0,0,0x23,0x29,0x10,0,0x2a,0,0x2b,
134 0,0x2c,0,0,0,0,0x2d,0x2e,0,0,0,0,0,0,1,0x2f,
135 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
136 0,0,0,0,0,0,0x30,0x31,0,0,0,0,0,0,0,0,
137 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
138 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
139 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
140 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
141 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
142 0,0,0,0,0,0,0,0x32,0,0,0,0x33,0,0,0,1,
143 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
144 0,0x34,0,0,0x35,0,0,0,0,0,0,0,0,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1,1,1,1,1,1,1,1,1,
232 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
233 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
234 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
235 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
236 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
237 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
238 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
239 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
240 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
241 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
242 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
243 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
244 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
245 0,0,0,0,0,0,0,0,0x41,0,0,0,0,0,0,0,
246 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
247 0,0x42,0,0,0,0,0,0,0,0,0,0,0,0,0,0
248 };
249 
250     private static final byte[] tcccIndex={
251 0,0,0,0,0,0,2,3,4,5,6,7,0,8,9,0xa,
252 0xb,0xc,0,0,0,0,0,0,1,1,0xd,0xe,0xf,0x10,0x11,0,
253 0x12,0x13,0x14,0x15,0x16,0,0x17,0x18,0,0,0,0,0x19,0x1a,0x1b,0,
254 0x1c,0x1d,0x1e,0x1f,0,0,0x20,0x21,0x22,0x23,0x24,0,0,0,0,0x25,
255 0x26,0x27,0x28,0,0,0,0,0x29,0,0x2a,0x2b,0,0,0x2c,0x2d,0,
256 0,0x2e,0x2f,0,0,0x2c,0x30,0,0,0x2c,0x31,0,0,0,0x30,0,
257 0,0,0x32,0,0,0x2c,0x30,0,0,0,0x30,0,0,0,0x33,0,
258 0,0x34,0x35,0,0,0x36,0x35,0,0x36,0x37,0,0x38,0x39,0,0x3a,0,
259 0,0x3b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0,0,0,0,0,0,
372 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
373 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
374 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
375 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
376 0,0,0,0,0,0,0,0,0x3c,0x71,0x72,0,0,0,0,0,
377 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
378 0,0x73,0,0,0,0,0,0,0,0,0,0,0,0,0,0
379 };
380 
381     private static final int[] lcccBits={
382 0,0xffffffff,0xffff7fff,0xffff,0xf8,0xfffe0000,0xbfffffff,0xb6,0x7ff0000,0xfffff800,0x10000,0x9fc00000,0x3d9f,0x20000,0xffff0000,0x7ff,
383 0xff800,0xfbc00000,0x3eef,0xe000000,0xfffffff0,0x10000000,0x1e2000,0x2000,0x602000,0x400,0x7000000,0xf00,0x3000000,0x2a00000,0x3c3e0000,0xdf,
384 0x40,0x6800000,0xe0000000,0x100000,0x20040000,0x200,0x1800000,0x9fe00001,0x3fff0000,0x10,0xc00,0xc0040,0x800000,0xfff70000,0x31021fd,0xf03fffff,
385 0x1fff0000,0x1ffe2,0x38000,0x80000000,0xfc00,0x6000000,0x3ff08000,0x30000,0x3ffff,0x3800,0x80000,1,0xc19d0000,2,0x400000,0x4000035,
386 0x4108000,0x40000000,0x3fff
387 };
388     private static final int[] tcccBits={
389 0,0xffffffff,0x3e7effbf,0xbe7effbf,0xfffcffff,0x7ef1ff3f,0xfff3f1f8,0x7fffff3f,0x18003,0xdfffe000,0xff31ffcf,0xcfffffff,0xfffc0,0xffff7fff,0xffff,0x1d760,
390 0x1fc00,0x187c00,0x200708b,0x2000000,0x708b0000,0xc00000,0xf8,0xfccf0006,0x33ffcfc,0xfffe0000,0xbfffffff,0xb6,0x7ff0000,0x7c,0xfffff800,0x10000,
391 0x9fc80005,0x3d9f,0x20000,0xffff0000,0x7ff,0xff800,0xfbc00000,0x3eef,0xe000000,0xfffffff0,0x10120200,0xff1e2000,0x10000000,0xb0002000,0x10480000,0x4e002000,
392 0x2000,0x30002000,0x602100,0x24000400,0x7000000,0xf00,0x3000000,0x2a00000,0x3d7e0000,0xdf,0x40,0x6800000,0xe0000000,0x100000,0x20040000,0x200,
393 0x1800000,0x9fe00001,0x3fff0000,0x10,0xc00,0xc0040,0x800000,0xfff70000,0x31021fd,0xf03fffff,0xbffffff,0x3ffffff,0x3f3fffff,0xaaff3f3f,0x3fffffff,0x1fdfffff,
394 0xefcfffde,0x1fdc7fff,0x1fff0000,0x1ffe2,0x800,0xc000000,0x4000,0xe000,0x1210,0x50,0x292,0x333e005,0x333,0xf000,0x3c0f,0x38000,
395 0x80000000,0xfc00,0x55555000,0x36db02a5,0x46100000,0x47900000,0x3ff08000,0x30000,0x3ffff,0x3800,0x80000,1,0xc19d0000,2,0x400000,0x4000035,
396 0x4108000,0x5f7ffc00,0x7fdb,0x3fff
397 };
398 
399 }
400