/
collator-constants.xml
447 lines (411 loc) · 14 KB
/
collator-constants.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<section xml:id="intl.collator-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.constants;
<para>
<variablelist>
<varlistentry xml:id="collator.constants.french-collation">
<term>
<constant>Collator::FRENCH_COLLATION</constant>
</term>
<listitem>
<para>
Sort strings with different accents from the back of the string. This
attribute is automatically set to
<emphasis>On</emphasis>
for the French locales and a few others. Users normally would not need
to explicitly set this attribute. There is a string comparison
performance cost when it is set <emphasis>On</emphasis>,
but sort key length is unaffected. Possible values are:
<simplelist>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
<para>
<example>
<title>FRENCH_COLLATION rules</title>
<para>
<simplelist>
<member>F=OFF cote < coté < côte < côté </member>
<member>F=ON cote < côte < coté < côté</member>
</simplelist>
</para>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.alternate-handling">
<term>
<constant>Collator::ALTERNATE_HANDLING</constant>
</term>
<listitem>
<para>
The Alternate attribute is used to control the handling of the so called
variable characters in the UCA: whitespace, punctuation and symbols. If
Alternate is set to <emphasis>NonIgnorable</emphasis>
(N), then differences among these characters are of the same importance
as differences among letters. If Alternate is set to
<emphasis>Shifted</emphasis>
(S), then these characters are of only minor importance. The
<emphasis>Shifted</emphasis> value is often used in combination with
<emphasis>Strength</emphasis>
set to Quaternary. In such a case, whitespace, punctuation, and symbols
are considered when comparing strings, but only if all other aspects of
the strings (base letters, accents, and case) are identical. If
Alternate is not set to Shifted, then there is no difference between a
Strength of 3 and a Strength of 4. For more information and examples,
see Variable_Weighting in the
<link xlink:href="&url.icu.uca;">UCA</link>.
The reason the Alternate values are not simply
<emphasis>On</emphasis> and <emphasis>Off</emphasis>
is that additional Alternate values may be added in the future. The UCA
option Blanked is expressed with Strength set to 3, and Alternate set to
Shifted. The default for most locales is NonIgnorable. If Shifted is
selected, it may be slower if there are many strings that are the same
except for punctuation; sort key length will not be affected unless the
strength level is also increased.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::NON_IGNORABLE</constant>(default)</member>
<member><constant>Collator::SHIFTED</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
<para>
<example>
<title>ALTERNATE_HANDLING rules</title>
<para>
<simplelist>
<member>
S=3, A=N di Silva < Di Silva < diSilva < U.S.A. < USA
</member>
<member>
S=3, A=S di Silva = diSilva < Di Silva < U.S.A. = USA
</member>
<member>
S=4, A=S di Silva < diSilva < Di Silva < U.S.A. < USA
</member>
</simplelist>
</para>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.case-first">
<term>
<constant>Collator::CASE_FIRST</constant>
</term>
<listitem>
<para>
The Case_First attribute is used to control whether uppercase letters
come before lowercase letters or vice versa, in the absence of other
differences in the strings. The possible values are
<emphasis>Uppercase_First</emphasis>
(U) and <emphasis>Lowercase_First</emphasis>
(L), plus the standard <emphasis>Default</emphasis>
and <emphasis>Off</emphasis>.
There is almost no difference between the Off and Lowercase_First
options in terms of results, so typically users will not use
Lowercase_First: only Off or Uppercase_First. (People interested in the
detailed differences between X and L should consult the <literal>Collation
Customization</literal>). Specifying either L or U won't affect string comparison
performance, but will affect the sort key length.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::LOWER_FIRST</constant></member>
<member><constant>Collator::UPPER_FIRST</constant></member>
<member><constant>Collator:DEFAULT</constant></member>
</simplelist>
</para>
<para>
<example>
<title>CASE_FIRST rules</title>
<para>
<simplelist>
<member>C=X or C=L "china" < "China" < "denmark" < "Denmark"</member>
<member>C=U "China" < "china" < "Denmark" < "denmark"</member>
</simplelist>
</para>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.case-level">
<term>
<constant>Collator::CASE_LEVEL</constant>
</term>
<listitem>
<para>
The Case_Level attribute is used when ignoring accents but not case. In
such a situation, set Strength to be <emphasis>Primary</emphasis>,
and Case_Level to be <emphasis>On</emphasis>.
In most locales, this setting is Off by default. There is a small
string comparison performance and sort key impact if this attribute is
set to be <emphasis>On</emphasis>.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
<para>
<example>
<title>CASE_LEVEL rules</title>
<para>
<simplelist>
<member>S=1, E=X role = Role = rôle</member>
<member>S=1, E=O role = rôle < Role</member>
</simplelist>
</para>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.normalization-mode">
<term>
<constant>Collator::NORMALIZATION_MODE</constant>
</term>
<listitem>
<para>
The Normalization setting determines whether text is thoroughly
normalized or not in comparison. Even if the setting is off (which is
the default for many locales), text as represented in common usage will
compare correctly (for details, see UTN #5). Only if the accent marks
are in noncanonical order will there be a problem. If the setting is
<emphasis>On</emphasis>,
then the best results are guaranteed for all possible text input.
There is a medium string comparison performance cost if this attribute
is <emphasis>On</emphasis>,
depending on the frequency of sequences that require normalization.
There is no significant effect on sort key length. If the input text is
known to be in NFD or NFKD normalization forms, there is no need to
enable this Normalization option.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.strength">
<term>
<constant>Collator::STRENGTH</constant>
</term>
<listitem>
<para>
The ICU Collation Service supports many levels of comparison (named
"Levels", but also known as "Strengths"). Having these categories
enables ICU to sort strings precisely according to local conventions.
However, by allowing the levels to be selectively employed, searching
for a string in text can be performed with various matching conditions.
For more detailed information, see
<function>collator_set_strength</function> chapter.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::PRIMARY</constant></member>
<member><constant>Collator::SECONDARY</constant></member>
<member><constant>Collator::TERTIARY</constant>(default)</member>
<member><constant>Collator::QUATERNARY</constant></member>
<member><constant>Collator::IDENTICAL</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.hiragana-quaternary-mode">
<term>
<constant>Collator::HIRAGANA_QUATERNARY_MODE</constant>
</term>
<listitem>
<para>
Compatibility with JIS x 4061 requires the introduction of an additional
level to distinguish Hiragana and Katakana characters. If compatibility
with that standard is required, then this attribute should be set
<emphasis>On</emphasis>,
and the strength set to Quaternary. This will affect sort key length
and string comparison string comparison performance.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.numeric-collation">
<term>
<constant>Collator::NUMERIC_COLLATION</constant>
</term>
<listitem>
<para>
When turned on, this attribute generates a collation key for the numeric
value of substrings of digits. This is a way to get '100' to sort AFTER
'2'.
</para>
<para>
Possible values are:
<simplelist>
<member><constant>Collator::OFF</constant>(default)</member>
<member><constant>Collator::ON</constant></member>
<member><constant>Collator::DEFAULT_VALUE</constant></member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.default-value">
<term>
<constant>Collator::DEFAULT_VALUE</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.primary">
<term>
<constant>Collator::PRIMARY</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.secondary">
<term>
<constant>Collator::SECONDARY</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.tertiary">
<term>
<constant>Collator::TERTIARY</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.default-strength">
<term>
<constant>Collator::DEFAULT_STRENGTH</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.quaternary">
<term>
<constant>Collator::QUATERNARY</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.identical">
<term>
<constant>Collator::IDENTICAL</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.off">
<term>
<constant>Collator::OFF</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.on">
<term>
<constant>Collator::ON</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.shifted">
<term>
<constant>Collator::SHIFTED</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.non-ignorable">
<term>
<constant>Collator::NON_IGNORABLE</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.lower-first">
<term>
<constant>Collator::LOWER_FIRST</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.upper-first">
<term>
<constant>Collator::UPPER_FIRST</constant>
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.sort-regular">
<term><constant>Collator::SORT_REGULAR</constant></term>
<listitem>
<para/>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.sort-string">
<term><constant>Collator::SORT_STRING</constant></term>
<listitem>
<para/>
</listitem>
</varlistentry>
<varlistentry xml:id="collator.constants.sort-numeric">
<term><constant>Collator::SORT_NUMERIC</constant></term>
<listitem>
<para/>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>