]> git.saurik.com Git - apple/icu.git/blob - icuSources/data/brkitr/line_fi.txt
ICU-551.51.tar.gz
[apple/icu.git] / icuSources / data / brkitr / line_fi.txt
1 # Copyright (c) 2002-2015 International Business Machines Corporation and
2 # others. All Rights Reserved.
3 #
4 # file: line_fi.txt
5 #
6 # Line Breaking Rules
7 # Implement default line breaking as defined by
8 # Unicode Standard Annex #14 Revision 29 for Unicode 6.2
9 # http://www.unicode.org/reports/tr14/
10 # tailored as noted in 2nd paragraph below..
11 #
12 # TODO: Rule LB 8 remains as it was in Unicode 5.2
13 # This is only because of a limitation of ICU break engine implementation,
14 # not because the older behavior is desirable.
15 #
16 # This tailors the line break behavior for Finnish, while otherwise behaving
17 # per UAX 14 which corresponds to CSS line-break=strict (BCP47 -u-lb-strict).
18 # It sets characters of class CJ to behave like NS.
19
20 #
21 # Character Classes defined by TR 14.
22 #
23
24 !!chain;
25 !!LBCMNoChain;
26
27
28 !!lookAheadHardBreak;
29 #
30 # !!lookAheadHardBreak Described here because it is (as yet) undocumented elsewhere
31 # and only used for the line break rules.
32 #
33 # It is used in the implementation of rule LB 10
34 # which says to treat any combining mark that is not attached to a base
35 # character as if it were of class AL (alphabetic).
36 #
37 # The problem occurs in the reverse rules.
38 #
39 # Consider a sequence like, with correct breaks as shown
40 # LF ID CM AL AL
41 # ^ ^ ^
42 # Then consider the sequence without the initial ID (ideographic)
43 # LF CM AL AL
44 # ^ ^
45 # Our CM, which in the first example was attached to the ideograph,
46 # is now unattached, becomes an alpha, and joins in with the other
47 # alphas.
48 #
49 # When iterating forwards, these sequences do not present any problems
50 # When iterating backwards, we need to look ahead when encountering
51 # a CM to see whether it attaches to something further on or not.
52 # (Look-ahead in a reverse rule is looking towards the start)
53 #
54 # If the CM is unattached, we need to force a break.
55 #
56 # !!lookAheadHardBreak forces the run time state machine to
57 # stop immediately when a look ahead rule ( '/' operator) matches,
58 # and set the match position to that of the look-ahead operator,
59 # no matter what other rules may be in play at the time.
60 #
61 # See rule LB 19 for an example.
62 #
63
64 $AI = [:LineBreak = Ambiguous:];
65 $AL = [:LineBreak = Alphabetic:];
66 $BA = [[:LineBreak = Break_After:] - [\u2010]];
67 $HH = [\u2010];
68 $BB = [:LineBreak = Break_Before:];
69 $BK = [:LineBreak = Mandatory_Break:];
70 $B2 = [:LineBreak = Break_Both:];
71 $CB = [:LineBreak = Contingent_Break:];
72 $CJ = [:LineBreak = Conditional_Japanese_Starter:];
73 $CL = [:LineBreak = Close_Punctuation:];
74 $CM = [:LineBreak = Combining_Mark:];
75 $CP = [:LineBreak = Close_Parenthesis:];
76 $CR = [:LineBreak = Carriage_Return:];
77 $EX = [:LineBreak = Exclamation:];
78 $GL = [:LineBreak = Glue:];
79 $HL = [:LineBreak = Hebrew_Letter:];
80 $HY = [:LineBreak = Hyphen:];
81 $H2 = [:LineBreak = H2:];
82 $H3 = [:LineBreak = H3:];
83 $ID = [:LineBreak = Ideographic:];
84 $IN = [:LineBreak = Inseperable:];
85 $IS = [:LineBreak = Infix_Numeric:];
86 $JL = [:LineBreak = JL:];
87 $JV = [:LineBreak = JV:];
88 $JT = [:LineBreak = JT:];
89 $LF = [:LineBreak = Line_Feed:];
90 $NL = [:LineBreak = Next_Line:];
91 $NS = [[:LineBreak = Nonstarter:] $CJ];
92 $NU = [:LineBreak = Numeric:];
93 $OP = [:LineBreak = Open_Punctuation:];
94 $PO = [:LineBreak = Postfix_Numeric:];
95 $PR = [:LineBreak = Prefix_Numeric:];
96 $QU = [:LineBreak = Quotation:];
97 $RI = [:LineBreak = Regional_Indicator:];
98 $SA = [:LineBreak = Complex_Context:];
99 $SG = [:LineBreak = Surrogate:];
100 $SP = [:LineBreak = Space:];
101 $SY = [:LineBreak = Break_Symbols:];
102 $WJ = [:LineBreak = Word_Joiner:];
103 $XX = [:LineBreak = Unknown:];
104 $ZW = [:LineBreak = ZWSpace:];
105
106 # Special character classes for people & body part emoji:
107 # Subsets of $CM:
108 $ZWJ = \u200D;
109 $EmojiVar = \uFE0F;
110 # The following are subsets of $ID
111 $EmojiForSeqs = [\u2764 \U0001F441 \U0001F466-\U0001F469 \U0001F48B \U0001F5E8];
112 $EmojiForMods = [\u261D \u26F9 \u270A-\u270D \U0001F385 \U0001F3C3-\U0001F3C4 \U0001F3CA-\U0001F3CB \U0001F442-\U0001F443 \U0001F446-\U0001F450 \U0001F466-\U0001F469 \U0001F46E-\U0001F478 \U0001F47C \U0001F481-\U0001F483 \U0001F485-\U0001F487 \U0001F4AA \U0001F575 \U0001F590 \U0001F595 \U0001F596 \U0001F645-\U0001F647 \U0001F64B-\U0001F64F \U0001F6A3 \U0001F6B4-\U0001F6B6 \U0001F6C0 \U0001F918];
113 $EmojiMods = [\U0001F3FB-\U0001F3FF];
114
115 # Dictionary character set, for triggering language-based break engines. Currently
116 # limited to LineBreak=Complex_Context. Note that this set only works in Unicode
117 # 5.0 or later as the definition of Complex_Context was corrected to include all
118 # characters requiring dictionary break.
119
120 $dictionary = [:LineBreak = Complex_Context:];
121
122 #
123 # Rule LB1. By default, treat AI (characters with ambiguous east Asian width),
124 # SA (South East Asian: Thai, Lao, Khmer)
125 # SG (Unpaired Surrogates)
126 # XX (Unknown, unassigned)
127 # as $AL (Alphabetic)
128 #
129 $ALPlus = [$AL $AI $SA $SG $XX];
130
131 #
132 # Combining Marks. X $CM* behaves as if it were X. Rule LB6.
133 #
134 $ALcm = $ALPlus $CM*;
135 $BAcm = $BA $CM*;
136 $HHcm = $HH $CM*;
137 $BBcm = $BB $CM*;
138 $B2cm = $B2 $CM*;
139 $CLcm = $CL $CM*;
140 $CPcm = $CP $CM*;
141 $EXcm = $EX $CM*;
142 $GLcm = $GL $CM*;
143 $HLcm = $HL $CM*;
144 $HYcm = $HY $CM*;
145 $H2cm = $H2 $CM*;
146 $H3cm = $H3 $CM*;
147 $IDcm = $ID $CM*;
148 $INcm = $IN $CM*;
149 $IScm = $IS $CM*;
150 $JLcm = $JL $CM*;
151 $JVcm = $JV $CM*;
152 $JTcm = $JT $CM*;
153 $NScm = $NS $CM*;
154 $NUcm = $NU $CM*;
155 $OPcm = $OP $CM*;
156 $POcm = $PO $CM*;
157 $PRcm = $PR $CM*;
158 $QUcm = $QU $CM*;
159 $RIcm = $RI $CM*;
160 $SYcm = $SY $CM*;
161 $WJcm = $WJ $CM*;
162
163 ## -------------------------------------------------
164
165 !!forward;
166
167 #
168 # Each class of character can stand by itself as an unbroken token, with trailing combining stuff
169 #
170 $ALPlus $CM+;
171 $BA $CM+;
172 $HH $CM+;
173 $BB $CM+;
174 $B2 $CM+;
175 $CL $CM+;
176 $CP $CM+;
177 $EX $CM+;
178 $GL $CM+;
179 $HL $CM+;
180 $HY $CM+;
181 $H2 $CM+;
182 $H3 $CM+;
183 $ID $CM+;
184 $IN $CM+;
185 $IS $CM+;
186 $JL $CM+;
187 $JV $CM+;
188 $JT $CM+;
189 $NS $CM+;
190 $NU $CM+;
191 $OP $CM+;
192 $PO $CM+;
193 $PR $CM+;
194 $QU $CM+;
195 $RI $CM+;
196 $SY $CM+;
197 $WJ $CM+;
198
199 #
200 # CAN_CM is the set of characters that may combine with CM combining chars.
201 # Note that Linebreak UAX 14's concept of a combining char and the rules
202 # for what they can combine with are _very_ different from the rest of Unicode.
203 #
204 # Note that $CM itself is left out of this set. If CM is needed as a base
205 # it must be listed separately in the rule.
206 #
207 $CAN_CM = [^$SP $BK $CR $LF $NL $ZW $CM]; # Bases that can take CMs
208 $CANT_CM = [ $SP $BK $CR $LF $NL $ZW $CM]; # Bases that can't take CMs
209
210 #
211 # AL_FOLLOW set of chars that can unconditionally follow an AL
212 # Needed in rules where stand-alone $CM s are treated as AL.
213 # Chaining is disabled with CM because it causes other failures,
214 # so for this one case we need to manually list out longer sequences.
215 #
216 $AL_FOLLOW_NOCM = [$BK $CR $LF $NL $ZW $SP];
217 $AL_FOLLOW_CM = [$CL $CP $EX $HL $IS $SY $WJ $GL $OP $QU $BA $HH $HY $NS $IN $NU $ALPlus];
218 $AL_FOLLOW = [$AL_FOLLOW_NOCM $AL_FOLLOW_CM];
219
220
221 #
222 # Rule LB 4, 5 Mandatory (Hard) breaks.
223 #
224 $LB4Breaks = [$BK $CR $LF $NL];
225 $LB4NonBreaks = [^$BK $CR $LF $NL];
226 $CR $LF {100};
227
228 #
229 # LB 6 Do not break before hard line breaks.
230 #
231 $LB4NonBreaks? $LB4Breaks {100}; # LB 5 do not break before hard breaks.
232 $CAN_CM $CM* $LB4Breaks {100};
233 $CM+ $LB4Breaks {100};
234
235 # LB 7 x SP
236 # x ZW
237 $LB4NonBreaks [$SP $ZW];
238 $CAN_CM $CM* [$SP $ZW];
239 $CM+ [$SP $ZW];
240
241 #
242 # LB 8 Break after zero width space
243 # TODO: ZW SP* <break>
244 # An engine change is required to write the reverse rule for this.
245 # For now, leave the Unicode 5.2 rule, ZW <break>
246 #
247 $LB8Breaks = [$LB4Breaks $ZW];
248 $LB8NonBreaks = [[$LB4NonBreaks] - [$ZW]];
249
250
251 # Special forward rule for people & body part emoji:
252 # don't break $ZWJ from subsequent $EmojiForSeqs
253 $EmojiForSeqs $EmojiVar? $EmojiMods? $ZWJ $EmojiForSeqs;
254
255 # LB 9 Combining marks. X $CM needs to behave like X, where X is not $SP, $BK $CR $LF $NL
256 # $CM not covered by the above needs to behave like $AL
257 # See definition of $CAN_CM.
258
259 $CAN_CM $CM+; # Stick together any combining sequences that don't match other rules.
260 $CM+;
261
262 #
263 # LB 11 Do not break before or after WORD JOINER & related characters.
264 #
265 $CAN_CM $CM* $WJcm;
266 $LB8NonBreaks $WJcm;
267 $CM+ $WJcm;
268
269 $WJcm $CANT_CM;
270 $WJcm $CAN_CM $CM*;
271
272 #
273 # LB 12 Do not break after NBSP and related characters.
274 # GL x
275 #
276 $GLcm $CAN_CM $CM*;
277 $GLcm $CANT_CM;
278
279 #
280 # LB 12a Do not break before NBSP and related characters ...
281 # [^SP BA HY] x GL
282 #
283 [[$LB8NonBreaks] - [$SP $BA $HH $HY]] $CM* $GLcm;
284 $CM+ GLcm;
285
286
287
288 #
289 # LB 13 Don't break before ']' or '!' or ';' or '/', even after spaces.
290 #
291 $LB8NonBreaks $CL;
292 $CAN_CM $CM* $CL;
293 $CM+ $CL; # by rule 10, stand-alone CM behaves as AL
294
295 $LB8NonBreaks $CP;
296 $CAN_CM $CM* $CP;
297 $CM+ $CP; # by rule 10, stand-alone CM behaves as AL
298
299 $LB8NonBreaks $EX;
300 $CAN_CM $CM* $EX;
301 $CM+ $EX; # by rule 10, stand-alone CM behaves as AL
302
303 $LB8NonBreaks $IS;
304 $CAN_CM $CM* $IS;
305 $CM+ $IS; # by rule 10, stand-alone CM behaves as AL
306
307 $LB8NonBreaks $SY;
308 $CAN_CM $CM* $SY;
309 $CM+ $SY; # by rule 10, stand-alone CM behaves as AL
310
311
312 #
313 # LB 14 Do not break after OP, even after spaces
314 #
315 $OPcm $SP* $CAN_CM $CM*;
316 $OPcm $SP* $CANT_CM;
317
318 $OPcm $SP+ $CM+ $AL_FOLLOW?; # by rule 10, stand-alone CM behaves as AL
319
320 # LB 15
321 $QUcm $SP* $OPcm;
322
323 # LB 16
324 ($CLcm | $CPcm) $SP* $NScm;
325
326 # LB 17
327 $B2cm $SP* $B2cm;
328
329 #
330 # LB 18 Break after spaces.
331 #
332 $LB18NonBreaks = [$LB8NonBreaks - [$SP]];
333 $LB18Breaks = [$LB8Breaks $SP];
334
335
336 # LB 19
337 # x QU
338 $LB18NonBreaks $CM* $QUcm;
339 $CM+ $QUcm;
340
341 # QU x
342 $QUcm .?;
343 $QUcm $LB18NonBreaks $CM*; # Don't let a combining mark go onto $CR, $BK, etc.
344 # TODO: I don't think this rule is needed.
345
346
347 # LB 20
348 # <break> $CB
349 # $CB <break>
350
351 $LB20NonBreaks = [$LB18NonBreaks - $CB];
352
353 # LB 20.09 added rule for Finnish tailoring
354 # LB 21 x (BA | HY | NS)
355 # BB x
356 #
357 $LB20NonBreaks $CM* ($BAcm | $HHcm | $HYcm | $NScm) / $AL;
358 $LB20NonBreaks $CM* ($BAcm | $HHcm | $HYcm | $NScm);
359 ($HY | $HH) $AL;
360
361 $BBcm [^$CB]; # $BB x
362 $BBcm $LB20NonBreaks $CM*;
363
364 # LB 21a Don't break after Hebrew + Hyphen
365 # HL (HY | BA) x
366 #
367 $HLcm ($HYcm | $BAcm | $HHcm) [^$CB]?;
368
369 # LB 21b (forward) Don't break between SY and HL
370 # (break between HL and SY already disallowed by LB 13 above)
371 $SYcm $HLcm;
372
373 # LB 22
374 ($ALcm | $HLcm) $INcm;
375 $CM+ $INcm; # by rule 10, any otherwise unattached CM behaves as AL
376 $IDcm $INcm;
377 $INcm $INcm;
378 $NUcm $INcm;
379
380
381 # $LB 23
382 $IDcm $POcm;
383 $ALcm $NUcm; # includes $LB19
384 $HLcm $NUcm;
385 $CM+ $NUcm; # Rule 10, any otherwise unattached CM behaves as AL
386 $NUcm $ALcm;
387 $NUcm $HLcm;
388
389 #
390 # LB 24
391 #
392 $PRcm $IDcm;
393 $PRcm ($ALcm | $HLcm);
394 $POcm ($ALcm | $HLcm);
395
396 #
397 # LB 25 Numbers.
398 #
399 ($PRcm | $POcm)? ($OPcm | $HYcm)? $NUcm ($NUcm | $SYcm | $IScm)* ($CLcm | $CPcm)? ($PRcm | $POcm)?;
400
401 # LB 26 Do not break a Korean syllable
402 #
403 $JLcm ($JLcm | $JVcm | $H2cm | $H3cm);
404 ($JVcm | $H2cm) ($JVcm | $JTcm);
405 ($JTcm | $H3cm) $JTcm;
406
407 # LB 27 Treat korean Syllable Block the same as ID (don't break it)
408 ($JLcm | $JVcm | $JTcm | $H2cm | $H3cm) $INcm;
409 ($JLcm | $JVcm | $JTcm | $H2cm | $H3cm) $POcm;
410 $PRcm ($JLcm | $JVcm | $JTcm | $H2cm | $H3cm);
411
412
413 # LB 28 Do not break between alphabetics
414 #
415 ($ALcm | $HLcm) ($ALcm | $HLcm);
416 $CM+ ($ALcm | $HLcm); # The $CM+ is from rule 10, an unattached CM is treated as AL
417
418 # LB 29
419 $IScm ($ALcm | $HLcm);
420
421 # LB 30
422 ($ALcm | $HLcm | $NUcm) $OPcm;
423 $CM+ $OPcm; # The $CM+ is from rule 10, an unattached CM is treated as AL.
424 $CPcm ($ALcm | $HLcm | $NUcm);
425
426 # LB 30a Do not break between regional indicators.
427 $RIcm $RIcm;
428
429 # Special forward rule for people & body part emoji:
430 # don't break between relevant emoji and $EmojiMods
431 $EmojiForMods $EmojiVar? $EmojiMods;
432
433 #
434 # Reverse Rules.
435 #
436 ## -------------------------------------------------
437
438 !!reverse;
439
440 $CM+ $ALPlus;
441 $CM+ $BA;
442 $CM+ $HH;
443 $CM+ $BB;
444 $CM+ $B2;
445 $CM+ $CL;
446 $CM+ $CP;
447 $CM+ $EX;
448 $CM+ $GL;
449 $CM+ $HL;
450 $CM+ $HY;
451 $CM+ $H2;
452 $CM+ $H3;
453 $CM+ $ID;
454 $CM+ $IN;
455 $CM+ $IS;
456 $CM+ $JL;
457 $CM+ $JV;
458 $CM+ $JT;
459 $CM+ $NS;
460 $CM+ $NU;
461 $CM+ $OP;
462 $CM+ $PO;
463 $CM+ $PR;
464 $CM+ $QU;
465 $CM+ $RI;
466 $CM+ $SY;
467 $CM+ $WJ;
468 $CM+;
469
470
471 #
472 # Sequences of the form (shown forwards)
473 # [CANT_CM] <break> [CM] [whatever]
474 # The CM needs to behave as an AL
475 #
476 $AL_FOLLOW $CM+ / (
477 [$BK $CR $LF $NL $ZW {eof}] |
478 $SP+ $CM+ $SP |
479 $SP+ $CM* ([^$OP $CM $SP] | [$AL {eof}])); # if LB 14 will match, need to surpress this break.
480 # LB14 says OP SP* x .
481 # becomes OP SP* x AL
482 # becomes OP SP* x CM+ AL_FOLLOW
483 #
484 # Further note: the $AL in [$AL {eof}] is only to work around
485 # a rule compiler bug which complains about
486 # empty sets otherwise.
487
488 #
489 # Sequences of the form (shown forwards)
490 # [CANT_CM] <break> [CM] <break> [PR]
491 # The CM needs to behave as an AL
492 # This rule is concerned about getting the second of the two <breaks> in place.
493 #
494
495 [$PR ] / $CM+ [$BK $CR $LF $NL $ZW $SP {eof}];
496
497
498
499 # LB 4, 5, 5
500
501 $LB4Breaks [$LB4NonBreaks-$CM];
502 $LB4Breaks $CM+ $CAN_CM;
503 $LF $CR;
504
505
506 # LB 7 x SP
507 # x ZW
508 [$SP $ZW] [$LB4NonBreaks-$CM];
509 [$SP $ZW] $CM+ $CAN_CM;
510
511 # LB 8 ZW SP* <break>
512 # TODO: to implement this, we need more than one look-ahead hard break in play at a time.
513 # Requires an engine enhancement.
514 # / $SP* $ZW
515
516 # Special reverse rule for people & body part emoji:
517 # don't break $ZWJ from subsequent $EmojiForSeqs
518 $EmojiForSeqs $ZWJ $EmojiMods? $EmojiVar? $EmojiForSeqs;
519
520 # LB 9,10 Combining marks.
521 # X $CM needs to behave like X, where X is not $SP or controls.
522 # $CM not covered by the above needs to behave like $AL
523 # Stick together any combining sequences that don't match other rules.
524 $CM+ $CAN_CM;
525
526
527 # LB 11
528 $CM* $WJ $CM* $CAN_CM;
529 $CM* $WJ [$LB8NonBreaks-$CM];
530
531 $CANT_CM $CM* $WJ;
532 $CM* $CAN_CM $CM* $WJ;
533
534 # LB 12a
535 # [^SP BA HY] x GL
536 #
537 $CM* $GL $CM* [$LB8NonBreaks-[$CM $SP $BA $HH $HY]];
538
539 # LB 12
540 # GL x
541 #
542 $CANT_CM $CM* $GL;
543 $CM* $CAN_CM $CM* $GL;
544
545
546 # LB 13
547 $CL $CM+ $CAN_CM;
548 $CP $CM+ $CAN_CM;
549 $EX $CM+ $CAN_CM;
550 $IS $CM+ $CAN_CM;
551 $SY $CM+ $CAN_CM;
552
553 $CL [$LB8NonBreaks-$CM];
554 $CP [$LB8NonBreaks-$CM];
555 $EX [$LB8NonBreaks-$CM];
556 $IS [$LB8NonBreaks-$CM];
557 $SY [$LB8NonBreaks-$CM];
558
559 # Rule 13 & 14 taken together for an edge case.
560 # Match this, shown forward
561 # OP SP+ ($CM+ behaving as $AL) (CL | CP | EX | IS | IY)
562 # This really wants to chain at the $CM+ (which is acting as an $AL)
563 # except for $CM chaining being disabled.
564 [$CL $CP $EX $IS $SY] $CM+ $SP+ $CM* $OP;
565
566 # LB 14 OP SP* x
567 #
568 $CM* $CAN_CM $SP* $CM* $OP;
569 $CANT_CM $SP* $CM* $OP;
570 $AL_FOLLOW? $CM+ $SP $SP* $CM* $OP; # by LB 10, behaves like $AL_FOLLOW? $AL $SP* $CM* $OP
571
572 $AL_FOLLOW_NOCM $CM+ $SP+ $CM* $OP;
573 $CM* $AL_FOLLOW_CM $CM+ $SP+ $CM* $OP;
574 $SY $CM $SP+ $OP; # TODO: Experiment. Remove.
575
576
577
578 # LB 15
579 $CM* $OP $SP* $CM* $QU;
580
581 # LB 16
582 $CM* $NS $SP* $CM* ($CL | $CP);
583
584 # LB 17
585 $CM* $B2 $SP* $CM* $B2;
586
587 # LB 18 break after spaces
588 # Nothing explicit needed here.
589
590
591 #
592 # LB 19
593 #
594 $CM* $QU $CM* $CAN_CM; # . x QU
595 $CM* $QU $LB18NonBreaks;
596
597
598 $CM* $CAN_CM $CM* $QU; # QU x .
599 $CANT_CM $CM* $QU;
600
601 #
602 # LB 20 Break before and after CB.
603 # nothing needed here.
604 #
605
606 # LB 20.09 added rule for Finnish tailoring
607 $AL ($HY | $HH) / $SP;
608
609 # LB 21
610 $CM* ($BA | $HH | $HY | $NS) $CM* [$LB20NonBreaks-$CM]; # . x (BA | HY | NS)
611
612 $CM* [$LB20NonBreaks-$CM] $CM* $BB; # BB x .
613 [^$CB] $CM* $BB; #
614
615 # LB21a
616 [^$CB] $CM* ($HY | $BA | $HH) $CM* $HL;
617
618 # LB21b (reverse)
619 $CM* $HL $CM* $SY;
620
621 # LB 22
622 $CM* $IN $CM* ($ALPlus | $HL);
623 $CM* $IN $CM* $ID;
624 $CM* $IN $CM* $IN;
625 $CM* $IN $CM* $NU;
626
627 # LB 23
628 $CM* $PO $CM* $ID;
629 $CM* $NU $CM* ($ALPlus | $HL);
630 $CM* ($ALPlus | $HL) $CM* $NU;
631
632 # LB 24
633 $CM* $ID $CM* $PR;
634 $CM* ($ALPlus | $HL) $CM* $PR;
635 $CM* ($ALPlus | $HL) $CM* $PO;
636
637
638 # LB 25
639 ($CM* ($PR | $PO))? ($CM* ($CL | $CP))? ($CM* ($NU | $IS | $SY))* $CM* $NU ($CM* ($OP | $HY))? ($CM* ($PR | $PO))?;
640
641 # LB 26
642 $CM* ($H3 | $H2 | $JV | $JL) $CM* $JL;
643 $CM* ($JT | $JV) $CM* ($H2 | $JV);
644 $CM* $JT $CM* ($H3 | $JT);
645
646 # LB 27
647 $CM* $IN $CM* ($H3 | $H2 | $JT | $JV | $JL);
648 $CM* $PO $CM* ($H3 | $H2 | $JT | $JV | $JL);
649 $CM* ($H3 | $H2 | $JT | $JV | $JL) $CM* $PR;
650
651 # LB 28
652 $CM* ($ALPlus | $HL) $CM* ($ALPlus | $HL);
653
654
655 # LB 29
656 $CM* ($ALPlus | $HL) $CM* $IS;
657
658 # LB 30
659 $CM* $OP $CM* ($ALPlus | $HL | $NU);
660 $CM* ($ALPlus | $HL | $NU) $CM* $CP;
661
662 # LB 30a
663 $CM* $RI $CM* $RI;
664
665 # Special reverse rule for people & body part emoji:
666 # don't break between relevant emoji and $EmojiMods
667 $EmojiMods $EmojiVar? $EmojiForMods;
668
669 ## -------------------------------------------------
670
671 !!safe_reverse;
672
673 # LB 9
674 $CM+ [^$CM $BK $CR $LF $NL $ZW $SP];
675 $CM+ $SP / .;
676
677 # LB 14
678 $SP+ $CM* $OP;
679
680 # LB 15
681 $SP+ $CM* $QU;
682
683 # LB 16
684 $SP+ $CM* ($CL | $CP);
685
686 # LB 17
687 $SP+ $CM* $B2;
688
689 # LB 21
690 $CM* ($HY | $BA | $HH) $CM* $HL;
691
692 # LB 25
693 ($CM* ($IS | $SY))+ $CM* $NU;
694 ($CL | $CP) $CM* ($NU | $IS | $SY);
695
696 # For dictionary-based break
697 $dictionary $dictionary;
698
699 ## -------------------------------------------------
700
701 !!safe_forward;
702
703 # Skip forward over all character classes that are involved in
704 # rules containing patterns with possibly more than one char
705 # of context.
706 #
707 # It might be slightly more efficient to have specific rules
708 # instead of one generic one, but only if we could
709 # turn off rule chaining. We don't want to move more
710 # than necessary.
711 #
712 [$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2 $PR $HY $BA $dictionary];
713 $dictionary $dictionary;
714