-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathunicode.htm
683 lines (679 loc) · 65.5 KB
/
unicode.htm
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
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
<!DOCTYPE html>
<html lang="en">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../assets/site.css" rel="stylesheet">
<title>unicode</title>
</head>
<body>
<div class="container">
<h2 id="pkg-overview">package unicode</h2>
<p><code>import "unicode"</code>
<p>unicode包提供数据和函数来测试Unicode代码点的一些属性。</p>
<h3 id="pkg-index" class="section-header">Index <a class="permalink" href="#pkg-index">¶</a></h3>
<a href="../main.html"><h3>返回首页</h3></a>
</br>
<li><a href="#pkg-constants">Constants</a></li>
<li><a href="#pkg-variables">Variables</a></li>
<li><a href="#CaseRange">type CaseRange</a></li>
<li><a href="#Range16">type Range16</a></li>
<li><a href="#Range32">type Range32</a></li>
<li><a href="#RangeTable">type RangeTable</a></li>
<li><a href="#SpecialCase">type SpecialCase</a></li>
<ul>
<li><a href="#SpecialCase.ToLower">func (special SpecialCase) ToLower(r rune) rune</a></li>
<li><a href="#SpecialCase.ToUpper">func (special SpecialCase) ToUpper(r rune) rune</a></li>
<li><a href="#SpecialCase.ToTitle">func (special SpecialCase) ToTitle(r rune) rune</a></li>
</ul>
<li><a href="#Is">func Is(rangeTab *RangeTable, r rune) bool</a></li>
<li><a href="#In">func In(r rune, ranges ...*RangeTable) bool</a></li>
<li><a href="#IsOneOf">func IsOneOf(ranges []*RangeTable, r rune) bool</a></li>
<li><a href="#IsSpace">func IsSpace(r rune) bool</a></li>
<li><a href="#IsDigit">func IsDigit(r rune) bool</a></li>
<li><a href="#IsNumber">func IsNumber(r rune) bool</a></li>
<li><a href="#IsLetter">func IsLetter(r rune) bool</a></li>
<li><a href="#IsGraphic">func IsGraphic(r rune) bool</a></li>
<li><a href="#IsControl">func IsControl(r rune) bool</a></li>
<li><a href="#IsMark">func IsMark(r rune) bool</a></li>
<li><a href="#IsPrint">func IsPrint(r rune) bool</a></li>
<li><a href="#IsPunct">func IsPunct(r rune) bool</a></li>
<li><a href="#IsSymbol">func IsSymbol(r rune) bool</a></li>
<li><a href="#IsLower">func IsLower(r rune) bool</a></li>
<li><a href="#IsUpper">func IsUpper(r rune) bool</a></li>
<li><a href="#IsTitle">func IsTitle(r rune) bool</a></li>
<li><a href="#To">func To(_case int, r rune) rune</a></li>
<li><a href="#ToLower">func ToLower(r rune) rune</a></li>
<li><a href="#ToUpper">func ToUpper(r rune) rune</a></li>
<li><a href="#ToTitle">func ToTitle(r rune) rune</a></li>
<li><a href="#SimpleFold">func SimpleFold(r rune) rune</a></li>
</ul>
<h3 id="pkg-constants">Constants <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>const (
<span id="MaxRune">MaxRune</span> = '\U0010FFFF' <span class="com">// 最大的合法unicode码值</span>
<span id="ReplacementChar">ReplacementChar</span> = '\uFFFD' <span class="com">// 表示不合法的unicode码值</span>
<span id="MaxASCII">MaxASCII</span> = '\u007F' <span class="com">// 最大的ASCII值</span>
<span id="MaxLatin1">MaxLatin1</span> = '\u00FF' <span class="com">// 最大的Latin-1值</span>
)</pre>
<pre>const (
<span id="UpperCase">UpperCase</span> = <a href="builtin.htm#iota">iota</a>
<span id="LowerCase">LowerCase</span>
<span id="TitleCase">TitleCase</span>
<span id="MaxCase">MaxCase</span>
)</pre>
<p>下值可用于CaseRange类型里的数组类型Delta字段,用于码值映射。</p>
<pre>const (
<span id="UpperLower">UpperLower</span> = <a href="#MaxRune">MaxRune</a> + 1 <span class="com">// 不能是合法的delta值</span>
)</pre>
<p align="left">如果一个CaseRange类型的的Delta字段使用了UpperLower,就表示该CaseRange表示的序列格式为:Upper Lower Upper Lower</p>
<pre>const <span id="Version">Version</span> = "6.3.0"</pre>
<p>Version是本包采用的unicode版本(以及Variables栏里那些乱七八糟的字符集的来源)。</p>
<h3 id="pkg-variables">Variables <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>var (
<span id="Cc">Cc</span> = _Cc <span class="com">// Cc is the set of Unicode characters in category Cc.</span>
<span id="Cf">Cf</span> = _Cf <span class="com">// Cf is the set of Unicode characters in category Cf.</span>
<span id="Co">Co</span> = _Co <span class="com">// Co is the set of Unicode characters in category Co.</span>
<span id="Cs">Cs</span> = _Cs <span class="com">// Cs is the set of Unicode characters in category Cs.</span>
<span id="Digit">Digit</span> = _Nd <span class="com">// Digit is the set of Unicode characters with the "decimal digit" property.</span>
<span id="Nd">Nd</span> = _Nd <span class="com">// Nd is the set of Unicode characters in category Nd.</span>
<span id="Letter">Letter</span> = _L <span class="com">// Letter/L is the set of Unicode letters, category L.</span>
<span id="L">L</span> = _L
<span id="Lm">Lm</span> = _Lm <span class="com">// Lm is the set of Unicode characters in category Lm.</span>
<span id="Lo">Lo</span> = _Lo <span class="com">// Lo is the set of Unicode characters in category Lo.</span>
<span id="Lower">Lower</span> = _Ll <span class="com">// Lower is the set of Unicode lower case letters.</span>
<span id="Ll">Ll</span> = _Ll <span class="com">// Ll is the set of Unicode characters in category Ll.</span>
<span id="Mark">Mark</span> = _M <span class="com">// Mark/M is the set of Unicode mark characters, category M.</span>
<span id="M">M</span> = _M
<span id="Mc">Mc</span> = _Mc <span class="com">// Mc is the set of Unicode characters in category Mc.</span>
<span id="Me">Me</span> = _Me <span class="com">// Me is the set of Unicode characters in category Me.</span>
<span id="Mn">Mn</span> = _Mn <span class="com">// Mn is the set of Unicode characters in category Mn.</span>
<span id="Nl">Nl</span> = _Nl <span class="com">// Nl is the set of Unicode characters in category Nl.</span>
<span id="No">No</span> = _No <span class="com">// No is the set of Unicode characters in category No.</span>
<span id="Number">Number</span> = _N <span class="com">// Number/N is the set of Unicode number characters, category N.</span>
<span id="N">N</span> = _N
<span id="Other">Other</span> = _C <span class="com">// Other/C is the set of Unicode control and special characters, category C.</span>
<span id="C">C</span> = _C
<span id="Pc">Pc</span> = _Pc <span class="com">// Pc is the set of Unicode characters in category Pc.</span>
<span id="Pd">Pd</span> = _Pd <span class="com">// Pd is the set of Unicode characters in category Pd.</span>
<span id="Pe">Pe</span> = _Pe <span class="com">// Pe is the set of Unicode characters in category Pe.</span>
<span id="Pf">Pf</span> = _Pf <span class="com">// Pf is the set of Unicode characters in category Pf.</span>
<span id="Pi">Pi</span> = _Pi <span class="com">// Pi is the set of Unicode characters in category Pi.</span>
<span id="Po">Po</span> = _Po <span class="com">// Po is the set of Unicode characters in category Po.</span>
<span id="Ps">Ps</span> = _Ps <span class="com">// Ps is the set of Unicode characters in category Ps.</span>
<span id="Punct">Punct</span> = _P <span class="com">// Punct/P is the set of Unicode punctuation characters, category P.</span>
<span id="P">P</span> = _P
<span id="Sc">Sc</span> = _Sc <span class="com">// Sc is the set of Unicode characters in category Sc.</span>
<span id="Sk">Sk</span> = _Sk <span class="com">// Sk is the set of Unicode characters in category Sk.</span>
<span id="Sm">Sm</span> = _Sm <span class="com">// Sm is the set of Unicode characters in category Sm.</span>
<span id="So">So</span> = _So <span class="com">// So is the set of Unicode characters in category So.</span>
<span id="Space">Space</span> = _Z <span class="com">// Space/Z is the set of Unicode space characters, category Z.</span>
<span id="Z">Z</span> = _Z
<span id="Symbol">Symbol</span> = _S <span class="com">// Symbol/S is the set of Unicode symbol characters, category S.</span>
<span id="S">S</span> = _S
<span id="Title">Title</span> = _Lt <span class="com">// Title is the set of Unicode title case letters.</span>
<span id="Lt">Lt</span> = _Lt <span class="com">// Lt is the set of Unicode characters in category Lt.</span>
<span id="Upper">Upper</span> = _Lu <span class="com">// Upper is the set of Unicode upper case letters.</span>
<span id="Lu">Lu</span> = _Lu <span class="com">// Lu is the set of Unicode characters in category Lu.</span>
<span id="Zl">Zl</span> = _Zl <span class="com">// Zl is the set of Unicode characters in category Zl.</span>
<span id="Zp">Zp</span> = _Zp <span class="com">// Zp is the set of Unicode characters in category Zp.</span>
<span id="Zs">Zs</span> = _Zs <span class="com">// Zs is the set of Unicode characters in category Zs.</span>
)</pre>
<p>这些变量的类型是*RangeTable。</p>
<pre>var (
<span id="Arabic">Arabic</span> = _Arabic <span class="com">// Arabic is the set of Unicode characters in script Arabic.</span>
<span id="Armenian">Armenian</span> = _Armenian <span class="com">// Armenian is the set of Unicode characters in script Armenian.</span>
<span id="Avestan">Avestan</span> = _Avestan <span class="com">// Avestan is the set of Unicode characters in script Avestan.</span>
<span id="Balinese">Balinese</span> = _Balinese <span class="com">// Balinese is the set of Unicode characters in script Balinese.</span>
<span id="Bamum">Bamum</span> = _Bamum <span class="com">// Bamum is the set of Unicode characters in script Bamum.</span>
<span id="Batak">Batak</span> = _Batak <span class="com">// Batak is the set of Unicode characters in script Batak.</span>
<span id="Bengali">Bengali</span> = _Bengali <span class="com">// Bengali is the set of Unicode characters in script Bengali.</span>
<span id="Bopomofo">Bopomofo</span> = _Bopomofo <span class="com">// Bopomofo is the set of Unicode characters in script Bopomofo.</span>
<span id="Brahmi">Brahmi</span> = _Brahmi <span class="com">// Brahmi is the set of Unicode characters in script Brahmi.</span>
<span id="Braille">Braille</span> = _Braille <span class="com">// Braille is the set of Unicode characters in script Braille.</span>
<span id="Buginese">Buginese</span> = _Buginese <span class="com">// Buginese is the set of Unicode characters in script Buginese.</span>
<span id="Buhid">Buhid</span> = _Buhid <span class="com">// Buhid is the set of Unicode characters in script Buhid.</span>
<span id="Canadian_Aboriginal">Canadian_Aboriginal</span> = _Canadian_Aboriginal <span class="com">// Canadian_Aboriginal is the set of Unicode characters in script Canadian_Aboriginal.</span>
<span id="Carian">Carian</span> = _Carian <span class="com">// Carian is the set of Unicode characters in script Carian.</span>
<span id="Chakma">Chakma</span> = _Chakma <span class="com">// Chakma is the set of Unicode characters in script Chakma.</span>
<span id="Cham">Cham</span> = _Cham <span class="com">// Cham is the set of Unicode characters in script Cham.</span>
<span id="Cherokee">Cherokee</span> = _Cherokee <span class="com">// Cherokee is the set of Unicode characters in script Cherokee.</span>
<span id="Common">Common</span> = _Common <span class="com">// Common is the set of Unicode characters in script Common.</span>
<span id="Coptic">Coptic</span> = _Coptic <span class="com">// Coptic is the set of Unicode characters in script Coptic.</span>
<span id="Cuneiform">Cuneiform</span> = _Cuneiform <span class="com">// Cuneiform is the set of Unicode characters in script Cuneiform.</span>
<span id="Cypriot">Cypriot</span> = _Cypriot <span class="com">// Cypriot is the set of Unicode characters in script Cypriot.</span>
<span id="Cyrillic">Cyrillic</span> = _Cyrillic <span class="com">// Cyrillic is the set of Unicode characters in script Cyrillic.</span>
<span id="Deseret">Deseret</span> = _Deseret <span class="com">// Deseret is the set of Unicode characters in script Deseret.</span>
<span id="Devanagari">Devanagari</span> = _Devanagari <span class="com">// Devanagari is the set of Unicode characters in script Devanagari.</span>
<span id="Egyptian_Hieroglyphs">Egyptian_Hieroglyphs</span> = _Egyptian_Hieroglyphs <span class="com">// Egyptian_Hieroglyphs is the set of Unicode characters in script Egyptian_Hieroglyphs.</span>
<span id="Ethiopic">Ethiopic</span> = _Ethiopic <span class="com">// Ethiopic is the set of Unicode characters in script Ethiopic.</span>
<span id="Georgian">Georgian</span> = _Georgian <span class="com">// Georgian is the set of Unicode characters in script Georgian.</span>
<span id="Glagolitic">Glagolitic</span> = _Glagolitic <span class="com">// Glagolitic is the set of Unicode characters in script Glagolitic.</span>
<span id="Gothic">Gothic</span> = _Gothic <span class="com">// Gothic is the set of Unicode characters in script Gothic.</span>
<span id="Greek">Greek</span> = _Greek <span class="com">// Greek is the set of Unicode characters in script Greek.</span>
<span id="Gujarati">Gujarati</span> = _Gujarati <span class="com">// Gujarati is the set of Unicode characters in script Gujarati.</span>
<span id="Gurmukhi">Gurmukhi</span> = _Gurmukhi <span class="com">// Gurmukhi is the set of Unicode characters in script Gurmukhi.</span>
<span id="Han">Han</span> = _Han <span class="com">// Han is the set of Unicode characters in script Han.</span>
<span id="Hangul">Hangul</span> = _Hangul <span class="com">// Hangul is the set of Unicode characters in script Hangul.</span>
<span id="Hanunoo">Hanunoo</span> = _Hanunoo <span class="com">// Hanunoo is the set of Unicode characters in script Hanunoo.</span>
<span id="Hebrew">Hebrew</span> = _Hebrew <span class="com">// Hebrew is the set of Unicode characters in script Hebrew.</span>
<span id="Hiragana">Hiragana</span> = _Hiragana <span class="com">// Hiragana is the set of Unicode characters in script Hiragana.</span>
<span id="Imperial_Aramaic">Imperial_Aramaic</span> = _Imperial_Aramaic <span class="com">// Imperial_Aramaic is the set of Unicode characters in script Imperial_Aramaic.</span>
<span id="Inherited">Inherited</span> = _Inherited <span class="com">// Inherited is the set of Unicode characters in script Inherited.</span>
<span id="Inscriptional_Pahlavi">Inscriptional_Pahlavi</span> = _Inscriptional_Pahlavi <span class="com">// Inscriptional_Pahlavi is the set of Unicode characters in script Inscriptional_Pahlavi.</span>
<span id="Inscriptional_Parthian">Inscriptional_Parthian</span> = _Inscriptional_Parthian <span class="com">// Inscriptional_Parthian is the set of Unicode characters in script Inscriptional_Parthian.</span>
<span id="Javanese">Javanese</span> = _Javanese <span class="com">// Javanese is the set of Unicode characters in script Javanese.</span>
<span id="Kaithi">Kaithi</span> = _Kaithi <span class="com">// Kaithi is the set of Unicode characters in script Kaithi.</span>
<span id="Kannada">Kannada</span> = _Kannada <span class="com">// Kannada is the set of Unicode characters in script Kannada.</span>
<span id="Katakana">Katakana</span> = _Katakana <span class="com">// Katakana is the set of Unicode characters in script Katakana.</span>
<span id="Kayah_Li">Kayah_Li</span> = _Kayah_Li <span class="com">// Kayah_Li is the set of Unicode characters in script Kayah_Li.</span>
<span id="Kharoshthi">Kharoshthi</span> = _Kharoshthi <span class="com">// Kharoshthi is the set of Unicode characters in script Kharoshthi.</span>
<span id="Khmer">Khmer</span> = _Khmer <span class="com">// Khmer is the set of Unicode characters in script Khmer.</span>
<span id="Lao">Lao</span> = _Lao <span class="com">// Lao is the set of Unicode characters in script Lao.</span>
<span id="Latin">Latin</span> = _Latin <span class="com">// Latin is the set of Unicode characters in script Latin.</span>
<span id="Lepcha">Lepcha</span> = _Lepcha <span class="com">// Lepcha is the set of Unicode characters in script Lepcha.</span>
<span id="Limbu">Limbu</span> = _Limbu <span class="com">// Limbu is the set of Unicode characters in script Limbu.</span>
<span id="Linear_B">Linear_B</span> = _Linear_B <span class="com">// Linear_B is the set of Unicode characters in script Linear_B.</span>
<span id="Lisu">Lisu</span> = _Lisu <span class="com">// Lisu is the set of Unicode characters in script Lisu.</span>
<span id="Lycian">Lycian</span> = _Lycian <span class="com">// Lycian is the set of Unicode characters in script Lycian.</span>
<span id="Lydian">Lydian</span> = _Lydian <span class="com">// Lydian is the set of Unicode characters in script Lydian.</span>
<span id="Malayalam">Malayalam</span> = _Malayalam <span class="com">// Malayalam is the set of Unicode characters in script Malayalam.</span>
<span id="Mandaic">Mandaic</span> = _Mandaic <span class="com">// Mandaic is the set of Unicode characters in script Mandaic.</span>
<span id="Meetei_Mayek">Meetei_Mayek</span> = _Meetei_Mayek <span class="com">// Meetei_Mayek is the set of Unicode characters in script Meetei_Mayek.</span>
<span id="Meroitic_Cursive">Meroitic_Cursive</span> = _Meroitic_Cursive <span class="com">// Meroitic_Cursive is the set of Unicode characters in script Meroitic_Cursive.</span>
<span id="Meroitic_Hieroglyphs">Meroitic_Hieroglyphs</span> = _Meroitic_Hieroglyphs <span class="com">// Meroitic_Hieroglyphs is the set of Unicode characters in script Meroitic_Hieroglyphs.</span>
<span id="Miao">Miao</span> = _Miao <span class="com">// Miao is the set of Unicode characters in script Miao.</span>
<span id="Mongolian">Mongolian</span> = _Mongolian <span class="com">// Mongolian is the set of Unicode characters in script Mongolian.</span>
<span id="Myanmar">Myanmar</span> = _Myanmar <span class="com">// Myanmar is the set of Unicode characters in script Myanmar.</span>
<span id="New_Tai_Lue">New_Tai_Lue</span> = _New_Tai_Lue <span class="com">// New_Tai_Lue is the set of Unicode characters in script New_Tai_Lue.</span>
<span id="Nko">Nko</span> = _Nko <span class="com">// Nko is the set of Unicode characters in script Nko.</span>
<span id="Ogham">Ogham</span> = _Ogham <span class="com">// Ogham is the set of Unicode characters in script Ogham.</span>
<span id="Ol_Chiki">Ol_Chiki</span> = _Ol_Chiki <span class="com">// Ol_Chiki is the set of Unicode characters in script Ol_Chiki.</span>
<span id="Old_Italic">Old_Italic</span> = _Old_Italic <span class="com">// Old_Italic is the set of Unicode characters in script Old_Italic.</span>
<span id="Old_Persian">Old_Persian</span> = _Old_Persian <span class="com">// Old_Persian is the set of Unicode characters in script Old_Persian.</span>
<span id="Old_South_Arabian">Old_South_Arabian</span> = _Old_South_Arabian <span class="com">// Old_South_Arabian is the set of Unicode characters in script Old_South_Arabian.</span>
<span id="Old_Turkic">Old_Turkic</span> = _Old_Turkic <span class="com">// Old_Turkic is the set of Unicode characters in script Old_Turkic.</span>
<span id="Oriya">Oriya</span> = _Oriya <span class="com">// Oriya is the set of Unicode characters in script Oriya.</span>
<span id="Osmanya">Osmanya</span> = _Osmanya <span class="com">// Osmanya is the set of Unicode characters in script Osmanya.</span>
<span id="Phags_Pa">Phags_Pa</span> = _Phags_Pa <span class="com">// Phags_Pa is the set of Unicode characters in script Phags_Pa.</span>
<span id="Phoenician">Phoenician</span> = _Phoenician <span class="com">// Phoenician is the set of Unicode characters in script Phoenician.</span>
<span id="Rejang">Rejang</span> = _Rejang <span class="com">// Rejang is the set of Unicode characters in script Rejang.</span>
<span id="Runic">Runic</span> = _Runic <span class="com">// Runic is the set of Unicode characters in script Runic.</span>
<span id="Samaritan">Samaritan</span> = _Samaritan <span class="com">// Samaritan is the set of Unicode characters in script Samaritan.</span>
<span id="Saurashtra">Saurashtra</span> = _Saurashtra <span class="com">// Saurashtra is the set of Unicode characters in script Saurashtra.</span>
<span id="Sharada">Sharada</span> = _Sharada <span class="com">// Sharada is the set of Unicode characters in script Sharada.</span>
<span id="Shavian">Shavian</span> = _Shavian <span class="com">// Shavian is the set of Unicode characters in script Shavian.</span>
<span id="Sinhala">Sinhala</span> = _Sinhala <span class="com">// Sinhala is the set of Unicode characters in script Sinhala.</span>
<span id="Sora_Sompeng">Sora_Sompeng</span> = _Sora_Sompeng <span class="com">// Sora_Sompeng is the set of Unicode characters in script Sora_Sompeng.</span>
<span id="Sundanese">Sundanese</span> = _Sundanese <span class="com">// Sundanese is the set of Unicode characters in script Sundanese.</span>
<span id="Syloti_Nagri">Syloti_Nagri</span> = _Syloti_Nagri <span class="com">// Syloti_Nagri is the set of Unicode characters in script Syloti_Nagri.</span>
<span id="Syriac">Syriac</span> = _Syriac <span class="com">// Syriac is the set of Unicode characters in script Syriac.</span>
<span id="Tagalog">Tagalog</span> = _Tagalog <span class="com">// Tagalog is the set of Unicode characters in script Tagalog.</span>
<span id="Tagbanwa">Tagbanwa</span> = _Tagbanwa <span class="com">// Tagbanwa is the set of Unicode characters in script Tagbanwa.</span>
<span id="Tai_Le">Tai_Le</span> = _Tai_Le <span class="com">// Tai_Le is the set of Unicode characters in script Tai_Le.</span>
<span id="Tai_Tham">Tai_Tham</span> = _Tai_Tham <span class="com">// Tai_Tham is the set of Unicode characters in script Tai_Tham.</span>
<span id="Tai_Viet">Tai_Viet</span> = _Tai_Viet <span class="com">// Tai_Viet is the set of Unicode characters in script Tai_Viet.</span>
<span id="Takri">Takri</span> = _Takri <span class="com">// Takri is the set of Unicode characters in script Takri.</span>
<span id="Tamil">Tamil</span> = _Tamil <span class="com">// Tamil is the set of Unicode characters in script Tamil.</span>
<span id="Telugu">Telugu</span> = _Telugu <span class="com">// Telugu is the set of Unicode characters in script Telugu.</span>
<span id="Thaana">Thaana</span> = _Thaana <span class="com">// Thaana is the set of Unicode characters in script Thaana.</span>
<span id="Thai">Thai</span> = _Thai <span class="com">// Thai is the set of Unicode characters in script Thai.</span>
<span id="Tibetan">Tibetan</span> = _Tibetan <span class="com">// Tibetan is the set of Unicode characters in script Tibetan.</span>
<span id="Tifinagh">Tifinagh</span> = _Tifinagh <span class="com">// Tifinagh is the set of Unicode characters in script Tifinagh.</span>
<span id="Ugaritic">Ugaritic</span> = _Ugaritic <span class="com">// Ugaritic is the set of Unicode characters in script Ugaritic.</span>
<span id="Vai">Vai</span> = _Vai <span class="com">// Vai is the set of Unicode characters in script Vai.</span>
<span id="Yi">Yi</span> = _Yi <span class="com">// Yi is the set of Unicode characters in script Yi.</span>
)</pre>
<p>这些变量的类型也是*RangeTable。</p>
<pre>var (
<span id="ASCII_Hex_Digit">ASCII_Hex_Digit</span> = _ASCII_Hex_Digit <span class="com">// ASCII_Hex_Digit is the set of Unicode characters with property ASCII_Hex_Digit.</span>
<span id="Bidi_Control">Bidi_Control</span> = _Bidi_Control <span class="com">// Bidi_Control is the set of Unicode characters with property Bidi_Control.</span>
<span id="Dash">Dash</span> = _Dash <span class="com">// Dash is the set of Unicode characters with property Dash.</span>
<span id="Deprecated">Deprecated</span> = _Deprecated <span class="com">// Deprecated is the set of Unicode characters with property Deprecated.</span>
<span id="Diacritic">Diacritic</span> = _Diacritic <span class="com">// Diacritic is the set of Unicode characters with property Diacritic.</span>
<span id="Extender">Extender</span> = _Extender <span class="com">// Extender is the set of Unicode characters with property Extender.</span>
<span id="Hex_Digit">Hex_Digit</span> = _Hex_Digit <span class="com">// Hex_Digit is the set of Unicode characters with property Hex_Digit.</span>
<span id="Hyphen">Hyphen</span> = _Hyphen <span class="com">// Hyphen is the set of Unicode characters with property Hyphen.</span>
<span id="IDS_Binary_Operator">IDS_Binary_Operator</span> = _IDS_Binary_Operator <span class="com">// IDS_Binary_Operator is the set of Unicode characters with property IDS_Binary_Operator.</span>
<span id="IDS_Trinary_Operator">IDS_Trinary_Operator</span> = _IDS_Trinary_Operator <span class="com">// IDS_Trinary_Operator is the set of Unicode characters with property IDS_Trinary_Operator.</span>
<span id="Ideographic">Ideographic</span> = _Ideographic <span class="com">// Ideographic is the set of Unicode characters with property Ideographic.</span>
<span id="Join_Control">Join_Control</span> = _Join_Control <span class="com">// Join_Control is the set of Unicode characters with property Join_Control.</span>
<span id="Logical_Order_Exception">Logical_Order_Exception</span> = _Logical_Order_Exception <span class="com">// Logical_Order_Exception is the set of Unicode characters with property Logical_Order_Exception.</span>
<span id="Noncharacter_Code_Point">Noncharacter_Code_Point</span> = _Noncharacter_Code_Point <span class="com">// Noncharacter_Code_Point is the set of Unicode characters with property Noncharacter_Code_Point.</span>
<span id="Other_Alphabetic">Other_Alphabetic</span> = _Other_Alphabetic <span class="com">// Other_Alphabetic is the set of Unicode characters with property Other_Alphabetic.</span>
<span id="Other_Default_Ignorable_Code_Point">Other_Default_Ignorable_Code_Point</span> = _Other_Default_Ignorable_Code_Point <span class="com">// Other_Default_Ignorable_Code_Point is the set of Unicode characters with property Other_Default_Ignorable_Code_Point.</span>
<span id="Other_Grapheme_Extend">Other_Grapheme_Extend</span> = _Other_Grapheme_Extend <span class="com">// Other_Grapheme_Extend is the set of Unicode characters with property Other_Grapheme_Extend.</span>
<span id="Other_ID_Continue">Other_ID_Continue</span> = _Other_ID_Continue <span class="com">// Other_ID_Continue is the set of Unicode characters with property Other_ID_Continue.</span>
<span id="Other_ID_Start">Other_ID_Start</span> = _Other_ID_Start <span class="com">// Other_ID_Start is the set of Unicode characters with property Other_ID_Start.</span>
<span id="Other_Lowercase">Other_Lowercase</span> = _Other_Lowercase <span class="com">// Other_Lowercase is the set of Unicode characters with property Other_Lowercase.</span>
<span id="Other_Math">Other_Math</span> = _Other_Math <span class="com">// Other_Math is the set of Unicode characters with property Other_Math.</span>
<span id="Other_Uppercase">Other_Uppercase</span> = _Other_Uppercase <span class="com">// Other_Uppercase is the set of Unicode characters with property Other_Uppercase.</span>
<span id="Pattern_Syntax">Pattern_Syntax</span> = _Pattern_Syntax <span class="com">// Pattern_Syntax is the set of Unicode characters with property Pattern_Syntax.</span>
<span id="Pattern_White_Space">Pattern_White_Space</span> = _Pattern_White_Space <span class="com">// Pattern_White_Space is the set of Unicode characters with property Pattern_White_Space.</span>
<span id="Quotation_Mark">Quotation_Mark</span> = _Quotation_Mark <span class="com">// Quotation_Mark is the set of Unicode characters with property Quotation_Mark.</span>
<span id="Radical">Radical</span> = _Radical <span class="com">// Radical is the set of Unicode characters with property Radical.</span>
<span id="STerm">STerm</span> = _STerm <span class="com">// STerm is the set of Unicode characters with property STerm.</span>
<span id="Soft_Dotted">Soft_Dotted</span> = _Soft_Dotted <span class="com">// Soft_Dotted is the set of Unicode characters with property Soft_Dotted.</span>
<span id="Terminal_Punctuation">Terminal_Punctuation</span> = _Terminal_Punctuation <span class="com">// Terminal_Punctuation is the set of Unicode characters with property Terminal_Punctuation.</span>
<span id="Unified_Ideograph">Unified_Ideograph</span> = _Unified_Ideograph <span class="com">// Unified_Ideograph is the set of Unicode characters with property Unified_Ideograph.</span>
<span id="Variation_Selector">Variation_Selector</span> = _Variation_Selector <span class="com">// Variation_Selector is the set of Unicode characters with property Variation_Selector.</span>
<span id="White_Space">White_Space</span> = _White_Space <span class="com">// White_Space is the set of Unicode characters with property White_Space.</span>
)</pre>
<p>这些变量的类型还是*RangeTable。</p>
<pre>var <span id="CaseRanges">CaseRanges</span> = _CaseRanges</pre>
<p>CaseRanges是描述具有非自映射的所有字母的大小写映射的表格。</p>
<pre>var <span id="Categories">Categories</span> = map[<a href="builtin.htm#string">string</a>]*<a href="#RangeTable">RangeTable</a>{
"C": <a href="#C">C</a>,
"Cc": <a href="#Cc">Cc</a>,
"Cf": <a href="#Cf">Cf</a>,
"Co": <a href="#Co">Co</a>,
"Cs": <a href="#Cs">Cs</a>,
"L": <a href="#L">L</a>,
"Ll": <a href="#Ll">Ll</a>,
"Lm": <a href="#Lm">Lm</a>,
"Lo": <a href="#Lo">Lo</a>,
"Lt": <a href="#Lt">Lt</a>,
"Lu": <a href="#Lu">Lu</a>,
"M": <a href="#M">M</a>,
"Mc": <a href="#Mc">Mc</a>,
"Me": <a href="#Me">Me</a>,
"Mn": <a href="#Mn">Mn</a>,
"N": <a href="#N">N</a>,
"Nd": <a href="#Nd">Nd</a>,
"Nl": <a href="#Nl">Nl</a>,
"No": <a href="#No">No</a>,
"P": <a href="#P">P</a>,
"Pc": <a href="#Pc">Pc</a>,
"Pd": <a href="#Pd">Pd</a>,
"Pe": <a href="#Pe">Pe</a>,
"Pf": <a href="#Pf">Pf</a>,
"Pi": <a href="#Pi">Pi</a>,
"Po": <a href="#Po">Po</a>,
"Ps": <a href="#Ps">Ps</a>,
"S": <a href="#S">S</a>,
"Sc": <a href="#Sc">Sc</a>,
"Sk": <a href="#Sk">Sk</a>,
"Sm": <a href="#Sm">Sm</a>,
"So": <a href="#So">So</a>,
"Z": <a href="#Z">Z</a>,
"Zl": <a href="#Zl">Zl</a>,
"Zp": <a href="#Zp">Zp</a>,
"Zs": <a href="#Zs">Zs</a>,
}</pre>
<p>Categories是一组Unicode类别表.</p>
<pre>var <span id="FoldCategory">FoldCategory</span> = map[<a href="builtin.htm#string">string</a>]*<a href="#RangeTable">RangeTable</a>{
"Common": foldCommon,
"Greek": foldGreek,
"Inherited": foldInherited,
"L": foldL,
"Ll": foldLl,
"Lt": foldLt,
"Lu": foldLu,
"M": foldM,
"Mn": foldMn,
}</pre>
<p>FoldCategory将类别名称映射到类别外的代码点表,这些代码点在简单大小写折叠的情况下等同于类别内的代码点。如果没有类别名称的条目,则不存在这样的点。</p>
<pre>var <span id="FoldScript">FoldScript</span> = map[<a href="builtin.htm#string">string</a>]*<a href="#RangeTable">RangeTable</a>{}</pre>
<p>FoldScript将脚本名称映射到脚本外的代码点表,这些代码点在简单案例折叠到脚本内的代码点之后是等同的。如果没有条目名称的条目,则没有这样的条目。</p>
<pre>var <span id="GraphicRanges">GraphicRanges</span> = []*<a href="#RangeTable">RangeTable</a>{
<a href="#L">L</a>, <a href="#M">M</a>, <a href="#N">N</a>, <a href="#P">P</a>, <a href="#S">S</a>, <a href="#Zs">Zs</a>,
}</pre>
<p>GraphicRanges根据Unicode定义了一组图形字符。</p>
<pre>var <span id="PrintRanges">PrintRanges</span> = []*<a href="#RangeTable">RangeTable</a>{
<a href="#L">L</a>, <a href="#M">M</a>, <a href="#N">N</a>, <a href="#P">P</a>, <a href="#S">S</a>,
}</pre>
<p>PrintRanges根据Go定义一组可打印的字符。ASCII space, U+0020, 分开处理。</p>
<pre>var <span id="Properties">Properties</span> = map[<a href="builtin.htm#string">string</a>]*<a href="#RangeTable">RangeTable</a>{
"ASCII_Hex_Digit": <a href="#ASCII_Hex_Digit">ASCII_Hex_Digit</a>,
"Bidi_Control": <a href="#Bidi_Control">Bidi_Control</a>,
"Dash": <a href="#Dash">Dash</a>,
"Deprecated": <a href="#Deprecated">Deprecated</a>,
"Diacritic": <a href="#Diacritic">Diacritic</a>,
"Extender": <a href="#Extender">Extender</a>,
"Hex_Digit": <a href="#Hex_Digit">Hex_Digit</a>,
"Hyphen": <a href="#Hyphen">Hyphen</a>,
"IDS_Binary_Operator": <a href="#IDS_Binary_Operator">IDS_Binary_Operator</a>,
"IDS_Trinary_Operator": <a href="#IDS_Trinary_Operator">IDS_Trinary_Operator</a>,
"Ideographic": <a href="#Ideographic">Ideographic</a>,
"Join_Control": <a href="#Join_Control">Join_Control</a>,
"Logical_Order_Exception": <a href="#Logical_Order_Exception">Logical_Order_Exception</a>,
"Noncharacter_Code_Point": <a href="#Noncharacter_Code_Point">Noncharacter_Code_Point</a>,
"Other_Alphabetic": <a href="#Other_Alphabetic">Other_Alphabetic</a>,
"Other_Default_Ignorable_Code_Point": <a href="#Other_Default_Ignorable_Code_Point">Other_Default_Ignorable_Code_Point</a>,
"Other_Grapheme_Extend": <a href="#Other_Grapheme_Extend">Other_Grapheme_Extend</a>,
"Other_ID_Continue": <a href="#Other_ID_Continue">Other_ID_Continue</a>,
"Other_ID_Start": <a href="#Other_ID_Start">Other_ID_Start</a>,
"Other_Lowercase": <a href="#Other_Lowercase">Other_Lowercase</a>,
"Other_Math": <a href="#Other_Math">Other_Math</a>,
"Other_Uppercase": <a href="#Other_Uppercase">Other_Uppercase</a>,
"Pattern_Syntax": <a href="#Pattern_Syntax">Pattern_Syntax</a>,
"Pattern_White_Space": <a href="#Pattern_White_Space">Pattern_White_Space</a>,
"Quotation_Mark": <a href="#Quotation_Mark">Quotation_Mark</a>,
"Radical": <a href="#Radical">Radical</a>,
"STerm": <a href="#STerm">STerm</a>,
"Soft_Dotted": <a href="#Soft_Dotted">Soft_Dotted</a>,
"Terminal_Punctuation": <a href="#Terminal_Punctuation">Terminal_Punctuation</a>,
"Unified_Ideograph": <a href="#Unified_Ideograph">Unified_Ideograph</a>,
"Variation_Selector": <a href="#Variation_Selector">Variation_Selector</a>,
"White_Space": <a href="#White_Space">White_Space</a>,
}</pre>
<p>Properties是Unicode属性表的集合。</p>
<pre>var <span id="Scripts">Scripts</span> = map[<a href="builtin.htm#string">string</a>]*<a href="#RangeTable">RangeTable</a>{
"Arabic": <a href="#Arabic">Arabic</a>,
"Armenian": <a href="#Armenian">Armenian</a>,
"Avestan": <a href="#Avestan">Avestan</a>,
"Balinese": <a href="#Balinese">Balinese</a>,
"Bamum": <a href="#Bamum">Bamum</a>,
"Batak": <a href="#Batak">Batak</a>,
"Bengali": <a href="#Bengali">Bengali</a>,
"Bopomofo": <a href="#Bopomofo">Bopomofo</a>,
"Brahmi": <a href="#Brahmi">Brahmi</a>,
"Braille": <a href="#Braille">Braille</a>,
"Buginese": <a href="#Buginese">Buginese</a>,
"Buhid": <a href="#Buhid">Buhid</a>,
"Canadian_Aboriginal": <a href="#Canadian_Aboriginal">Canadian_Aboriginal</a>,
"Carian": <a href="#Carian">Carian</a>,
"Chakma": <a href="#Chakma">Chakma</a>,
"Cham": <a href="#Cham">Cham</a>,
"Cherokee": <a href="#Cherokee">Cherokee</a>,
"Common": <a href="#Common">Common</a>,
"Coptic": <a href="#Coptic">Coptic</a>,
"Cuneiform": <a href="#Cuneiform">Cuneiform</a>,
"Cypriot": <a href="#Cypriot">Cypriot</a>,
"Cyrillic": <a href="#Cyrillic">Cyrillic</a>,
"Deseret": <a href="#Deseret">Deseret</a>,
"Devanagari": <a href="#Devanagari">Devanagari</a>,
"Egyptian_Hieroglyphs": <a href="#Egyptian_Hieroglyphs">Egyptian_Hieroglyphs</a>,
"Ethiopic": <a href="#Ethiopic">Ethiopic</a>,
"Georgian": <a href="#Georgian">Georgian</a>,
"Glagolitic": <a href="#Glagolitic">Glagolitic</a>,
"Gothic": <a href="#Gothic">Gothic</a>,
"Greek": <a href="#Greek">Greek</a>,
"Gujarati": <a href="#Gujarati">Gujarati</a>,
"Gurmukhi": <a href="#Gurmukhi">Gurmukhi</a>,
"Han": <a href="#Han">Han</a>,
"Hangul": <a href="#Hangul">Hangul</a>,
"Hanunoo": <a href="#Hanunoo">Hanunoo</a>,
"Hebrew": <a href="#Hebrew">Hebrew</a>,
"Hiragana": <a href="#Hiragana">Hiragana</a>,
"Imperial_Aramaic": <a href="#Imperial_Aramaic">Imperial_Aramaic</a>,
"Inherited": <a href="#Inherited">Inherited</a>,
"Inscriptional_Pahlavi": <a href="#Inscriptional_Pahlavi">Inscriptional_Pahlavi</a>,
"Inscriptional_Parthian": <a href="#Inscriptional_Parthian">Inscriptional_Parthian</a>,
"Javanese": <a href="#Javanese">Javanese</a>,
"Kaithi": <a href="#Kaithi">Kaithi</a>,
"Kannada": <a href="#Kannada">Kannada</a>,
"Katakana": <a href="#Katakana">Katakana</a>,
"Kayah_Li": <a href="#Kayah_Li">Kayah_Li</a>,
"Kharoshthi": <a href="#Kharoshthi">Kharoshthi</a>,
"Khmer": <a href="#Khmer">Khmer</a>,
"Lao": <a href="#Lao">Lao</a>,
"Latin": <a href="#Latin">Latin</a>,
"Lepcha": <a href="#Lepcha">Lepcha</a>,
"Limbu": <a href="#Limbu">Limbu</a>,
"Linear_B": <a href="#Linear_B">Linear_B</a>,
"Lisu": <a href="#Lisu">Lisu</a>,
"Lycian": <a href="#Lycian">Lycian</a>,
"Lydian": <a href="#Lydian">Lydian</a>,
"Malayalam": <a href="#Malayalam">Malayalam</a>,
"Mandaic": <a href="#Mandaic">Mandaic</a>,
"Meetei_Mayek": <a href="#Meetei_Mayek">Meetei_Mayek</a>,
"Meroitic_Cursive": <a href="#Meroitic_Cursive">Meroitic_Cursive</a>,
"Meroitic_Hieroglyphs": <a href="#Meroitic_Hieroglyphs">Meroitic_Hieroglyphs</a>,
"Miao": <a href="#Miao">Miao</a>,
"Mongolian": <a href="#Mongolian">Mongolian</a>,
"Myanmar": <a href="#Myanmar">Myanmar</a>,
"New_Tai_Lue": <a href="#New_Tai_Lue">New_Tai_Lue</a>,
"Nko": <a href="#Nko">Nko</a>,
"Ogham": <a href="#Ogham">Ogham</a>,
"Ol_Chiki": <a href="#Ol_Chiki">Ol_Chiki</a>,
"Old_Italic": <a href="#Old_Italic">Old_Italic</a>,
"Old_Persian": <a href="#Old_Persian">Old_Persian</a>,
"Old_South_Arabian": <a href="#Old_South_Arabian">Old_South_Arabian</a>,
"Old_Turkic": <a href="#Old_Turkic">Old_Turkic</a>,
"Oriya": <a href="#Oriya">Oriya</a>,
"Osmanya": <a href="#Osmanya">Osmanya</a>,
"Phags_Pa": <a href="#Phags_Pa">Phags_Pa</a>,
"Phoenician": <a href="#Phoenician">Phoenician</a>,
"Rejang": <a href="#Rejang">Rejang</a>,
"Runic": <a href="#Runic">Runic</a>,
"Samaritan": <a href="#Samaritan">Samaritan</a>,
"Saurashtra": <a href="#Saurashtra">Saurashtra</a>,
"Sharada": <a href="#Sharada">Sharada</a>,
"Shavian": <a href="#Shavian">Shavian</a>,
"Sinhala": <a href="#Sinhala">Sinhala</a>,
"Sora_Sompeng": <a href="#Sora_Sompeng">Sora_Sompeng</a>,
"Sundanese": <a href="#Sundanese">Sundanese</a>,
"Syloti_Nagri": <a href="#Syloti_Nagri">Syloti_Nagri</a>,
"Syriac": <a href="#Syriac">Syriac</a>,
"Tagalog": <a href="#Tagalog">Tagalog</a>,
"Tagbanwa": <a href="#Tagbanwa">Tagbanwa</a>,
"Tai_Le": <a href="#Tai_Le">Tai_Le</a>,
"Tai_Tham": <a href="#Tai_Tham">Tai_Tham</a>,
"Tai_Viet": <a href="#Tai_Viet">Tai_Viet</a>,
"Takri": <a href="#Takri">Takri</a>,
"Tamil": <a href="#Tamil">Tamil</a>,
"Telugu": <a href="#Telugu">Telugu</a>,
"Thaana": <a href="#Thaana">Thaana</a>,
"Thai": <a href="#Thai">Thai</a>,
"Tibetan": <a href="#Tibetan">Tibetan</a>,
"Tifinagh": <a href="#Tifinagh">Tifinagh</a>,
"Ugaritic": <a href="#Ugaritic">Ugaritic</a>,
"Vai": <a href="#Vai">Vai</a>,
"Yi": <a href="#Yi">Yi</a>,
}</pre>
<p>Scripts是一组Unicode脚本表。</p>
<h3 id="CaseRange">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#54">CaseRange</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>type CaseRange struct {
<span id="CaseRange.Lo">Lo</span> <a href="builtin.htm#uint32">uint32</a>
<span id="CaseRange.Hi">Hi</span> <a href="builtin.htm#uint32">uint32</a>
<span id="CaseRange.Delta">Delta</span> d <span class="com">// d为[MaxCase]rune的命名类型</span>
}</pre>
<p align="left">代表简单的unicode码值的一一映射。范围为[Lo, Hi],步长为1。</p>
<p align="left">该范围内的每个值+Delta[UpperCase]表示对应的大写字母;</p>
<p align="left">该范围内的每个值+Delta[LowerCase]表示对应的小写字母;</p>
<p align="left">该范围内的每个值+Delta[TitleCase]表示对应的标题字母。</p>
<p align="left">Delta数组里的值可为负数或零。如果Delta数组是:</p>
<pre>{UpperLower, UpperLower, UpperLower}
</pre>
<p>表示[Lo, Hi]范围的字符序列是交替的、对应的大写字母小写字母对。否则常数UpperLower不能用Delta数组里。</p>
<h3 id="Range16">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#29">Range16</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>type Range16 struct {
<span id="Range16.Lo">Lo</span> <a href="builtin.htm#uint16">uint16</a>
<span id="Range16.Hi">Hi</span> <a href="builtin.htm#uint16">uint16</a>
<span id="Range16.Stride">Stride</span> <a href="builtin.htm#uint16">uint16</a>
}</pre>
<p>代表一系列16位unicode码值,范围为Lo到Hi(可以是Lo/Hi),步长为Stride。</p>
<h3 id="Range32">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#38">Range32</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>type Range32 struct {
<span id="Range32.Lo">Lo</span> <a href="builtin.htm#uint32">uint32</a>
<span id="Range32.Hi">Hi</span> <a href="builtin.htm#uint32">uint32</a>
<span id="Range32.Stride">Stride</span> <a href="builtin.htm#uint32">uint32</a>
}</pre>
<p>代表一系列32位unicode码值,范围为Lo到Hi(可以是Lo/Hi),步长为Stride;Lo和Hi必须大于等于1<<16。</p>
<h3 id="RangeTable">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#21">RangeTable</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>type RangeTable struct {
<span id="RangeTable.R16">R16</span> []<a href="#Range16">Range16</a>
<span id="RangeTable.R32">R32</span> []<a href="#Range32">Range32</a> <span class="com">// R32不能包含低于0x10000(即1<<16)的值</span>
<span id="RangeTable.LatinOffset">LatinOffset</span> <a href="builtin.htm#int">int</a> <span class="com">// R16字段中Hi <= MaxLatin1的成员数</span>
}</pre>
<p>通过列出集合中码值的范围,定义了一个unicode码值的集合。出于节省空间,范围保存在两个切片里,分别保存16位字符的范围和32位字符的范围。R16和R32必须是有序排列的,且互不重叠的。</p>
<h3 id="SpecialCase">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#62">SpecialCase</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>type SpecialCase []<a href="#CaseRange">CaseRange</a></pre>
<p>SpecialCase代表特定语言的字符映射,如土耳其语。本类型的方法(通过覆盖)定制了标准映射。</p>
<pre>var <span id="AzeriCase">AzeriCase</span> <a href="#SpecialCase">SpecialCase</a> = _TurkishCase</pre>
<pre>var <span id="TurkishCase">TurkishCase</span> <a href="#SpecialCase">SpecialCase</a> = _TurkishCase</pre>
<h4 id="SpecialCase.ToLower">func (SpecialCase) <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#299">ToLower</a> <a class="permalink" href="#pkg-index">¶</a></h4>
<pre class="funcdecl">func (special <a href="#SpecialCase">SpecialCase</a>) ToLower(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#rune">rune</a></pre>
<p>按特定映射,返回对应的小写字母。</p>
<h4 id="SpecialCase.ToUpper">func (SpecialCase) <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#281">ToUpper</a> <a class="permalink" href="#pkg-index">¶</a></h4>
<pre class="funcdecl">func (special <a href="#SpecialCase">SpecialCase</a>) ToUpper(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#rune">rune</a></pre>
<p>按特定映射,返回对应的大写字母。</p>
<h4 id="SpecialCase.ToTitle">func (SpecialCase) <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#290">ToTitle</a> <a class="permalink" href="#pkg-index">¶</a></h4>
<pre class="funcdecl">func (special <a href="#SpecialCase">SpecialCase</a>) ToTitle(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#rune">rune</a></pre>
<p>按特定映射,返回对应的标题字母。</p>
<h3 id="Is">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#155">Is</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func Is(rangeTab *<a href="#RangeTable">RangeTable</a>, r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>函数报告r是否在rangeTab指定的字符范围内。</p>
<h3 id="In">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#69">In</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func In(r <a href="builtin.htm#rune">rune</a>, ranges ...*<a href="#RangeTable">RangeTable</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>函数报告r是否是给出的ranges字母集中的某个成员。</p>
<h3 id="IsOneOf">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#59">IsOneOf</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsOneOf(ranges []*<a href="#RangeTable">RangeTable</a>, r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>函数报告r是否是ranges某个成员指定的字符范围内。本函数的功能类似In,应优先使用In函数。</p>
<h3 id="IsSpace">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#126">IsSpace</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsSpace(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsSpace报告一个字符是否是空白字符。在Latin-1字符空间中,空白字符为:</p>
<pre>'\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP).
</pre>
<p>其它的空白字符请参见策略Z和属性Pattern_White_Space。</p>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading" onclick="document.getElementById('ex-IsSpace').style.display = document.getElementById('ex-IsSpace').style.display=='none'?'block':'none';">Example</div>
<div id="ex-IsSpace" class="panel-collapse collapse">
<div class="panel-body">
<pre>
fmt.Println(unicode.IsSpace(' ')) // true
fmt.Println(unicode.IsSpace('\n')) // true
fmt.Println(unicode.IsSpace('\t')) // true
</pre>
</div>
</div>
</div>
</div>
<h3 id="IsDigit">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/digit.go?name=release#8">IsDigit</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsDigit(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsDigit报告一个r字符是否是十进制数字字符。</p>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading" onclick="document.getElementById('ex-IsDigit').style.display = document.getElementById('ex-IsDigit').style.display=='none'?'block':'none';">Example</div>
<div id="ex-IsDigit" class="panel-collapse collapse">
<div class="panel-body">
<pre>
fmt.Println(unicode.IsDigit('0')) // true
fmt.Println(unicode.IsDigit('9')) // true
fmt.Println(unicode.IsDigit('A')) // false
fmt.Println(unicode.IsDigit('f')) // false
</pre>
</div>
</div>
</div>
</div>
<h3 id="IsNumber">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#104">IsNumber</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsNumber(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsNumber报告一个字符是否是数字字符,参见策略N。</p>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading" onclick="document.getElementById('ex-IsNumber').style.display = document.getElementById('ex-IsNumber').style.display=='none'?'block':'none';">Example</div>
<div id="ex-IsNumber" class="panel-collapse collapse">
<div class="panel-body">
<pre>
fmt.Println(unicode.IsNumber('0')) // true
fmt.Println(unicode.IsNumber('9')) // true
fmt.Println(unicode.IsNumber('A')) // false
fmt.Println(unicode.IsNumber('f')) // false
</pre>
</div>
</div>
</div>
</div>
<h3 id="IsLetter">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#90">IsLetter</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsLetter(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsLetter报告一个字符是否是字母,参见策略L。</p>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading" onclick="document.getElementById('ex-IsLetter').style.display = document.getElementById('ex-IsLetter').style.display=='none'?'block':'none';">Example</div>
<div id="ex-IsLetter" class="panel-collapse collapse">
<div class="panel-body">
<pre>
fmt.Println(unicode.IsLetter('0')) // false
fmt.Println(unicode.IsLetter('9')) // false
fmt.Println(unicode.IsLetter('A')) // true
fmt.Println(unicode.IsLetter('z')) // true
fmt.Println(unicode.IsLetter('😘')) // false
</pre>
</div>
</div>
</div>
</div>
<h3 id="IsGraphic">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#36">IsGraphic</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsGraphic(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>报告一个字符是否是unicode图形。包括字母、标记、数字、符号、标点、空白,参见L、M、N、P、S、Zs。</p>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading" onclick="document.getElementById('ex-IsGraphic').style.display = document.getElementById('ex-IsGraphic').style.display=='none'?'block':'none';">Example</div>
<div id="ex-IsGraphic" class="panel-collapse collapse">
<div class="panel-body">
<pre>
fmt.Println(unicode.IsGraphic('0')) // true
fmt.Println(unicode.IsGraphic('9')) // true
fmt.Println(unicode.IsGraphic('A')) // true
fmt.Println(unicode.IsGraphic('z')) // true
fmt.Println(unicode.IsGraphic('😘')) // true
fmt.Println(unicode.IsGraphic('尶')) // true
</pre>
</div>
</div>
</div>
</div>
<h3 id="IsMark">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#98">IsMark</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsMark(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsMark报告一个字符是否是标记字符,参见策略M。</p>
<h3 id="IsPrint">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#50">IsPrint</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsPrint(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsPrint一个字符是否是go的可打印字符。本函数基本和IsGraphic一致,只是ASCII空白字符U+0020会返回假。</p>
<h3 id="IsControl">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#81">IsControl</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsControl(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsControl报告一个字符是否是控制字符,主要是策略C的字符和一些其他的字符如代理字符。</p>
<h3 id="IsPunct">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#113">IsPunct</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsPunct(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsPunct报告一个字符是否是unicode标点字符,参见策略P。</p>
<h3 id="IsSymbol">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/graphic.go?name=release#139">IsSymbol</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsSymbol(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>IsPunct报告一个字符是否是unicode符号字符。</p>
<h3 id="IsLower">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#189">IsLower</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsLower(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>返回字符是否是小写字母。</p>
<h3 id="IsUpper">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#180">IsUpper</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsUpper(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>返回字符是否是大写字母。</p>
<h3 id="IsTitle">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#198">IsTitle</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func IsTitle(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#bool">bool</a></pre>
<p>返回字符是否是标题字母。</p>
<h3 id="To">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#243">To</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func To(_case <a href="builtin.htm#int">int</a>, r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#rune">rune</a></pre>
<p>返回_case指定的对应类型的字母:UpperCase、LowerCase、TitleCase。</p>
<h3 id="ToLower">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#259">ToLower</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func ToLower(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#rune">rune</a></pre>
<p>返回对应的小写字母。</p>
<h3 id="ToUpper">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#248">ToUpper</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func ToUpper(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#rune">rune</a></pre>
<p>返回对应的大写字母。</p>
<h3 id="ToTitle">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#270">ToTitle</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func ToTitle(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#rune">rune</a></pre>
<p>返回对应的标题字母。</p>
<h3 id="SimpleFold">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#331">SimpleFold</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func SimpleFold(r <a href="builtin.htm#rune">rune</a>) <a href="builtin.htm#rune">rune</a></pre>
<p>SimpleFold函数迭代在unicode标准字符映射中互相对应的unicode码值。在与r对应的码值中(包括r自身),会返回最小的那个大于r的字符(如果有);否则返回映射中最小的字符。</p>
<p>举例:</p>
<pre>SimpleFold('A') = 'a'
SimpleFold('a') = 'A'
SimpleFold('K') = 'k'
SimpleFold('k') = '\u212A' (Kelvin symbol, K)
SimpleFold('\u212A') = 'K'
SimpleFold('1') = '1'
</pre>
<h3 id="pkg-note-bug">Bugs <a class="permalink" href="#pkg-index">¶</a></h3>
<p><a title="View Source" href="https://github.com/golang/go/blob/master/src/unicode/letter.go?name=release#64">☞</a> 没有全字符(包含多个rune的字符)折叠的机制。<a class="permalink" href="#pkg-index">¶</a>
</div>
<div id="x-footer" class="clearfix">
<div class="container">
<a href="http://studygolang.com/" target="_blank">Go语言中文网</a>
<span class="text-muted">|</span> <a href="http://golang.org/" target="_blank">Go Language</a>
<span class="pull-right"><a href="#">Back to top</a></span>
</div>
</div>
<script src="../assets/jquery-2.0.3.min.js"></script>
<script src="../assets/bootstrap.min.js"></script>
<script src="../assets/site.js"></script>
</body>
</html>