OLD | NEW |
1 # Copyright (c) 2002-2013 International Business Machines Corporation and | 1 # Copyright (c) 2002-2015 International Business Machines Corporation and |
2 # others. All Rights Reserved. | 2 # others. All Rights Reserved. |
3 # | 3 # |
4 # file: line_ja.txt | 4 # file: line_loose.txt |
5 # | 5 # |
6 # Line Breaking Rules | 6 # Line Breaking Rules |
7 # Implement default line breaking as defined by | 7 # Implement default line breaking as defined by |
8 # Unicode Standard Annex #14 Revision 29 for Unicode 6.2 | 8 # Unicode Standard Annex #14 Revision 34 for Unicode 8.0 |
9 # http://www.unicode.org/reports/tr14/ | 9 # http://www.unicode.org/reports/tr14/ |
| 10 # tailored as noted in 2nd paragraph below.. |
10 # | 11 # |
11 # TODO: Rule LB 8 remains as it was in Unicode 5.2 | 12 # TODO: Rule LB 8 remains as it was in Unicode 5.2 |
12 # This is only because of a limitation of ICU break engine implementatio
n, | 13 # This is only because of a limitation of ICU break engine implementatio
n, |
13 # not because the older behavior is desirable. | 14 # not because the older behavior is desirable. |
| 15 # |
| 16 # This tailors the line break behavior to correspond to CSS |
| 17 # line-break=loose (BCP47 -u-lb-loose) as defined for languages other th
an |
| 18 # Chinese & Japanese. |
| 19 # It sets characters of class CJ to behave like ID. |
| 20 # In addition, it allows breaks: |
| 21 # * before iteration marks 3005, 303B, 309D, 309E, 30FD, 30FE (all NS) |
| 22 # * between characters of LineBreak class IN |
14 | 23 |
15 # | 24 # |
16 # Character Classes defined by TR 14. | 25 # Character Classes defined by TR 14. |
17 # | 26 # |
18 | 27 |
19 !!chain; | 28 !!chain; |
20 !!LBCMNoChain; | 29 !!LBCMNoChain; |
21 | 30 |
22 | 31 |
23 !!lookAheadHardBreak; | 32 !!lookAheadHardBreak; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 $H2 = [:LineBreak = H2:]; | 84 $H2 = [:LineBreak = H2:]; |
76 $H3 = [:LineBreak = H3:]; | 85 $H3 = [:LineBreak = H3:]; |
77 $ID = [[:LineBreak = Ideographic:] $CJ]; | 86 $ID = [[:LineBreak = Ideographic:] $CJ]; |
78 $IN = [:LineBreak = Inseperable:]; | 87 $IN = [:LineBreak = Inseperable:]; |
79 $IS = [:LineBreak = Infix_Numeric:]; | 88 $IS = [:LineBreak = Infix_Numeric:]; |
80 $JL = [:LineBreak = JL:]; | 89 $JL = [:LineBreak = JL:]; |
81 $JV = [:LineBreak = JV:]; | 90 $JV = [:LineBreak = JV:]; |
82 $JT = [:LineBreak = JT:]; | 91 $JT = [:LineBreak = JT:]; |
83 $LF = [:LineBreak = Line_Feed:]; | 92 $LF = [:LineBreak = Line_Feed:]; |
84 $NL = [:LineBreak = Next_Line:]; | 93 $NL = [:LineBreak = Next_Line:]; |
85 $NS = [:LineBreak = Nonstarter:]; | 94 $NSX = [\u3005 \u303B \u309D \u309E \u30FD \u30FE]; |
| 95 $NS = [[:LineBreak = Nonstarter:] - $NSX]; |
86 $NU = [:LineBreak = Numeric:]; | 96 $NU = [:LineBreak = Numeric:]; |
87 $OP = [:LineBreak = Open_Punctuation:]; | 97 $OP = [:LineBreak = Open_Punctuation:]; |
88 $PO = [:LineBreak = Postfix_Numeric:]; | 98 $PO = [:LineBreak = Postfix_Numeric:]; |
89 $PR = [:LineBreak = Prefix_Numeric:]; | 99 $PR = [:LineBreak = Prefix_Numeric:]; |
90 $QU = [:LineBreak = Quotation:]; | 100 $QU = [:LineBreak = Quotation:]; |
91 $RI = [:LineBreak = Regional_Indicator:]; | 101 $RI = [:LineBreak = Regional_Indicator:]; |
92 $SA = [:LineBreak = Complex_Context:]; | 102 $SA = [:LineBreak = Complex_Context:]; |
93 $SG = [:LineBreak = Surrogate:]; | 103 $SG = [:LineBreak = Surrogate:]; |
94 $SP = [:LineBreak = Space:]; | 104 $SP = [:LineBreak = Space:]; |
95 $SY = [:LineBreak = Break_Symbols:]; | 105 $SY = [:LineBreak = Break_Symbols:]; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 $HYcm = $HY $CM*; | 138 $HYcm = $HY $CM*; |
129 $H2cm = $H2 $CM*; | 139 $H2cm = $H2 $CM*; |
130 $H3cm = $H3 $CM*; | 140 $H3cm = $H3 $CM*; |
131 $IDcm = $ID $CM*; | 141 $IDcm = $ID $CM*; |
132 $INcm = $IN $CM*; | 142 $INcm = $IN $CM*; |
133 $IScm = $IS $CM*; | 143 $IScm = $IS $CM*; |
134 $JLcm = $JL $CM*; | 144 $JLcm = $JL $CM*; |
135 $JVcm = $JV $CM*; | 145 $JVcm = $JV $CM*; |
136 $JTcm = $JT $CM*; | 146 $JTcm = $JT $CM*; |
137 $NScm = $NS $CM*; | 147 $NScm = $NS $CM*; |
| 148 $NSXcm = $NSX $CM*; |
138 $NUcm = $NU $CM*; | 149 $NUcm = $NU $CM*; |
139 $OPcm = $OP $CM*; | 150 $OPcm = $OP $CM*; |
140 $POcm = $PO $CM*; | 151 $POcm = $PO $CM*; |
141 $PRcm = $PR $CM*; | 152 $PRcm = $PR $CM*; |
142 $QUcm = $QU $CM*; | 153 $QUcm = $QU $CM*; |
143 $RIcm = $RI $CM*; | 154 $RIcm = $RI $CM*; |
144 $SYcm = $SY $CM*; | 155 $SYcm = $SY $CM*; |
145 $WJcm = $WJ $CM*; | 156 $WJcm = $WJ $CM*; |
146 | 157 |
147 ## ------------------------------------------------- | 158 ## ------------------------------------------------- |
(...skipping 15 matching lines...) Expand all Loading... |
163 $HY $CM+; | 174 $HY $CM+; |
164 $H2 $CM+; | 175 $H2 $CM+; |
165 $H3 $CM+; | 176 $H3 $CM+; |
166 $ID $CM+; | 177 $ID $CM+; |
167 $IN $CM+; | 178 $IN $CM+; |
168 $IS $CM+; | 179 $IS $CM+; |
169 $JL $CM+; | 180 $JL $CM+; |
170 $JV $CM+; | 181 $JV $CM+; |
171 $JT $CM+; | 182 $JT $CM+; |
172 $NS $CM+; | 183 $NS $CM+; |
| 184 $NSX $CM+; |
173 $NU $CM+; | 185 $NU $CM+; |
174 $OP $CM+; | 186 $OP $CM+; |
175 $PO $CM+; | 187 $PO $CM+; |
176 $PR $CM+; | 188 $PR $CM+; |
177 $QU $CM+; | 189 $QU $CM+; |
178 $RI $CM+; | 190 $RI $CM+; |
179 $SY $CM+; | 191 $SY $CM+; |
180 $WJ $CM+; | 192 $WJ $CM+; |
181 | 193 |
182 # | 194 # |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 # | 305 # |
294 $OPcm $SP* $CAN_CM $CM*; | 306 $OPcm $SP* $CAN_CM $CM*; |
295 $OPcm $SP* $CANT_CM; | 307 $OPcm $SP* $CANT_CM; |
296 | 308 |
297 $OPcm $SP+ $CM+ $AL_FOLLOW?; # by rule 10, stand-alone CM behaves as AL | 309 $OPcm $SP+ $CM+ $AL_FOLLOW?; # by rule 10, stand-alone CM behaves as AL |
298 | 310 |
299 # LB 15 | 311 # LB 15 |
300 $QUcm $SP* $OPcm; | 312 $QUcm $SP* $OPcm; |
301 | 313 |
302 # LB 16 | 314 # LB 16 |
| 315 # Do not break between closing punctuation and $NS, even with intervening spaces |
| 316 # But DO allow a break between closing punctuation and $NSX, don't include it he
re |
303 ($CLcm | $CPcm) $SP* $NScm; | 317 ($CLcm | $CPcm) $SP* $NScm; |
304 | 318 |
305 # LB 17 | 319 # LB 17 |
306 $B2cm $SP* $B2cm; | 320 $B2cm $SP* $B2cm; |
307 | 321 |
308 # | 322 # |
309 # LB 18 Break after spaces. | 323 # LB 18 Break after spaces. |
310 # | 324 # |
311 $LB18NonBreaks = [$LB8NonBreaks - [$SP]]; | 325 $LB18NonBreaks = [$LB8NonBreaks - [$SP]]; |
312 $LB18Breaks = [$LB8Breaks $SP]; | 326 $LB18Breaks = [$LB8Breaks $SP]; |
(...skipping 12 matching lines...) Expand all Loading... |
325 | 339 |
326 # LB 20 | 340 # LB 20 |
327 # <break> $CB | 341 # <break> $CB |
328 # $CB <break> | 342 # $CB <break> |
329 | 343 |
330 $LB20NonBreaks = [$LB18NonBreaks - $CB]; | 344 $LB20NonBreaks = [$LB18NonBreaks - $CB]; |
331 | 345 |
332 # LB 21 x (BA | HY | NS) | 346 # LB 21 x (BA | HY | NS) |
333 # BB x | 347 # BB x |
334 # | 348 # |
| 349 # DO allow breaks here before NSXcm, so don't include it |
335 $LB20NonBreaks $CM* ($BAcm | $HYcm | $NScm); | 350 $LB20NonBreaks $CM* ($BAcm | $HYcm | $NScm); |
336 | 351 |
337 $BBcm [^$CB]; # $BB x | 352 $BBcm [^$CB]; # $BB x |
338 $BBcm $LB20NonBreaks $CM*; | 353 $BBcm $LB20NonBreaks $CM*; |
339 | 354 |
340 # LB 21a Don't break after Hebrew + Hyphen | 355 # LB 21a Don't break after Hebrew + Hyphen |
341 # HL (HY | BA) x | 356 # HL (HY | BA) x |
342 # | 357 # |
343 $HLcm ($HYcm | $BAcm) [^$CB]?; | 358 $HLcm ($HYcm | $BAcm) [^$CB]?; |
344 | 359 |
345 # LB 21b (forward) Don't break between SY and HL | 360 # LB 21b (forward) Don't break between SY and HL |
346 # (break between HL and SY already disallowed by LB 13 above) | 361 # (break between HL and SY already disallowed by LB 13 above) |
347 $SYcm $HLcm; | 362 $SYcm $HLcm; |
348 | 363 |
349 # LB 22 | 364 # LB 22 |
350 ($ALcm | $HLcm) $INcm; | 365 ($ALcm | $HLcm) $INcm; |
351 $CM+ $INcm; # by rule 10, any otherwise unattached CM behaves as AL | 366 $CM+ $INcm; # by rule 10, any otherwise unattached CM behaves as AL |
| 367 $EXcm $INcm; |
352 $IDcm $INcm; | 368 $IDcm $INcm; |
353 $INcm $INcm; | 369 # $INcm $INcm; # delete this rule for CSS loose |
354 $NUcm $INcm; | 370 $NUcm $INcm; |
355 | 371 |
356 | 372 |
357 # $LB 23 | 373 # $LB 23 |
358 $IDcm $POcm; | 374 $IDcm $POcm; |
359 $ALcm $NUcm; # includes $LB19 | 375 $ALcm $NUcm; # includes $LB19 |
360 $HLcm $NUcm; | 376 $HLcm $NUcm; |
361 $CM+ $NUcm; # Rule 10, any otherwise unattached CM behaves as AL | 377 $CM+ $NUcm; # Rule 10, any otherwise unattached CM behaves as AL |
362 $NUcm $ALcm; | 378 $NUcm $ALcm; |
363 $NUcm $HLcm; | 379 $NUcm $HLcm; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 $CM+ $HY; | 437 $CM+ $HY; |
422 $CM+ $H2; | 438 $CM+ $H2; |
423 $CM+ $H3; | 439 $CM+ $H3; |
424 $CM+ $ID; | 440 $CM+ $ID; |
425 $CM+ $IN; | 441 $CM+ $IN; |
426 $CM+ $IS; | 442 $CM+ $IS; |
427 $CM+ $JL; | 443 $CM+ $JL; |
428 $CM+ $JV; | 444 $CM+ $JV; |
429 $CM+ $JT; | 445 $CM+ $JT; |
430 $CM+ $NS; | 446 $CM+ $NS; |
| 447 $CM+ $NSX; |
431 $CM+ $NU; | 448 $CM+ $NU; |
432 $CM+ $OP; | 449 $CM+ $OP; |
433 $CM+ $PO; | 450 $CM+ $PO; |
434 $CM+ $PR; | 451 $CM+ $PR; |
435 $CM+ $QU; | 452 $CM+ $QU; |
436 $CM+ $RI; | 453 $CM+ $RI; |
437 $CM+ $SY; | 454 $CM+ $SY; |
438 $CM+ $WJ; | 455 $CM+ $WJ; |
439 $CM+; | 456 $CM+; |
440 | 457 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 $AL_FOLLOW_NOCM $CM+ $SP+ $CM* $OP; | 556 $AL_FOLLOW_NOCM $CM+ $SP+ $CM* $OP; |
540 $CM* $AL_FOLLOW_CM $CM+ $SP+ $CM* $OP; | 557 $CM* $AL_FOLLOW_CM $CM+ $SP+ $CM* $OP; |
541 $SY $CM $SP+ $OP; # TODO: Experiment. Remove. | 558 $SY $CM $SP+ $OP; # TODO: Experiment. Remove. |
542 | 559 |
543 | 560 |
544 | 561 |
545 # LB 15 | 562 # LB 15 |
546 $CM* $OP $SP* $CM* $QU; | 563 $CM* $OP $SP* $CM* $QU; |
547 | 564 |
548 # LB 16 | 565 # LB 16 |
| 566 # Don't include $NSX here |
549 $CM* $NS $SP* $CM* ($CL | $CP); | 567 $CM* $NS $SP* $CM* ($CL | $CP); |
550 | 568 |
551 # LB 17 | 569 # LB 17 |
552 $CM* $B2 $SP* $CM* $B2; | 570 $CM* $B2 $SP* $CM* $B2; |
553 | 571 |
554 # LB 18 break after spaces | 572 # LB 18 break after spaces |
555 # Nothing explicit needed here. | 573 # Nothing explicit needed here. |
556 | 574 |
557 | 575 |
558 # | 576 # |
559 # LB 19 | 577 # LB 19 |
560 # | 578 # |
561 $CM* $QU $CM* $CAN_CM; # . x QU | 579 $CM* $QU $CM* $CAN_CM; # . x QU |
562 $CM* $QU $LB18NonBreaks; | 580 $CM* $QU $LB18NonBreaks; |
563 | 581 |
564 | 582 |
565 $CM* $CAN_CM $CM* $QU; # QU x . | 583 $CM* $CAN_CM $CM* $QU; # QU x . |
566 $CANT_CM $CM* $QU; | 584 $CANT_CM $CM* $QU; |
567 | 585 |
568 # | 586 # |
569 # LB 20 Break before and after CB. | 587 # LB 20 Break before and after CB. |
570 # nothing needed here. | 588 # nothing needed here. |
571 # | 589 # |
572 | 590 |
573 # LB 21 | 591 # LB 21 |
| 592 # Don't include $NSX here |
574 $CM* ($BA | $HY | $NS) $CM* [$LB20NonBreaks-$CM]; # . x (BA | HY | NS) | 593 $CM* ($BA | $HY | $NS) $CM* [$LB20NonBreaks-$CM]; # . x (BA | HY | NS) |
575 | 594 |
576 $CM* [$LB20NonBreaks-$CM] $CM* $BB; # BB x . | 595 $CM* [$LB20NonBreaks-$CM] $CM* $BB; # BB x . |
577 [^$CB] $CM* $BB; # | 596 [^$CB] $CM* $BB; # |
578 | 597 |
579 # LB21a | 598 # LB21a |
580 [^$CB] $CM* ($HY | $BA) $CM* $HL; | 599 [^$CB] $CM* ($HY | $BA) $CM* $HL; |
581 | 600 |
582 # LB21b (reverse) | 601 # LB21b (reverse) |
583 $CM* $HL $CM* $SY; | 602 $CM* $HL $CM* $SY; |
584 | 603 |
585 # LB 22 | 604 # LB 22 |
586 $CM* $IN $CM* ($ALPlus | $HL); | 605 $CM* $IN $CM* ($ALPlus | $HL); |
| 606 $CM* $IN $CM* $EX; |
587 $CM* $IN $CM* $ID; | 607 $CM* $IN $CM* $ID; |
588 $CM* $IN $CM* $IN; | 608 # $CM* $IN $CM* $IN; # delete this rule for CSS loose |
589 $CM* $IN $CM* $NU; | 609 $CM* $IN $CM* $NU; |
590 | 610 |
591 # LB 23 | 611 # LB 23 |
592 $CM* $PO $CM* $ID; | 612 $CM* $PO $CM* $ID; |
593 $CM* $NU $CM* ($ALPlus | $HL); | 613 $CM* $NU $CM* ($ALPlus | $HL); |
594 $CM* ($ALPlus | $HL) $CM* $NU; | 614 $CM* ($ALPlus | $HL) $CM* $NU; |
595 | 615 |
596 # LB 24 | 616 # LB 24 |
597 $CM* $ID $CM* $PR; | 617 $CM* $ID $CM* $PR; |
598 $CM* ($ALPlus | $HL) $CM* $PR; | 618 $CM* ($ALPlus | $HL) $CM* $PR; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 # of context. | 685 # of context. |
666 # | 686 # |
667 # It might be slightly more efficient to have specific rules | 687 # It might be slightly more efficient to have specific rules |
668 # instead of one generic one, but only if we could | 688 # instead of one generic one, but only if we could |
669 # turn off rule chaining. We don't want to move more | 689 # turn off rule chaining. We don't want to move more |
670 # than necessary. | 690 # than necessary. |
671 # | 691 # |
672 [$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2
$PR $HY $BA $dictionary]; | 692 [$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2
$PR $HY $BA $dictionary]; |
673 $dictionary $dictionary; | 693 $dictionary $dictionary; |
674 | 694 |
OLD | NEW |