2 # Copyright (C) 2016 and later: Unicode, Inc. and others.
3 # License & terms of use: http://www.unicode.org/copyright.html
4 # Copyright (C) 2002-2016, International Business Machines Corporation and others.
9 # ICU Character Break Rules
10 # These rules are based on the Extended Grapheme Cluster rules from
11 # Unicode UAX #29 Revision 34 for Unicode Version 12.0
13 !!quoted_literals_only;
16 # Character Class Definitions.
18 $CR = [\p{Grapheme_Cluster_Break = CR}];
19 $LF = [\p{Grapheme_Cluster_Break = LF}];
20 $Control = [[\p{Grapheme_Cluster_Break = Control}]];
21 $Extend = [[\p{Grapheme_Cluster_Break = Extend}]];
22 $ZWJ = [\p{Grapheme_Cluster_Break = ZWJ}];
23 $Regional_Indicator = [\p{Grapheme_Cluster_Break = Regional_Indicator}];
24 $Prepend = [\p{Grapheme_Cluster_Break = Prepend}];
25 $SpacingMark = [\p{Grapheme_Cluster_Break = SpacingMark}];
28 # From cldr/common/properties/segments/
29 # and issue CLDR-10994
31 $Virama = [\p{Gujr}\p{sc=Telu}\p{sc=Mlym}\p{sc=Orya}\p{sc=Beng}\p{sc=Deva}&\p{Indic_Syllabic_Category=Virama}];
32 $LinkingConsonant = [\p{Gujr}\p{sc=Telu}\p{sc=Mlym}\p{sc=Orya}\p{sc=Beng}\p{sc=Deva}&\p{Indic_Syllabic_Category=Consonant}];
33 $ExtCccZwj = [[\p{gcb=Extend}-\p{ccc=0}] \p{gcb=ZWJ}];
35 # Korean Syllable Definitions
37 $L = [\p{Grapheme_Cluster_Break = L}];
38 $V = [\p{Grapheme_Cluster_Break = V}];
39 $T = [\p{Grapheme_Cluster_Break = T}];
41 $LV = [\p{Grapheme_Cluster_Break = LV}];
42 $LVT = [\p{Grapheme_Cluster_Break = LVT}];
46 $Extended_Pict = [:ExtPict:];
48 # The following classes are no longer needed for ICU rules but may
49 # still be needed for WebKit rules in charClasses.txt
50 # The first is still valid using the Unicode 11 properties:
51 # $EmojiNRK = [[\p{Emoji}] - [\p{Grapheme_Cluster_Break = Regional_Indicator}*\u00230-9©®™〰〽]];
52 # The other two are no longer valid because no characters have GCB=EB or GCB=EBG anymore:
53 # $E_Base = [[\p{Grapheme_Cluster_Break = EB}];
54 # $E_Base_GAZ = [\p{Grapheme_Cluster_Break = EBG}];
55 # They must be replaced with updated versions as follows
56 # $E_Base = [:EBase:];
57 # $E_Base_GAZ = [\U0001F466-\U0001F469\U0001F91D\U0001F9D1]; # EBase that also occur after ZWJ in emoji-zwj-sequences
59 ## -------------------------------------------------
65 $L ($L | $V | $LV | $LVT);
70 [^$Control $CR $LF] ($Extend | $ZWJ);
73 [^$Control $CR $LF] $SpacingMark;
76 $Prepend [^$Control $CR $LF];
78 # GB 9.3, from CLDR-10994
79 $LinkingConsonant $ExtCccZwj* $Virama $ExtCccZwj* $LinkingConsonant;
81 # GB 11 Do not break within emoji modifier sequences or emoji zwj sequences.
82 $Extended_Pict $Extend* $ZWJ $Extended_Pict;
84 # GB 12-13. Keep pairs of regional indicators together
85 # Note that hard break '/' rule triggers only if there are three or more initial RIs,
87 ^$Prepend* $Regional_Indicator $Regional_Indicator / $Regional_Indicator;
88 ^$Prepend* $Regional_Indicator $Regional_Indicator;
90 # GB 999 Match a single code point if no other rule applies.