]> git.saurik.com Git - apple/icu.git/blob - icuSources/data/brkitr/char.txt
ICU-8.11.tar.gz
[apple/icu.git] / icuSources / data / brkitr / char.txt
1 #
2 # Copyright (C) 2002-2006, International Business Machines Corporation and others.
3 # All Rights Reserved.
4 #
5 # file: char.txt
6 #
7 # ICU Character Break Rules, also known as Grapheme Cluster Boundaries
8 # See Unicode Standard Annex #29.
9 # These rules are based on TR29 Version 5.0.0
10 # Includes post-5.0 change to treat Japanese half width voicing marks
11 # as Grapheme Extend.
12 #
13
14 #
15 # Character Class Definitions.
16 #
17 $CR = [\p{Grapheme_Cluster_Break = CR}];
18 $LF = [\p{Grapheme_Cluster_Break = LF}];
19 $Control = [\p{Grapheme_Cluster_Break = Control}];
20
21 # add Japanese Half Width voicing marks to $Extend
22 $VoiceMarks = [\uff9e\uff9f];
23 $Extend = [\p{Grapheme_Cluster_Break = Extend} $VoiceMarks];
24
25 #
26 # Korean Syllable Definitions
27 #
28 $L = [\p{Grapheme_Cluster_Break = L}];
29 $V = [\p{Grapheme_Cluster_Break = V}];
30 $T = [\p{Grapheme_Cluster_Break = T}];
31
32 $LV = [\p{Grapheme_Cluster_Break = LV}];
33 $LVT = [\p{Grapheme_Cluster_Break = LVT}];
34
35 $HangulSyllable = $L+ | ($L* ($LV? $V+ | $LV | $LVT) $T*) | $T+;
36
37 ## -------------------------------------------------
38
39 !!forward;
40
41 $CR $LF;
42 ([^$Control $CR $LF] | $HangulSyllable) $Extend*;
43
44 ## -------------------------------------------------
45
46 !!reverse;
47
48 $BackHangulSyllable = $L+ | ($T* ($V+$LV? | $LV | $LVT) $L*) | $T+;
49 $BackOneCluster = ($LF $CR) | ($Extend* ([^$Control $CR $LF] | $BackHangulSyllable));
50 $BackOneCluster;
51
52 ## -------------------------------------------------
53
54 !!safe_reverse;
55
56 # rule 6, 7, 8
57 $V+ $L;
58
59 ## -------------------------------------------------
60
61 !!safe_forward;
62
63 # rule 6, 7, 8
64 $V+ $T;