1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
4 * Copyright (c) 2001-2011,2015 International Business Machines
5 * Corporation and others. All Rights Reserved.
6 ********************************************************************
8 * Modification History:
9 * Name date Description
10 * synwee July 31 2001 creation
11 ********************************************************************/
15 Note: This file is included by other C and C++ files. This file should not be directly compiled.
20 #include "unicode/ucol.h"
22 #if !UCONFIG_NO_COLLATION
24 /* Set to 1 if matches must be on grapheme boundaries */
25 #define GRAPHEME_BOUNDARIES 1
31 const char *collator
; /* currently supported "fr" "es" "de", plus NULL/other => "en" */
32 UCollationStrength strength
;
33 USearchAttributeValue elemCompare
; /* value for the USEARCH_ELEMENT_COMPARISON attribute */
34 const char *breaker
; /* currently supported "wordbreaker" for EN_WORDBREAKER_, plus NULL/other => EN_CHARACTERBREAKER_ */
40 typedef struct SearchData SearchData
;
42 static const char *TESTCOLLATORRULE
= "& o,O ; p,P";
44 static const char *EXTRACOLLATIONRULE
= " & ae ; \\u00e4 & AE ; \\u00c4 & oe ; \\u00f6 & OE ; \\u00d6 & ue ; \\u00fc & UE ; \\u00dc";
46 static const SearchData BASIC
[] = {
47 {"xxxxxxxxxxxxxxxxxxxx", "fisher", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
48 {"silly spring string", "string", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {13, -1},
50 {"silly spring string string", "string", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
51 {13, 20, -1}, {6, 6}},
52 {"silly string spring string", "string", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
54 {"string spring string", "string", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 14, -1},
56 {"Scott Ganyo", "c", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
57 {"Scott Ganyo", " ", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {5, -1}, {1}},
58 {"\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
59 {"a\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
61 #if GRAPHEME_BOUNDARIES
62 {"a\\u0300\\u0325", "\\u0300\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
63 {"a\\u0300b", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
65 {"a\\u0300\\u0325", "\\u0300\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
66 {"a\\u0300b", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
69 {"\\u00c9", "e", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
70 {"x a\\u0301", "a\\u0301", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {2, -1}, {2}},
71 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
74 static const SearchData BREAKITERATOREXACT
[] = {
75 {"foxy fox", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "characterbreaker", {0, 5, -1},
77 {"foxy fox", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {5, -1}, {3}},
78 {"This is a toe T\\u00F6ne", "toe", "de", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
79 "characterbreaker", {10, 14, -1}, {3, 2}},
80 {"This is a toe T\\u00F6ne", "toe", "de", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker",
82 {"Channel, another channel, more channels, and one last Channel",
83 "Channel", "es", UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {0, 54, -1}, {7, 7}},
85 {"testing that \\u00e9 does not match e", "e", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
86 "characterbreaker", {1, 17, 30, -1}, {1, 1, 1}},
87 {"testing that string ab\\u00e9cd does not match e", "e", NULL
,
88 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "characterbreaker", {1, 28, 41, -1}, {1, 1, 1}},
89 {"\\u00c9", "e", "fr", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "characterbreaker", {0, -1}, {1}},
91 /* Problem reported by Dave Bertoni, same as ticket 4279? */
92 {"\\u0043\\u004F\\u0302\\u0054\\u00C9", "\\u004F", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "characterbreaker", {1, -1}, {2}},
94 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
97 #define PECHE_WITH_ACCENTS "un p\\u00E9ch\\u00E9, " \
98 "\\u00E7a p\\u00E8che par, " \
100 "une p\\u00EAche, " \
101 "un p\\u00EAcher, " \
102 "j\\u2019ai p\\u00EAch\\u00E9, " \
103 "un p\\u00E9cheur, " \
104 "\\u201Cp\\u00E9che\\u201D, " \
105 "decomp peche\\u0301, " \
107 /* in the above, the interesting words and their offsets are:
120 static const SearchData STRENGTH
[] = {
121 /*012345678901234567890123456789012345678901234567890123456789*/
122 /*00*/{"The quick brown fox jumps over the lazy foxes", "fox", "en",
123 UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {16, 40, -1}, {3, 3}},
124 /*01*/{"The quick brown fox jumps over the lazy foxes", "fox", "en",
125 UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {16, -1}, {3}},
126 /*02*/{"blackbirds Pat p\\u00E9ch\\u00E9 p\\u00EAche p\\u00E9cher p\\u00EAcher Tod T\\u00F6ne black Tofu blackbirds Ton PAT toehold blackbird black-bird pat toe big Toe",
127 "peche", "fr", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {15, 21, 27, 34, -1}, {5, 5, 5, 5}},
128 /*03*/{"This is a toe T\\u00F6ne", "toe", "de", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
129 {10, 14, -1}, {3, 2}},
130 /*04*/{"A channel, another CHANNEL, more Channels, and one last channel...",
131 "channel", "es", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {2, 19, 33, 56, -1}, {7, 7, 7, 7}},
132 /*05*/{"\\u00c0 should match but not A", "A\\u0300", "en", UCOL_IDENTICAL
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
133 NULL
, {0, -1}, {1, 0}},
134 /* some tests for modified element comparison, ticket #7093 */
135 /*06*/{PECHE_WITH_ACCENTS
, "peche", "en", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, 13, 24, 36, 46, 59, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 5, 5, 5, 6, 5}},
136 /*07*/{PECHE_WITH_ACCENTS
, "peche", "en", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {3, 13, 36, 59, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 6, 5}},
137 /*08*/{PECHE_WITH_ACCENTS
, "peche", "en", UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {107, -1}, {5}},
138 /*09*/{PECHE_WITH_ACCENTS
, "peche", "en", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 13, 24, 36, 46, 59, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 5, 5, 5, 6, 5}},
139 /*10*/{PECHE_WITH_ACCENTS
, "peche", "en", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 13, 36, 59, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 6, 5}},
140 /*11*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "en", UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {24, 69, 79, -1}, {5, 5, 5}},
141 /*12*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "en", UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {79, -1}, {5}},
142 /*13*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "en", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 24, 69, 79, -1}, {5, 5, 5, 5}},
143 /*14*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "en", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 79, -1}, {5, 5}},
144 /*15*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "en", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 24, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 6, 5}},
145 /*16*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "en", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 79, 94, 107, -1}, {5, 5, 6, 5}},
146 /*17*/{PECHE_WITH_ACCENTS
, "pech\\u00E9", "en", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 59, 94, -1}, {5, 5, 6}},
147 /*18*/{PECHE_WITH_ACCENTS
, "pech\\u00E9", "en", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 59, 94, -1}, {5, 5, 6}},
148 /*19*/{PECHE_WITH_ACCENTS
, "pech\\u00E9", "en", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 13, 24, 36, 46, 59, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 5, 5, 5, 6, 5}},
149 /*20*/{PECHE_WITH_ACCENTS
, "pech\\u00E9", "en", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 13, 36, 59, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 6, 5}},
150 /*21*/{PECHE_WITH_ACCENTS
, "peche\\u0301", "en", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 59, 94, -1}, {5, 5, 6}},
151 /*22*/{PECHE_WITH_ACCENTS
, "peche\\u0301", "en", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 59, 94, -1}, {5, 5, 6}},
152 /*23*/{PECHE_WITH_ACCENTS
, "peche\\u0301", "en", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 13, 24, 36, 46, 59, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 5, 5, 5, 6, 5}},
153 /*24*/{PECHE_WITH_ACCENTS
, "peche\\u0301", "en", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 13, 36, 59, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 6, 5}},
154 /* more tests for modified element comparison (with fr), ticket #7093 */
155 /*25*/{PECHE_WITH_ACCENTS
, "peche", "fr", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, 13, 24, 36, 46, 59, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 5, 5, 5, 6, 5}},
156 /*26*/{PECHE_WITH_ACCENTS
, "peche", "fr", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {3, 13, 36, 59, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 6, 5}},
157 /*27*/{PECHE_WITH_ACCENTS
, "peche", "fr", UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {107, -1}, {5}},
158 /*28*/{PECHE_WITH_ACCENTS
, "peche", "fr", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 13, 24, 36, 46, 59, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 5, 5, 5, 6, 5}},
159 /*29*/{PECHE_WITH_ACCENTS
, "peche", "fr", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 13, 36, 59, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 6, 5}},
160 /*30*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "fr", UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {24, 69, 79, -1}, {5, 5, 5}},
161 /*31*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "fr", UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {79, -1}, {5}},
162 /*32*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "fr", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 24, 69, 79, -1}, {5, 5, 5, 5}},
163 /*33*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "fr", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 79, -1}, {5, 5}},
164 /*34*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "fr", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 24, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 6, 5}},
165 /*35*/{PECHE_WITH_ACCENTS
, "p\\u00E9che", "fr", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 79, 94, 107, -1}, {5, 5, 6, 5}},
166 /*36*/{PECHE_WITH_ACCENTS
, "pech\\u00E9", "fr", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 59, 94, -1}, {5, 5, 6}},
167 /*37*/{PECHE_WITH_ACCENTS
, "pech\\u00E9", "fr", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 59, 94, -1}, {5, 5, 6}},
168 /*38*/{PECHE_WITH_ACCENTS
, "pech\\u00E9", "fr", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 13, 24, 36, 46, 59, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 5, 5, 5, 6, 5}},
169 /*39*/{PECHE_WITH_ACCENTS
, "pech\\u00E9", "fr", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 13, 36, 59, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 6, 5}},
170 /*40*/{PECHE_WITH_ACCENTS
, "peche\\u0301", "fr", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 59, 94, -1}, {5, 5, 6}},
171 /*41*/{PECHE_WITH_ACCENTS
, "peche\\u0301", "fr", UCOL_SECONDARY
, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 59, 94, -1}, {5, 5, 6}},
172 /*42*/{PECHE_WITH_ACCENTS
, "peche\\u0301", "fr", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, NULL
, {3, 13, 24, 36, 46, 59, 69, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 5, 5, 5, 6, 5}},
173 /*43*/{PECHE_WITH_ACCENTS
, "peche\\u0301", "fr", UCOL_SECONDARY
, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD
, "wordbreaker", {3, 13, 36, 59, 79, 94, 107, -1}, {5, 5, 5, 5, 5, 6, 5}},
177 {"12\\u0171", "\\u0170", NULL
, UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {2, -1}, {2}},
180 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
183 static const SearchData VARIABLE
[] = {
184 /*012345678901234567890123456789012345678901234567890123456789*/
185 {"blackbirds black blackbirds blackbird black-bird",
186 "blackbird", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 17, 28, 38, -1},
188 /* to see that it doesn't go into an infinite loop if the start of text
189 is a ignorable character */
190 {" on", "go", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
191 {"abcdefghijklmnopqrstuvwxyz", " ", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
192 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
193 20, 21, 22, 23, 24, 25, -1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
194 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
195 /* testing tightest match */
196 {" abc a bc ab c a bc ab c", "abc", NULL
, UCOL_QUATERNARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
198 /*012345678901234567890123456789012345678901234567890123456789 */
199 {" abc a bc ab c a bc ab c", "abc", NULL
, UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
200 NULL
, {1, 6, 13, 21, 31, -1}, {3, 4, 4, 5, 5}},
201 /* totally ignorable text */
202 {" ---------------", "abc", NULL
, UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
204 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
207 static const SearchData NORMEXACT
[] = {
208 {"a\\u0300\\u0325", "a\\u0325\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {3}},
210 #if GRAPHEME_BOUNDARIES
211 {"a\\u0300\\u0325", "\\u0325\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
213 {"a\\u0300\\u0325", "\\u0325\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
216 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
219 static const SearchData NONNORMEXACT
[] = {
220 {"a\\u0300\\u0325", "\\u0325\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
221 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
224 static const SearchData OVERLAP
[] = {
225 {"abababab", "abab", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 2, 4, -1},
227 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
230 static const SearchData NONOVERLAP
[] = {
231 {"abababab", "abab", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 4, -1}, {4, 4}},
232 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
235 static const SearchData COLLATOR
[] = {
237 {"fox fpx", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {3}},
239 {"fox fpx", "fox", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 4, -1}, {3, 3}},
240 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
243 static const SearchData PATTERN
[] = {
244 {"The quick brown fox jumps over the lazy foxes", "the", NULL
,
245 UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 31, -1}, {3, 3}},
246 {"The quick brown fox jumps over the lazy foxes", "fox", NULL
,
247 UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {16, 40, -1}, {3, 3}},
248 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
251 static const SearchData TEXT
[] = {
252 {"the foxy brown fox", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {4, 15, -1},
254 {"the quick brown fox", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {16, -1},
256 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
259 static const SearchData COMPOSITEBOUNDARIES
[] = {
260 #if GRAPHEME_BOUNDARIES
261 {"\\u00C0", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
262 {"A\\u00C0C", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
263 {"\\u00C0A", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
264 {"B\\u00C0", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
265 {"\\u00C0B", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
266 {"\\u00C0", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
267 {"\\u0300\\u00C0", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
269 {"\\u00C0", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
270 {"A\\u00C0C", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 1, -1}, {1, 1}},
271 {"\\u00C0A", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 1, -1}, {1, 1}},
272 {"B\\u00C0", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
273 {"\\u00C0B", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
274 {"\\u00C0", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
275 {"\\u0300\\u00C0", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 1, -1},
279 {"\\u00C0\\u0300", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
280 /* A + 030A + 0301 */
281 {"\\u01FA", "\\u01FA", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
282 {"\\u01FA", "A\\u030A\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
283 {"\\u01FA", "\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
284 {"\\u01FA", "A\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
285 {"\\u01FA", "\\u030AA", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
286 {"\\u01FA", "\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
287 {"\\u01FA", "A\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
288 {"\\u01FA", "\\u0301A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
290 #if GRAPHEME_BOUNDARIES
291 {"\\u01FA", "\\u030A\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
293 {"\\u01FA", "\\u030A\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
296 {"A\\u01FA", "A\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
297 {"\\u01FAA", "\\u0301A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
298 {"\\u0F73", "\\u0F73", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
299 {"\\u0F73", "\\u0F71", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
300 {"\\u0F73", "\\u0F72", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
301 {"\\u0F73", "\\u0F71\\u0F72", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
302 {"A\\u0F73", "A\\u0F71", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
303 {"\\u0F73A", "\\u0F72A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
306 {"a\\u00e1", "a\\u00e1", NULL
, UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
309 {"fu\\u00dfball", "fu\\u00df", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {3}},
310 {"fu\\u00dfball", "fuss", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {3}},
311 {"fu\\u00dfball", "uss", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
313 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
316 static const SearchData MATCH
[] = {
317 {"a busy bee is a very busy beeee", "bee", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
318 {7, 26, -1}, {3, 3}},
319 /* 012345678901234567890123456789012345678901234567890 */
320 {"a busy bee is a very busy beeee with no bee life", "bee", NULL
,
321 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {7, 26, 40, -1}, {3, 3, 3}},
322 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
325 static const SearchData SUPPLEMENTARY
[] = {
326 /* 012345678901234567890123456789012345678901234567890012345678901234567890123456789012345678901234567890012345678901234567890123456789 */
327 {"abc \\uD800\\uDC00 \\uD800\\uDC01 \\uD801\\uDC00 \\uD800\\uDC00abc abc\\uD800\\uDC00 \\uD800\\uD800\\uDC00 \\uD800\\uDC00\\uDC00",
328 "\\uD800\\uDC00", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {4, 13, 22, 26, 29, -1},
330 {"and\\uD834\\uDDB9this sentence", "\\uD834\\uDDB9", NULL
,
331 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {2}},
332 {"and \\uD834\\uDDB9 this sentence", " \\uD834\\uDDB9 ", NULL
,
333 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {4}},
334 {"and-\\uD834\\uDDB9-this sentence", "-\\uD834\\uDDB9-", NULL
,
335 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {4}},
336 {"and,\\uD834\\uDDB9,this sentence", ",\\uD834\\uDDB9,", NULL
,
337 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {4}},
338 {"and?\\uD834\\uDDB9?this sentence", "?\\uD834\\uDDB9?", NULL
,
339 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {4}},
340 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
343 static const char *CONTRACTIONRULE
=
344 "&z = ab/c < AB < X\\u0300 < ABC < X\\u0300\\u0315";
346 static const SearchData CONTRACTION
[] = {
347 /* common discontiguous */
348 {"A\\u0300\\u0315", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
350 #if GRAPHEME_BOUNDARIES
351 {"A\\u0300\\u0315", "\\u0300\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
353 {"A\\u0300\\u0315", "\\u0300\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
356 /* contraction prefix */
357 {"AB\\u0315C", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
359 #if GRAPHEME_BOUNDARIES
360 {"AB\\u0315C", "AB", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
361 {"AB\\u0315C", "\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
363 {"AB\\u0315C", "AB", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
364 {"AB\\u0315C", "\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {2, -1}, {1}},
367 /* discontiguous problem here for backwards iteration.
368 accents not found because discontiguous stores all information */
369 {"X\\u0300\\u0319\\u0315", "\\u0319", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1},
371 /* ends not with a contraction character */
372 {"X\\u0315\\u0300D", "\\u0300\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1},
374 {"X\\u0315\\u0300D", "X\\u0300\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
376 {"X\\u0300\\u031A\\u0315D", "X\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1},
378 /* blocked discontiguous */
379 {"X\\u0300\\u031A\\u0315D", "\\u031A\\u0315D", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
382 #if GRAPHEME_BOUNDARIES
384 * "ab" generates a contraction that's an expansion. The "z" matches the
385 * first CE of the expansion but the match fails because it ends in the
386 * middle of an expansion...
388 {"ab", "z", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
390 {"ab", "z", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
393 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
396 static const char *IGNORABLERULE
= "&a = \\u0300";
398 static const SearchData IGNORABLE
[] = {
399 #if GRAPHEME_BOUNDARIES
401 * This isn't much of a test when matches have to be on
402 * grapheme boundiaries. The match at 0 only works because
403 * it's at the start of the text.
405 {"\\u0300\\u0315 \\u0300\\u0315 ", "\\u0300", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
408 {"\\u0300\\u0315 \\u0300\\u0315 ", "\\u0300", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
412 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
415 static const SearchData BASICCANONICAL
[] = {
416 {"xxxxxxxxxxxxxxxxxxxx", "fisher", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
417 {"silly spring string", "string", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {13, -1},
419 {"silly spring string string", "string", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
420 {13, 20, -1}, {6, 6}},
421 {"silly string spring string", "string", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
422 {6, 20, -1}, {6, 6}},
423 {"string spring string", "string", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 14, -1},
425 {"Scott Ganyo", "c", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
426 {"Scott Ganyo", " ", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {5, -1}, {1}},
428 #if GRAPHEME_BOUNDARIES
429 {"\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
430 {"a\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
431 {"a\\u0300\\u0325", "\\u0300\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
432 {"a\\u0300b", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
433 {"a\\u0300\\u0325b", "\\u0300b", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
434 {"\\u0325\\u0300A\\u0325\\u0300", "\\u0300A\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
436 {"\\u0325\\u0300A\\u0325\\u0300", "\\u0325A\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
438 {"a\\u0300\\u0325b\\u0300\\u0325c \\u0325b\\u0300 \\u0300b\\u0325",
439 "\\u0300b\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
441 {"\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
442 {"a\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
443 {"a\\u0300\\u0325", "\\u0300\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1},
445 {"a\\u0300b", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
446 {"a\\u0300\\u0325b", "\\u0300b", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {3}},
447 {"\\u0325\\u0300A\\u0325\\u0300", "\\u0300A\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
449 {"\\u0325\\u0300A\\u0325\\u0300", "\\u0325A\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
451 {"a\\u0300\\u0325b\\u0300\\u0325c \\u0325b\\u0300 \\u0300b\\u0325",
452 "\\u0300b\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, 12, -1}, {5, 3}},
455 {"\\u00c4\\u0323", "A\\u0323\\u0308", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
456 {"\\u0308\\u0323", "\\u0323\\u0308", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
457 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
461 static const SearchData NORMCANONICAL
[] = {
462 #if GRAPHEME_BOUNDARIES
464 * These tests don't really mean anything. With matches restricted to grapheme
465 * boundaries, isCanonicalMatch doesn't mean anything unless normalization is
468 {"\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
469 {"\\u0300\\u0325", "\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
470 {"a\\u0300\\u0325", "\\u0325\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
471 {"a\\u0300\\u0325", "\\u0300\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
472 {"a\\u0300\\u0325", "\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
473 {"a\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
475 {"\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
476 {"\\u0300\\u0325", "\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
477 {"a\\u0300\\u0325", "\\u0325\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1},
479 {"a\\u0300\\u0325", "\\u0300\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1},
481 {"a\\u0300\\u0325", "\\u0325", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
482 {"a\\u0300\\u0325", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
485 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
488 static const SearchData BREAKITERATORCANONICAL
[] = {
489 {"foxy fox", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "characterbreaker", {0, 5, -1},
491 {"foxy fox", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {5, -1}, {3}},
492 {"This is a toe T\\u00F6ne", "toe", "de", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
493 "characterbreaker", {10, 14, -1}, {3, 2}},
494 {"This is a toe T\\u00F6ne", "toe", "de", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker",
496 {"Channel, another channel, more channels, and one last Channel",
497 "Channel", "es", UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {0, 54, -1}, {7, 7}},
499 {"testing that \\u00e9 does not match e", "e", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
500 "characterbreaker", {1, 17, 30, -1}, {1, 1, 1}},
501 {"testing that string ab\\u00e9cd does not match e", "e", NULL
,
502 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "characterbreaker", {1, 28, 41, -1}, {1, 1, 1}},
503 {"\\u00c9", "e", "fr", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "characterbreaker", {0, -1}, {1}},
504 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
507 static const SearchData STRENGTHCANONICAL
[] = {
508 /*012345678901234567890123456789012345678901234567890123456789 */
509 {"The quick brown fox jumps over the lazy foxes", "fox", "en",
510 UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {16, 40, -1}, {3, 3}},
511 {"The quick brown fox jumps over the lazy foxes", "fox", "en",
512 UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, "wordbreaker", {16, -1}, {3}},
513 {"blackbirds Pat p\\u00E9ch\\u00E9 p\\u00EAche p\\u00E9cher p\\u00EAcher Tod T\\u00F6ne black Tofu blackbirds Ton PAT toehold blackbird black-bird pat toe big Toe",
514 "peche", "fr", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {15, 21, 27, 34, -1}, {5, 5, 5, 5}},
515 {"This is a toe T\\u00F6ne", "toe", "de", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
516 {10, 14, -1}, {3, 2}},
517 {"A channel, another CHANNEL, more Channels, and one last channel...",
518 "channel", "es", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {2, 19, 33, 56, -1},
520 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
523 static const SearchData VARIABLECANONICAL
[] = {
524 /*012345678901234567890123456789012345678901234567890123456789 */
525 {"blackbirds black blackbirds blackbird black-bird",
526 "blackbird", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 17, 28, 38, -1},
528 /* to see that it doesn't go into an infinite loop if the start of text
529 is a ignorable character */
530 {" on", "go", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
531 {"abcdefghijklmnopqrstuvwxyz", " ", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
532 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
533 20, 21, 22, 23, 24, 25, -1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
534 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
535 /* testing tightest match */
536 {" abc a bc ab c a bc ab c", "abc", NULL
, UCOL_QUATERNARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
538 /*012345678901234567890123456789012345678901234567890123456789 */
539 {" abc a bc ab c a bc ab c", "abc", NULL
, UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
540 NULL
, {1, 6, 13, 21, 31, -1}, {3, 4, 4, 5, 5}},
541 /* totally ignorable text */
542 {" ---------------", "abc", NULL
, UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
,
544 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
547 static const SearchData OVERLAPCANONICAL
[] = {
548 {"abababab", "abab", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 2, 4, -1},
550 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
553 static const SearchData NONOVERLAPCANONICAL
[] = {
554 {"abababab", "abab", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 4, -1}, {4, 4}},
555 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
558 static const SearchData COLLATORCANONICAL
[] = {
560 {"fox fpx", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {3}},
562 {"fox fpx", "fox", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 4, -1}, {3, 3}},
563 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
566 static const SearchData PATTERNCANONICAL
[] = {
567 {"The quick brown fox jumps over the lazy foxes", "the", NULL
,
568 UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 31, -1}, {3, 3}},
569 {"The quick brown fox jumps over the lazy foxes", "fox", NULL
,
570 UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {16, 40, -1}, {3, 3}},
571 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
574 static const SearchData TEXTCANONICAL
[] = {
575 {"the foxy brown fox", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {4, 15, -1},
577 {"the quick brown fox", "fox", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {16, -1},
579 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
582 static const SearchData COMPOSITEBOUNDARIESCANONICAL
[] = {
583 #if GRAPHEME_BOUNDARIES
584 {"\\u00C0", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
585 {"A\\u00C0C", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
586 {"\\u00C0A", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
587 {"B\\u00C0", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
588 {"\\u00C0B", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
589 {"\\u00C0", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
591 /* first one matches only because it's at the start of the text */
592 {"\\u0300\\u00C0", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
594 /* \\u0300 blocked by \\u0300 */
595 {"\\u00C0\\u0300", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
597 {"\\u00C0", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
598 {"A\\u00C0C", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 1, -1}, {1, 1}},
599 {"\\u00C0A", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 1, -1}, {1, 1}},
600 {"B\\u00C0", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
601 {"\\u00C0B", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
602 {"\\u00C0", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
603 {"\\u0300\\u00C0", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 1, -1},
605 /* \\u0300 blocked by \\u0300 */
606 {"\\u00C0\\u0300", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
609 /* A + 030A + 0301 */
610 {"\\u01FA", "\\u01FA", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
611 {"\\u01FA", "A\\u030A\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
613 #if GRAPHEME_BOUNDARIES
614 {"\\u01FA", "\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
615 {"\\u01FA", "A\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
617 {"\\u01FA", "\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
618 {"\\u01FA", "A\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
621 {"\\u01FA", "\\u030AA", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
623 #if GRAPHEME_BOUNDARIES
624 {"\\u01FA", "\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
626 {"\\u01FA", "\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
630 {"\\u01FA", "A\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
631 {"\\u01FA", "\\u0301A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
633 #if GRAPHEME_BOUNDARIES
634 {"\\u01FA", "\\u030A\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
635 {"A\\u01FA", "A\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
636 {"\\u01FAA", "\\u0301A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
638 {"\\u01FA", "\\u030A\\u0301", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
639 {"A\\u01FA", "A\\u030A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {1}},
640 {"\\u01FAA", "\\u0301A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
643 {"\\u0F73", "\\u0F73", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
645 #if GRAPHEME_BOUNDARIES
646 {"\\u0F73", "\\u0F71", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
647 {"\\u0F73", "\\u0F72", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
649 {"\\u0F73", "\\u0F71", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
650 {"\\u0F73", "\\u0F72", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
653 {"\\u0F73", "\\u0F71\\u0F72", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {1}},
655 #if GRAPHEME_BOUNDARIES
656 {"A\\u0F73", "A\\u0F71", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
657 {"\\u0F73A", "\\u0F72A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
658 {"\\u01FA A\\u0301\\u030A A\\u030A\\u0301 A\\u030A \\u01FA", "A\\u030A",
659 NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {10, -1}, {2}},
661 {"A\\u0F73", "A\\u0F71", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
662 {"\\u0F73A", "\\u0F72A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
663 {"\\u01FA A\\u0301\\u030A A\\u030A\\u0301 A\\u030A \\u01FA", "A\\u030A",
664 NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 6, 10, 13, -1}, {1, 3, 2, 1}},
667 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
670 static const SearchData MATCHCANONICAL
[] = {
671 {"a busy bee is a very busy beeee", "bee", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
,
672 {7, 26, -1}, {3, 3}},
673 /*012345678901234567890123456789012345678901234567890 */
674 {"a busy bee is a very busy beeee with no bee life", "bee", NULL
,
675 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {7, 26, 40, -1}, {3, 3, 3}},
676 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
679 static const SearchData SUPPLEMENTARYCANONICAL
[] = {
680 /*012345678901234567890123456789012345678901234567890012345678901234567890123456789012345678901234567890012345678901234567890123456789 */
681 {"abc \\uD800\\uDC00 \\uD800\\uDC01 \\uD801\\uDC00 \\uD800\\uDC00abc abc\\uD800\\uDC00 \\uD800\\uD800\\uDC00 \\uD800\\uDC00\\uDC00",
682 "\\uD800\\uDC00", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {4, 13, 22, 26, 29, -1},
684 {"and\\uD834\\uDDB9this sentence", "\\uD834\\uDDB9", NULL
,
685 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {2}},
686 {"and \\uD834\\uDDB9 this sentence", " \\uD834\\uDDB9 ", NULL
,
687 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {4}},
688 {"and-\\uD834\\uDDB9-this sentence", "-\\uD834\\uDDB9-", NULL
,
689 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {4}},
690 {"and,\\uD834\\uDDB9,this sentence", ",\\uD834\\uDDB9,", NULL
,
691 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {4}},
692 {"and?\\uD834\\uDDB9?this sentence", "?\\uD834\\uDDB9?", NULL
,
693 UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {3, -1}, {4}},
694 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
697 static const SearchData CONTRACTIONCANONICAL
[] = {
698 /* common discontiguous */
699 #if GRAPHEME_BOUNDARIES
700 {"A\\u0300\\u0315", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
701 {"A\\u0300\\u0315", "\\u0300\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
703 {"A\\u0300\\u0315", "\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
704 {"A\\u0300\\u0315", "\\u0300\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
707 /* contraction prefix */
708 {"AB\\u0315C", "A", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
710 #if GRAPHEME_BOUNDARIES
711 {"AB\\u0315C", "AB", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
712 {"AB\\u0315C", "\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
714 {"AB\\u0315C", "AB", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
715 {"AB\\u0315C", "\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {2, -1}, {1}},
718 /* discontiguous problem here for backwards iteration.
719 forwards gives 0, 4 but backwards give 1, 3 */
720 /* {"X\\u0300\\u0319\\u0315", "\\u0319", NULL, UCOL_TERTIARY, USEARCH_STANDARD_ELEMENT_COMPARISON, NULL, {0, -1},
723 /* ends not with a contraction character */
724 {"X\\u0315\\u0300D", "\\u0300\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
725 {"X\\u0315\\u0300D", "X\\u0300\\u0315", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {3}},
727 #if GRAPHEME_BOUNDARIES
728 {"X\\u0300\\u031A\\u0315D", "X\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
730 /* blocked discontiguous */
731 {"X\\u0300\\u031A\\u0315D", "\\u031A\\u0315D", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}},
734 * "ab" generates a contraction that's an expansion. The "z" matches the
735 * first CE of the expansion but the match fails because it ends in the
736 * middle of an expansion...
738 {"ab", "z", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {2}},
740 {"X\\u0300\\u031A\\u0315D", "X\\u0300", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {4}},
742 /* blocked discontiguous */
743 {"X\\u0300\\u031A\\u0315D", "\\u031A\\u0315D", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {4}},
745 {"ab", "z", NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, -1}, {2}},
748 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
751 static const SearchData DIACRITICMATCH
[] = {
752 {"\\u03BA\\u03B1\\u03B9\\u0300\\u0020\\u03BA\\u03B1\\u1F76", "\\u03BA\\u03B1\\u03B9", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 5,-1}, {4, 3}},
753 {"\\u0061\\u0061\\u00E1", "\\u0061\\u00E1", NULL
, UCOL_SECONDARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, -1}, {2}},
754 {"\\u0020\\u00C2\\u0303\\u0020\\u0041\\u0061\\u1EAA\\u0041\\u0302\\u0303\\u00C2\\u0303\\u1EAB\\u0061\\u0302\\u0303\\u00E2\\u0303\\uD806\\uDC01\\u0300\\u0020",
755 "\\u00C2\\u0303", "LDE_AN_CX_EX_FX_HX_NX_S1", UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {1, 4, 5, 6, 7, 10, 12, 13, 16,-1}, {2, 1, 1, 1, 3, 2, 1, 3, 2}},
756 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
759 static const SearchData INDICPREFIXMATCH
[] = {
760 {"\\u0915\\u0020\\u0915\\u0901\\u0020\\u0915\\u0902\\u0020\\u0915\\u0903\\u0020\\u0915\\u0940\\u0020\\u0915\\u093F\\u0020\\u0915\\u0943\\u0020\\u0915\\u093C\\u0020\\u0958",
761 "\\u0915", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 2, 5, 8, 11, 14, 17, 20, 23,-1}, {1, 2, 2, 2, 1, 1, 1, 2, 1}},
762 {"\\u0915\\u0924\\u0020\\u0915\\u0924\\u0940\\u0020\\u0915\\u0924\\u093F\\u0020\\u0915\\u0924\\u0947\\u0020\\u0915\\u0943\\u0924\\u0020\\u0915\\u0943\\u0924\\u0947",
763 "\\u0915\\u0924", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {0, 3, 7, 11, -1}, {2, 2, 2, 2}},
764 {"\\u0915\\u0924\\u0020\\u0915\\u0924\\u0940\\u0020\\u0915\\u0924\\u093F\\u0020\\u0915\\u0924\\u0947\\u0020\\u0915\\u0943\\u0924\\u0020\\u0915\\u0943\\u0924\\u0947",
765 "\\u0915\\u0943\\u0924", NULL
, UCOL_PRIMARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {15, 19, -1}, {3, 3}},
766 {NULL
, NULL
, NULL
, UCOL_TERTIARY
, USEARCH_STANDARD_ELEMENT_COMPARISON
, NULL
, {-1}, {0}}
769 #endif /* #if !UCONFIG_NO_COLLATION */