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