2 # Copyright (C) 2002-2009, International Business Machines Corporation and others.
7 # ICU Character Break Rules, also known as Grapheme Cluster Boundaries
8 # See Unicode Standard Annex #29.
9 # These rules are based on TR29 Revision 13, for Unicode Version 5.1
10 # Modifications to SpacingMark and Prepend by M. Hosken.
14 # Character Class Definitions.
16 $CR = [\p{Grapheme_Cluster_Break = CR}];
17 $LF = [\p{Grapheme_Cluster_Break = LF}];
18 $Control = [\p{Grapheme_Cluster_Break = Control}];
19 $Prepend = [\p{Grapheme_Cluster_Break = Prepend}];
20 $Extend = [\p{Grapheme_Cluster_Break = Extend}];
21 $SpacingMark = [\p{Grapheme_Cluster_Break = SpacingMark}];
22 # True Indic wants to move by syllables. Break up SpacingMark. This based on Unicode 6.0 data
23 # In effect it is [\p{Grapheme_Cluster_Break = SpacingMark} - \u0E30 \u0E32 \u0E45 \u0EB0 \u0EB2 \u102B \u102C \u1038
24 # \u1062-\u1064 \u1067-\u106D \u1083 \u1087-\u108C \u108F \u109A-\u109C \u19B0-\u19B4 \u19B8-\u19C0 \u19C8 \u19C9
25 # \u1A61 \u1A63 \u1A64 \u1BE7 \u1BEA-\u1BEC \u1BEE \u1BF2 \u1BF3 \uAA7B
26 $IndicSpacing = [\u0903 \u093B \u093E-\u0940 \u0949-\u094C \u094E \u094F \u0982 \u0983 \u09BF \u09C0 \u09C7 \u09C8 \u09CB \u09CC \u0A03 \u0A3E-\u0A40 \u0A83 \u0ABE-\u0AC0 \u0AC9 \u0ACB \u0ACC \u0B02 \u0B03 \u0B40 \u0B47 \u0B48 \u0B4B-\u0B4C \u0BBF \u0BC1 \u0BC2 \u0BC6-\u0BC8 \u0BCA-\u0BCC \u0C01-\u0C03 \u0C41-\u0C44 \u0C82 \u0C83 \u0CBE \u0CC0 \u0CC1 \u0CC3 \u0CC4 \u0CC7 \u0CC8 \u0CCA \u0CCB \u0D02 \u0D03 \u0D3F \u0D40 \u0D46-\u0D48 \u0D4A-\u0D4C \u0D82 \u0D83 \u0DD0 \u0DD1 \u0DD8-\u0DDE \u0F3E \u0F3F \u0F7F \u1923-\u1926 \u1929-\u192B \u1930 \u1931 \u1933-\u1938 \u1A19-\u1A1B \u1B04 \u1B35 \u1B3B \u1B3D-\u1B41 \u1B43 \u1B44 \u1B82 \u1BA1 \u1BA6 \u1BA7 \u1BAA \u1C24-\u1C2B \u1C34 \u1C35 \u1CE1 \u1CF2 \uA880 \uA881 \uA8B4-\uA8C3 \uA952 \uA953 \uA983 \uA9B4 \uA9B5 \uA9BA \uA9BB \uA9BD-\uA9C0 \uAA2F \uAA30 \uAA33 \uAA34 \uABE3 \uABE4 \uABE6 \uABE7 \uABE9 \uABEA \uABEC \U00011000 \U00011002 \U00011082 \U000110B0-\U000110B2 \U000110B7 \U000100B8 \U0001D166 \U0001D16D];
27 # SEAsian (Thai, Lao, Burmese, Tai Lue, Tai Tham, Batak) are cluster based not syllable based
28 $SEASpacing = [\u0E33 \u0EB3 \u1031 \u103B \u103C \u1056 \u1057 \u1084 \u17B6 \u17BE-\u17C5 \u17C7 \u17C8 \u19B5-\u19B7 \u19BA \u1A55 \u1A57 \u1A6D-\u1A72 \uA823 \uA824 \uA827 \uAA4D];
29 $BengaliLetter = [\u0985-\u09B9 \u09CE \u09DC-\u09E1 \u09F0-\u09F1];
30 $BengaliSignVirama = \u09CD;
31 $GujaratiLetter = [\u0A85-\u0A8C \u0A8F-\u0A90 \u0A93-\u0AB9 \u0AE0-\u0AE1];
32 $GujaratiSignVirama = \u0ACD;
33 $DevanagariLetter = [\u0904-\u0939 \u0958-\u0961 \u0972-\u097F];
34 $DevanagariSignVirama = \u094D;
35 $KannadaLetter = [\u0C85-\u0CB9 \u0CDE-\u0CE1];
36 $KannadaSignVirama = \u0CCD;
37 $MalayalamLetter = [\u0D05-\u0D39 \u0D60-\u0D61 \u0D7A-\u0D7F];
38 $MalayalamSignVirama = \u0D4D;
39 $OdiaLetter = [\u0B05-\u0B39 \u0B5C-\u0B61 \u0B71];
40 $OdiaSignVirama = \u0B4D;
41 $GurmukhiLetter = [\u0A05-\u0A39 \u0A59-\u0A5E];
42 $GurmukhiSignVirama = \u0A4D;
44 $TamilSignVirama = \u0BCD;
46 $TeluguLetter = [\u0C05-\u0C39 \u0C58-\u0C61];
47 $TeluguSignVirama = \u0C4D;
50 # Korean Syllable Definitions
52 $L = [\p{Grapheme_Cluster_Break = L}];
53 $V = [\p{Grapheme_Cluster_Break = V}];
54 $T = [\p{Grapheme_Cluster_Break = T}];
56 $LV = [\p{Grapheme_Cluster_Break = LV}];
57 $LVT = [\p{Grapheme_Cluster_Break = LVT}];
60 ## -------------------------------------------------
67 $BengaliLetter ($BengaliSignVirama $BengaliLetter?)+;
68 $GujaratiLetter ($GujaratiSignVirama $GujaratiLetter?)+;
69 $DevanagariLetter ($DevanagariSignVirama $DevanagariLetter?)+;
70 $KannadaLetter ($KannadaSignVirama $KannadaLetter?)+;
71 $MalayalamLetter ($MalayalamSignVirama $MalayalamLetter?)+;
72 $OdiaLetter ($OdiaSignVirama $OdiaLetter?)+;
73 $GurmukhiLetter ($GurmukhiSignVirama $GurmukhiLetter?)+;
74 $TamilKa $TamilSignVirama $TamilSsa;
75 $TeluguLetter ($TeluguSignVirama $TeluguLetter?)+;
77 $L ($L | $V | $LV | $LVT);
81 [^$Control $CR $LF] $Extend;
83 [^$Control $CR $LF] ($IndicSpacing | $SEASpacing);
84 #[^$Control $CR $LF] $SpacingMark;
85 # $Prepend [^$Control $CR $LF];
88 ## -------------------------------------------------
92 ($BengaliLetter? $BengaliSignVirama)+ $BengaliLetter;
93 ($GujaratiLetter? $GujaratiSignVirama)+ $GujaratiLetter;
94 ($DevanagariLetter? $DevanagariSignVirama)+ $DevanagariLetter;
95 ($KannadaLetter? $KannadaSignVirama)+ $KannadaLetter;
96 ($MalayalamLetter? $MalayalamSignVirama)+ $MalayalamLetter;
97 ($OdiaLetter? $OdiaSignVirama)+ $OdiaLetter;
98 ($GurmukhiLetter? $GurmukhiSignVirama)+ $GurmukhiLetter;
99 $TamilSsa $TamilSignVirama $TamilKa;
100 ($TeluguLetter? $TeluguSignVirama)+ $TeluguLetter;
101 ($L | $V | $LV | $LVT) $L;
102 ($V | $T) ($LV | $V);
105 $Extend [^$Control $CR $LF];
106 ($IndicSpacing | $SEASpacing) [^$Control $CR $LF];
107 #$SpacingMark [^$Control $CR $LF];
108 # [^$Control $CR $LF] $Prepend;
111 ## -------------------------------------------------
116 ## -------------------------------------------------