]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/testdata/break_rules/line.txt
ICU-57132.0.1.tar.gz
[apple/icu.git] / icuSources / test / testdata / break_rules / line.txt
CommitLineData
2ca993e8
A
1#
2# Copyright (c) 2016, International Business Machines Corporation and others. All Rights Reserved.
3
4# file: line.txt
5#
6# Reference Line Break rules for intltest rbbi/RBBIMonkeyTest
7#
8# Note: Rule syntax and the monkey test itself are still a work in progress.
9# They are expected to change with review and the addition of support for rule tailoring.
10
11
12type = line;
13locale = en;
14
15
16AI = [[:LineBreak = Ambiguous:] - [\u2640\u2642]];
17AL = [[:LineBreak = Alphabetic:]-[\u2764]];
18BA = [:LineBreak = Break_After:];
19BB = [:LineBreak = Break_Before:];
20BK = [:LineBreak = Mandatory_Break:];
21B2 = [:LineBreak = Break_Both:];
22CB = [:LineBreak = Contingent_Break:];
23CJ = [:LineBreak = Conditional_Japanese_Starter:];
24CL = [:LineBreak = Close_Punctuation:];
25CM = [[:LineBreak = Combining_Mark:] \u200D];
26CP = [:LineBreak = Close_Parenthesis:];
27CR = [:LineBreak = Carriage_Return:];
28
29EB = [\u261D\u26F9\u270A-\u270D\U0001F385\U0001F3C3-\U0001F3C4\U0001F3CA-\U0001F3CB\U0001F442-\U0001F443\U0001F446-\U0001F450\U0001F466-\U0001F469\U0001F46E\U0001F470-\U0001F478\U0001F47C\U0001F481-\U0001F483\U0001F485-\U0001F487\U0001F4AA\U0001F575\U0001F590\U0001F595-\U0001F596\U0001F645-\U0001F647\U0001F64B-\U0001F64F\U0001F6A3\U0001F6B4-\U0001F6B6\U0001F6C0\U0001F918];
30EM = [\U0001F3FB-\U0001F3FF];
31
32EX = [:LineBreak = Exclamation:];
33GL = [:LineBreak = Glue:];
34HL = [:LineBreak = Hebrew_Letter:];
35HY = [:LineBreak = Hyphen:];
36H2 = [:LineBreak = H2:];
37H3 = [:LineBreak = H3:];
38ID = [[:LineBreak = Ideographic:][\u2640\u2642\u2764]];
39IN = [:LineBreak = Inseperable:];
40IS = [:LineBreak = Infix_Numeric:];
41JL = [:LineBreak = JL:];
42JV = [:LineBreak = JV:];
43JT = [:LineBreak = JT:];
44LF = [:LineBreak = Line_Feed:];
45NL = [:LineBreak = Next_Line:];
46NS = [[:LineBreak = Nonstarter:] CJ];
47NU = [:LineBreak = Numeric:];
48OP = [:LineBreak = Open_Punctuation:];
49PO = [:LineBreak = Postfix_Numeric:];
50PR = [:LineBreak = Prefix_Numeric:];
51QU = [:LineBreak = Quotation:];
52RI = [:LineBreak = Regional_Indicator:];
53SA = [:LineBreak = Complex_Context:];
54SG = [:LineBreak = Surrogate:];
55SP = [:LineBreak = Space:];
56SY = [:LineBreak = Break_Symbols:];
57WJ = [:LineBreak = Word_Joiner:];
58XX = [:LineBreak = Unknown:];
59ZW = [:LineBreak = ZWSpace:];
60ZJ = [\u200D];
61
62# TODO: adjustment to sets needed only until Unicode properties are updated for Emoji.
63ID = [ID - EB];
64AL = [AL - EM];
65
66dictionary = [:LineBreak = Complex_Context:];
67
68# Redfine AL. LB1. TODO: refine according to latest UAX.
69AL = [ AL AI SA SG XX ];
70
71LB4: BK ÷;
72LB5: CR LF;
73LB5.1: CR ÷;
74LB5.2: LF ÷;
75LB5.3: NL ÷;
76
77LB6: . (BK | CR | LF | NL);
78LB6.1: [^BK CR LF NL SP ZW] CM* (BK | CR | LF | NL);
79
80# Rules LB14 - LB17.
81# Moved before LB7, because they can match a longer sequence that would also match LB7,
82# for example, the sequence "OP CM SP AL" matches LB14 while the prefix of it,
83# "while only the prefix "OP CM SP" matches LB7.1
84LB14: OP CM* SP* .;
85LB15: QU CM* SP* OP;
86LB16: (CL | CP)CM* SP* NS;
87LB17: B2 CM* SP* B2;
88
89LB7.1: [^ZW SP] CM* [SP ZW];
90LB7.2: [ZW SP] [SP ZW];
91
92# LB8, ICU differs from UAX-14,
93# ICU: ZW ÷;
94# UAX 14: ZW SP* ÷;
95LB8: ZW ÷;
96
97# LB8a, from Emoji proposal L2/16-011R3
98# ZWJ x ID
99LB8a: ZJ (ID | EB | EM);
100
101
102# LB9: X CM -> X
103# LB10: Unattached CM -> AL
104
105#LB11: × WJ;
106# WJ ×
107
108LB11.1: [^BK CR LF NL SP ZW] CM* WJ;
109LB11.2: SP WJ;
110LB11.3: WJ CM* [^CM];
111
112LB12: GL CM* [^CM];
113
114LB12a: [^SP BA HY] CM* GL;
115
116# LB 13 ICU Tailoring, matches tailoring exmaple 8 from UAX 14.
117#
118# LB13.1 [^SP] CM* [CL CP EX IS SY] # original UAX 14 rule.
119# LB13.2 SP CM* [CL CP EX IS SY]
120
121LB13.1: [^NU SP] CM* [CL CP IS SY];
122LB13.2: [^SP] CM* EX;
123LB13.2: SP [CL CP EX IS SY];
124
125
126# LB 14-17 are moved above LB 7.
127
128LB18: SP ÷;
129
130LB19: . CM* QU;
131LB19.1: QU CM* [^CM];
132
133# LB 20 Break before and after CB.
134# Interaction with LB8a: ZJ x ID is tricky because CM includes ZJ.
135# ZJ acts like a CM to the left, combining with CB.
136# ZJ acts independently to the right, no break from ID by LB8a.
137LB20: . CM* ÷ CB;
138LB20.1a: CB CM* ZJ (ID | EB | EM);
139LB20.1b: CB CM* ÷;
140
141# Note: Rule 21a must come before 21 to prevent 21.1 from matching HL BA, then
142# not picking up the continuing match after the BA from 21a.
143LB21a: HL CM* (HY | BA) CM* [^CM CB];
144
145LB21.1: . CM* [BA HY NS];
146LB21.2: BB CM* [^CM CB];
147
148LB21b: SY CM* HL;
149
150LB22.1: (AL | HL | CM) CM* IN; # The CM is from LB10, treat an unattached CM as AL.
151LB22.2: EX CM* IN;
152LB22.3: (ID | EB | EM) CM* IN;
153LB22.4: IN CM* IN;
154LB22.5: NU CM* IN;
155
156LB23.1: (ID | EB | EM) CM* PO;
157LB23.2: (AL | HL | CM) CM* NU;
158LB23.3: NU CM* (AL | HL);
159
160LB24.1: PR CM* (ID | EB | EM);
161LB24.2: PR CM* (AL | HL);
162LB24.3: PO CM* (AL | HL);
163LB24.4: (AL | HL | CM) CM* (PR | PO);
164
165# Numbers. Equivalent to Tailoring example 8 from UAX 14.
166LB25: ((PR | PO)CM*)? ((OP | HY)CM*)? NU (CM*(NU | SY | IS))* (CM*(CL | CP))? (CM*(PR | PO))?;
167
168LB26.1: JL CM* (JL | JV | H2 | H3);
169LB26.2: (JV | H2) CM* (JV | JT);
170LB26.3: (JT | H3) CM* JT;
171
172LB27.1: (JL | JV | JT | H2 | H3) CM* IN;
173LB27.2: (JL | JV | JT | H2 | H3) CM* PO;
174LB27.3: PR CM* (JL | JV | JT | H2 | H3);
175
176# LB28 Do not break between Alphabetics.
177# Unattached (leading) CM treated as AL.
178LB28: (AL | HL | CM)CM* (AL | HL);
179
180LB29: IS CM* (AL | HL);
181
182# LB30 is adjusted for unattached leading CM being treated as AL.
183LB30.1: (AL | CM | HL | NU) CM* OP;
184LB30.2: CP CM* (AL | HL | NU);
185
186# LB31 keep pairs of RI together.
187LB30a.1: RI CM* RI CM* [BK CR LF NL SP ZW WJ GL CL CP EX IS SY QU BA HY NS];
188LB30a.2: RI CM* RI CM* ZJ (ID | EB | EM);
189LB30a.3: RI CM* RI CM* ÷;
190
191# LB30b Do not break between Emoji Base and Emoji Modifier
192LB30b: EB CM* EM;
193
194# LB31 Break Everywhere Else.
195# Include combining marks
196LB31.1: . CM* ZJ (ID | EB | EM);
197LB31.2: . CM* ÷;