]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/testdata/break_rules/line_cj.txt
ICU-64232.0.1.tar.gz
[apple/icu.git] / icuSources / test / testdata / break_rules / line_cj.txt
CommitLineData
3d1f044b
A
1#
2# Copyright (C) 2016 and later: Unicode, Inc. and others.
3# License & terms of use: http://www.unicode.org/copyright.html
4# Copyright (c) 2016, International Business Machines Corporation and others. All Rights Reserved.
5
6# file: line.txt
7#
8# Reference Line Break rules for intltest rbbi/RBBIMonkeyTest.
9# Rules derived from Unicode Standard Annex #14 Revision 40 for Unicode 11.0
10#
11# Note: Rule syntax and the monkey test itself are still a work in progress.
12# They are expected to change with review and the addition of support for rule tailoring.
13
14
15type = line;
16locale = zh;
17
18
19AI = [:LineBreak = Ambiguous:];
20AL = [:LineBreak = Alphabetic:];
21BA = [:LineBreak = Break_After:];
22HH = [\u2010]; # \u2010 is HYPHEN, default line break is BA.
23BB = [:LineBreak = Break_Before:];
24BK = [:LineBreak = Mandatory_Break:];
25B2 = [:LineBreak = Break_Both:];
26CB = [:LineBreak = Contingent_Break:];
27CJ = [:LineBreak = Conditional_Japanese_Starter:];
28CL = [[:LineBreak = Close_Punctuation:] \u201d];
29CMS = [:LineBreak = Combining_Mark:];
30CP = [:LineBreak = Close_Parenthesis:];
31CR = [:LineBreak = Carriage_Return:];
32EB = [:LineBreak = EB:];
33EM = [:LineBreak = EM:];
34EX = [:LineBreak = Exclamation:];
35GL = [:LineBreak = Glue:];
36HL = [:LineBreak = Hebrew_Letter:];
37HY = [:LineBreak = Hyphen:];
38H2 = [:LineBreak = H2:];
39H3 = [:LineBreak = H3:];
40ID = [:LineBreak = Ideographic:];
41IN = [:LineBreak = Inseperable:];
42IS = [:LineBreak = Infix_Numeric:];
43JL = [:LineBreak = JL:];
44JV = [:LineBreak = JV:];
45JT = [:LineBreak = JT:];
46LF = [:LineBreak = Line_Feed:];
47NL = [:LineBreak = Next_Line:];
48NS = [[:LineBreak = Nonstarter:] CJ]; # CSS Strict tailoring: CJ resolves to NS.
49NU = [:LineBreak = Numeric:];
50OP = [[:LineBreak = Open_Punctuation:] \u201c];
51PO = [:LineBreak = Postfix_Numeric:];
52PR = [:LineBreak = Prefix_Numeric:];
53QU = [[:LineBreak = Quotation:] - [\u201c\u201d]];
54RI = [:LineBreak = Regional_Indicator:];
55SA = [:LineBreak = Complex_Context:];
56SG = [:LineBreak = Surrogate:];
57SP = [:LineBreak = Space:];
58SY = [:LineBreak = Break_Symbols:];
59WJ = [:LineBreak = Word_Joiner:];
60XX = [:LineBreak = Unknown:];
61ZW = [:LineBreak = ZWSpace:];
62ZWJ = [:LineBreak = ZWJ:];
63
64# LB1 - Resolve AI, CB, CJ, SA, SG, and XX into other line breaking classes
65AL = [AL AI SG XX ];
66dictionary = SA;
67
68# By LB9, a ZWJ also behaves as a CM. Including it in the definition of CM avoids having to explicitly
69# list it in the numerous rules that use CM.
70CM = [CMS ZWJ];
71
72LB4: BK ÷;
73LB5: CR LF;
74LB5.1: CR ÷;
75LB5.2: LF ÷;
76LB5.3: NL ÷;
77
78LB6: . (BK | CR | LF | NL);
79LB6.1: [^BK CR LF NL SP ZW] CM* (BK | CR | LF | NL);
80
81# LB8 break after ZW SP*.
82# Precedes LB7 because both rules will match the sequences like ZW SP,
83# and LB8 must take precedence.
84
85LB8: ZW SP* ÷ [^ZW SP BK CR LF NL];
86
87# Numbers. Equivalent to Tailoring example 8 from UAX 14.
88# Moved up, before LB14, because it can match longer sequences which must take precedence.
89LB25: ((PR | PO)CM*)? ((OP | HY)CM*)? (IS CM*)? NU (CM*(NU | SY | IS))* (CM*(CL | CP))? (CM*(PR | PO))?;
90
91# Rules LB14 - LB17.
92# Moved up, before LB7, because they can match a longer sequence that would also match LB7.
93# For example, the sequence "OP CM SP AL" matches LB14
94# while the prefix of it, "OP CM SP" matches LB7.1
95LB14: OP CM* SP* .;
96
97# LB 14a Break before an IS that begins a number and follows a space.
98LB14a: SP ÷ IS CM* NU;
99
100# LB14b × IS
101LB14b.1: [^SP] CM* IS;
102LB14b.2: SP IS;
103
104LB15: QU CM* SP* OP;
105LB16: (CL | CP)CM* SP* NS;
106LB17: B2 CM* SP* B2;
107
108
109# LB7 Do not break before spaces or zero width space.
110
111LB7.1: [^ZW SP] CM* [SP ZW];
112LB7.2: [ZW SP] [SP ZW];
113
114# LB8a
115# ZWJ x
116# Don't match a CM on the right - let other rules pick up CM sequences, where
117# the ZWJ behaves as just another generic CM.
118LB8a: ZWJ [^CM];
119
120
121# LB9: X CM -> X
122# LB10: Unattached CM -> AL
123
124#LB11: × WJ;
125# WJ ×
126
127LB11.1: [^SP] CM* WJ;
128LB11.2: SP WJ;
129LB11.3: WJ CM* [^CM];
130
131LB12: GL CM* [^CM];
132
133LB12a: [^SP BA HY] CM* GL;
134
135# LB 13 Do not break before ‘]’ or ‘!’ or ‘/’, even after spaces.
136LB13.1: [^SP] CM* [CL CP EX SY];
137LB13.2: SP [CL CP EX SY];
138
139# LB 14-17 are moved above LB 7.
140
141LB18: SP ÷;
142
143LB19: . CM* QU;
144LB19.1: QU CM* [^CM];
145
146# LB 20 Break before and after CB.
147# Interaction with LB8a: ZWJ x . is tricky because CM includes ZWJ.
148# ZWJ acts like a CM to the left, combining with CB.
149# ZWJ acts independently to the right, no break after by LB8a.
150LB20.1: . CM* ZWJ CB;
151LB20.2: . CM* ÷ CB;
152
153LB20.3: CB CM* ZWJ [^CM];
154LB20.4: CB CM* ÷;
155
156# LB 20.09 Don't break between Hyphens and Letters when there is a break preceding the hyphen.
157LB20.09: ^(HY | HH) CM* AL;
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.
161LB21a: HL CM* (HY | BA) CM* [^CM CB];
162
163LB21.1: . CM* [BA HY NS];
164LB21.2: BB CM* [^CM CB];
165
166LB21b: SY CM* HL;
167
168LB22.1: (AL | HL | CM) CM* IN; # The CM is from LB10, treat an unattached CM as AL.
169LB22.2: EX CM* IN;
170LB22.3: (ID | EB | EM) CM* IN;
171LB22.4: IN CM* IN;
172LB22.5: NU CM* IN;
173
174LB23.1: (AL | HL | CM) CM* NU;
175LB23.2: NU CM* (AL | HL);
176
177LB23a.1: PR CM* (ID | EB | EM);
178LB23a.2: (ID | EB | EM) CM* PO;
179
180LB24.2: (PR | PO) CM* (AL | HL);
181LB24.3: (AL | HL | CM) CM* (PR | PO);
182
183
184LB26.1: JL CM* (JL | JV | H2 | H3);
185LB26.2: (JV | H2) CM* (JV | JT);
186LB26.3: (JT | H3) CM* JT;
187
188LB27.1: (JL | JV | JT | H2 | H3) CM* IN;
189LB27.2: (JL | JV | JT | H2 | H3) CM* PO;
190LB27.3: PR CM* (JL | JV | JT | H2 | H3);
191
192# LB28 Do not break between Alphabetics.
193# Unattached (leading) CM treated as AL.
194LB28: (AL | HL | CM)CM* (AL | HL);
195
196LB29: IS CM* (AL | HL);
197
198# LB30 is adjusted for unattached leading CM being treated as AL.
199LB30.1: (AL | CM | HL | NU) CM* OP;
200LB30.2: CP CM* (AL | HL | NU);
201
202# LB30a keep pairs of RI together.
203LB30a.1: RI CM* RI ÷ [^BK CR LF NL SP ZW WJ CL CP EX IS SY GL QU BA HY NS CM];
204LB30a.2: RI CM* RI CM* CMS ÷ [^BK CR LF NL SP ZW WJ CL CP EX IS SY GL QU BA HY NS CM];
205LB30a.3: RI CM* RI CM* [BK CR LF NL SP ZW WJ GL CL CP EX IS SY QU BA HY NS ZWJ]?;
206
207# LB30b Do not break between Emoji Base and Emoji Modifier
208LB30b: EB CM* EM;
209
210# LB31 Break Everywhere Else.
211# Include combining marks
212LB31.1: . CM* ZWJ [^CM];
213LB31.2: . CM* ÷;