]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/testdata/break_rules/line_normal_cj.txt
ICU-57149.0.1.tar.gz
[apple/icu.git] / icuSources / test / testdata / break_rules / line_normal_cj.txt
CommitLineData
2ca993e8
A
1# Copyright (c) 2016 International Business Machines Corporation and # others. All Rights Reserved.
2#
3# file: line_normal_cj.txt
4#
5# Reference Line Break rules for intltest rbbi/RBBIMonkeyTest
6#
7# Note: Rule syntax and the monkey test itself are still a work in progress.
8# They are expected to change with review and the addition of support for rule tailoring.
9#
10# Line Breaking Rules
11# Implement default line breaking as defined by
12# Unicode Standard Annex #14 Revision 34 for Unicode 8.0
13# http://www.unicode.org/reports/tr14/
14# tailored as noted in 2nd paragraph below..
15#
16# TODO: Rule LB 8 remains as it was in Unicode 5.2
17# This is only because of a limitation of ICU break engine implementation,
18# not because the older behavior is desirable.
19#
20# This tailors the line break behavior to correspond to CSS
21# line-break=normal (BCP47 -u-lb-normal) as defined for Chinese & Japanese.
22# It sets characters of class CJ to behave like ID.
23# In addition, it allows breaks:
24# * before hyphens 2010 & 2013 (both BA) and 301C, 30A0 (both NS)
25
26type = line;
27locale = ja@lb=normal;
28
29AI = [[:LineBreak = Ambiguous:] - [\u2640\u2642]];
a62d09fc 30AL = [[:LineBreak = Alphabetic:]-[\u2695\u2696\u2764]];
2ca993e8
A
31BAX = [\u2010 \u2013];
32BA = [[:LineBreak = Break_After:] - BAX];
33BB = [:LineBreak = Break_Before:];
34BK = [:LineBreak = Mandatory_Break:];
35B2 = [:LineBreak = Break_Both:];
36CB = [:LineBreak = Contingent_Break:];
37CJ = [:LineBreak = Conditional_Japanese_Starter:];
38CL = [:LineBreak = Close_Punctuation:];
39CM = [[:LineBreak = Combining_Mark:] \u200D];
40CP = [:LineBreak = Close_Parenthesis:];
41CR = [:LineBreak = Carriage_Return:];
42
a62d09fc 43EB = [\u261D\u26F9\u270A-\u270D\U0001F385\U0001F3C2-\U0001F3C4\U0001F3C7\U0001F3CA-\U0001F3CC\U0001F442-\U0001F443\U0001F446-\U0001F450\U0001F466-\U0001F478\U0001F47C\U0001F481-\U0001F483\U0001F485-\U0001F487\U0001F4AA\U0001F574-\U0001F575\U0001F57A\U0001F590\U0001F595-\U0001F596\U0001F645-\U0001F647\U0001F64B-\U0001F64F\U0001F6A3\U0001F6B4-\U0001F6B6\U0001F6C0\U0001F6CC\U0001F918-\U0001F91E\U0001F926\U0001F930\U0001F933-\U0001F939\U0001F93C-\U0001F93E];
2ca993e8
A
44EM = [\U0001F3FB-\U0001F3FF];
45
46EX = [:LineBreak = Exclamation:];
47GL = [:LineBreak = Glue:];
48HL = [:LineBreak = Hebrew_Letter:];
49HY = [:LineBreak = Hyphen:];
50H2 = [:LineBreak = H2:];
51H3 = [:LineBreak = H3:];
a62d09fc 52ID = [[:LineBreak = Ideographic:] CJ [\u2640\u2642\u2695\u2696\u2764]];
2ca993e8
A
53IN = [:LineBreak = Inseperable:];
54IS = [:LineBreak = Infix_Numeric:];
55JL = [:LineBreak = JL:];
56JV = [:LineBreak = JV:];
57JT = [:LineBreak = JT:];
58LF = [:LineBreak = Line_Feed:];
59NL = [:LineBreak = Next_Line:];
60NSX = [\u301C \u30A0];
61NS = [[:LineBreak = Nonstarter:] - NSX];
62NU = [:LineBreak = Numeric:];
63OP = [:LineBreak = Open_Punctuation:];
64PO = [:LineBreak = Postfix_Numeric:];
65PR = [:LineBreak = Prefix_Numeric:];
66QU = [:LineBreak = Quotation:];
67RI = [:LineBreak = Regional_Indicator:];
68SA = [:LineBreak = Complex_Context:];
69SG = [:LineBreak = Surrogate:];
70SP = [:LineBreak = Space:];
71SY = [:LineBreak = Break_Symbols:];
72WJ = [:LineBreak = Word_Joiner:];
73XX = [:LineBreak = Unknown:];
74ZW = [:LineBreak = ZWSpace:];
75ZJ = [\u200D];
76
77# TODO: adjustment to sets needed only until Unicode properties are updated for Emoji.
78ID = [ID - EB];
79AL = [AL - EM];
80
81dictionary = [:LineBreak = Complex_Context:];
82
83# Redfine AL. LB1. TODO: refine according to latest UAX.
84AL = [ AL AI SA SG XX ];
85
86LB4: BK ÷;
87LB5: CR LF;
88LB5.1: CR ÷;
89LB5.2: LF ÷;
90LB5.3: NL ÷;
91
92LB6: . (BK | CR | LF | NL);
93LB6.1: [^BK CR LF NL SP ZW] CM* (BK | CR | LF | NL);
94
95# Rules LB14 - LB17.
96# Moved before LB7, because they can match a longer sequence that would also match LB7,
97# for example, the sequence "OP CM SP AL" matches LB14 while the prefix of it,
98# "while only the prefix "OP CM SP" matches LB7.1
99LB14: OP CM* SP* .;
100LB15: QU CM* SP* OP;
101
102# Do not break between closing punctuation and $NS, even with intervening spaces
103# But DO allow a break between closing punctuation and $NSX, don't include it here
104LB16: (CL | CP)CM* SP* NS;
105LB17: B2 CM* SP* B2;
106
107LB7.1: [^ZW SP] CM* [SP ZW];
108LB7.2: [ZW SP] [SP ZW];
109
110# LB8, ICU differs from UAX-14,
111# ICU: ZW ÷;
112# UAX 14: ZW SP* ÷;
113LB8: ZW ÷;
114
115# LB8a, from Emoji proposal L2/16-011R3
116# ZWJ x ID
117LB8a: ZJ (ID | EB | EM);
118
119
120# LB9: X CM -> X
121# LB10: Unattached CM -> AL
122
123#LB11: × WJ;
124# WJ ×
125
126LB11.1: [^BK CR LF NL SP ZW] CM* WJ;
127LB11.2: SP WJ;
128LB11.3: WJ CM* [^CM];
129
130LB12: GL CM* [^CM];
131
132LB12a: [^SP BA BAX HY] CM* GL;
133
134# LB 13 ICU Tailoring, matches tailoring exmaple 8 from UAX 14.
135#
136# LB13.1 [^SP] CM* [CL CP EX IS SY] # original UAX 14 rule.
137# LB13.2 SP CM* [CL CP EX IS SY]
138
139LB13.1: [^NU SP] CM* [CL CP IS SY];
140LB13.2: [^SP] CM* EX;
141LB13.2: SP [CL CP EX IS SY];
142
143
144# LB 14-17 are moved above LB 7.
145
146LB18: SP ÷;
147
148LB19: . CM* QU;
149LB19.1: QU CM* [^CM];
150
151# LB 20 Break before and after CB.
152# Interaction with LB8a: ZJ x ID is tricky because CM includes ZJ.
153# ZJ acts like a CM to the left, combining with CB.
154# ZJ acts independently to the right, no break from ID by LB8a.
155LB20: . CM* ÷ CB;
156LB20.1a: CB CM* ZJ (ID | EB | EM);
157LB20.1b: CB CM* ÷;
158
159# Note: Rule 21a must come before 21 to prevent 21.1 from matching HL BA, then
160# not picking up the continuing match after the BA from 21a.
161# TODO: For CJ tailorings (with BAX) does this rule want to include BAX? If so,
162# should "HL BAX" not break when followed by a CB? Thats what the current
163# rules do, which is why "[^CM CB]?"\13 includes the ?.
164LB21a: HL CM* (HY | BA | BAX) CM* [^CM CB]?;
165
166# DO allow breaks here before $BAXcm and $NSXcm, so don't include them
167LB21.1: . CM* [BA HY NS];
168LB21.2: BB CM* [^CM CB];
169
170LB21b: SY CM* HL;
171
172LB22.1: (AL | HL | CM) CM* IN; # The CM is from LB10, treat an unattached CM as AL.
173LB22.2: EX CM* IN;
174LB22.3: (ID | EB | EM) CM* IN;
175LB22.4: IN CM* IN;
176LB22.5: NU CM* IN;
177
178LB23.1: (ID | EB | EM) CM* PO;
179LB23.2: (AL | HL | CM) CM* NU;
180LB23.3: NU CM* (AL | HL);
181
182LB24.1: PR CM* (ID | EB | EM);
183LB24.2: PR CM* (AL | HL);
184LB24.3: PO CM* (AL | HL);
185LB24.4: (AL | HL | CM) CM* (PR | PO);
186
187# Numbers. Equivalent to Tailoring example 8 from UAx 14.
188LB25: ((PR | PO)CM*)? ((OP | HY)CM*)? NU (CM*(NU | SY | IS))* (CM*(CL | CP))? (CM*(PR | PO))?;
189
190LB26.1: JL CM* (JL | JV | H2 | H3);
191LB26.2: (JV | H2) CM* (JV | JT);
192LB26.3: (JT | H3) CM* JT;
193
194LB27.1: (JL | JV | JT | H2 | H3) CM* IN;
195LB27.2: (JL | JV | JT | H2 | H3) CM* PO;
196LB27.3: PR CM* (JL | JV | JT | H2 | H3);
197
198# LB28 Do not break between Alphabetics.
199# Unattached (leading) CM treated as AL.
200LB28: (AL | HL | CM)CM* (AL | HL);
201
202LB29: IS CM* (AL | HL);
203
204# LB30 is adjusted for unattached leading CM being treated as AL.
205LB30.1: (AL | CM | HL | NU) CM* OP;
206LB30.2: CP CM* (AL | HL | NU);
207
208# LB31 keep pairs of RI together.
209LB30a.1: RI CM* RI CM* [BK CR LF NL SP ZW WJ GL CL CP EX IS SY QU BA HY NS];
210LB30a.2: RI CM* RI CM* ZJ (ID | EB | EM);
211LB30a.3: RI CM* RI CM* ÷;
212
213# LB30b Do not break between Emoji Base and Emoji Modifier
214LB30b: EB CM* EM;
215
216# LB31 Break Everywhere Else.
217# Include combining marks
218LB31.1: . CM* ZJ (ID | EB | EM);
219LB31.2: . CM* ÷;