OLD | NEW |
1 # Copyright (c) 2002-2013 International Business Machines Corporation and | 1 # Copyright (c) 2002-2013 International Business Machines Corporation and |
2 # others. All Rights Reserved. | 2 # others. All Rights Reserved. |
3 # | 3 # |
4 # file: line.txt | 4 # file: line.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 29 for Unicode 6.2 |
9 # http://www.unicode.org/reports/tr14/ | 9 # http://www.unicode.org/reports/tr14/ |
10 # | 10 # |
11 # TODO: Rule LB 8 remains as it was in Unicode 5.2 | 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 implementatio
n, | 12 # This is only because of a limitation of ICU break engine implementatio
n, |
13 # not because the older behavior is desirable. | 13 # not because the older behavior is desirable. |
14 | 14 |
15 # CHROME: 1. Use line_ja.txt to apply small kana rules in all locales. | 15 # |
16 # 2. Adjust CL, OP, and IS to handle 'comma-variants' consistently. | 16 # Character Classes defined by TR 14. |
| 17 # |
17 | 18 |
18 !!chain; | 19 !!chain; |
19 !!LBCMNoChain; | 20 !!LBCMNoChain; |
20 | 21 |
21 | 22 |
22 !!lookAheadHardBreak; | 23 !!lookAheadHardBreak; |
23 # | 24 # |
24 # !!lookAheadHardBreak Described here because it is (as yet) undocumented el
sewhere | 25 # !!lookAheadHardBreak Described here because it is (as yet) undocumented el
sewhere |
25 # and only used for the line break rules. | 26 # and only used for the line break rules. |
26 # | 27 # |
(...skipping 22 matching lines...) Expand all Loading... |
49 # | 50 # |
50 # !!lookAheadHardBreak forces the run time state machine to | 51 # !!lookAheadHardBreak forces the run time state machine to |
51 # stop immediately when a look ahead rule ( '/' operator) matches, | 52 # stop immediately when a look ahead rule ( '/' operator) matches, |
52 # and set the match position to that of the look-ahead operator, | 53 # and set the match position to that of the look-ahead operator, |
53 # no matter what other rules may be in play at the time. | 54 # no matter what other rules may be in play at the time. |
54 # | 55 # |
55 # See rule LB 19 for an example. | 56 # See rule LB 19 for an example. |
56 # | 57 # |
57 | 58 |
58 $AI = [:LineBreak = Ambiguous:]; | 59 $AI = [:LineBreak = Ambiguous:]; |
59 $AL = [[:LineBreak = Alphabetic:] - [\u23B4\u23B5]]; | 60 $AL = [:LineBreak = Alphabetic:]; |
60 $BA = [:LineBreak = Break_After:]; | 61 $BA = [:LineBreak = Break_After:]; |
61 $BB = [:LineBreak = Break_Before:]; | 62 $BB = [:LineBreak = Break_Before:]; |
62 $BK = [:LineBreak = Mandatory_Break:]; | 63 $BK = [:LineBreak = Mandatory_Break:]; |
63 $B2 = [:LineBreak = Break_Both:]; | 64 $B2 = [:LineBreak = Break_Both:]; |
64 $CB = [:LineBreak = Contingent_Break:]; | 65 $CB = [:LineBreak = Contingent_Break:]; |
65 $CJ = [:LineBreak = Conditional_Japanese_Starter:]; | 66 $CJ = [:LineBreak = Conditional_Japanese_Starter:]; |
66 $CL = [[:LineBreak = Close_Punctuation:] [\uFE51\uFE10\u23B5]]; | 67 $CL = [:LineBreak = Close_Punctuation:]; |
67 $CM = [:LineBreak = Combining_Mark:]; | 68 $CM = [:LineBreak = Combining_Mark:]; |
68 $CP = [:LineBreak = Close_Parenthesis:]; | 69 $CP = [:LineBreak = Close_Parenthesis:]; |
69 $CR = [:LineBreak = Carriage_Return:]; | 70 $CR = [:LineBreak = Carriage_Return:]; |
70 $EX = [:LineBreak = Exclamation:]; | 71 $EX = [:LineBreak = Exclamation:]; |
71 $GL = [:LineBreak = Glue:]; | 72 $GL = [:LineBreak = Glue:]; |
72 $HL = [:LineBreak = Hebrew_Letter:]; | 73 $HL = [:LineBreak = Hebrew_Letter:]; |
73 $HY = [:LineBreak = Hyphen:]; | 74 $HY = [:LineBreak = Hyphen:]; |
74 $H2 = [:LineBreak = H2:]; | 75 $H2 = [:LineBreak = H2:]; |
75 $H3 = [:LineBreak = H3:]; | 76 $H3 = [:LineBreak = H3:]; |
76 $ID = [[[:LineBreak = Ideographic:] $CJ] - [\uFE51]]; | 77 $ID = [:LineBreak = Ideographic:]; |
77 $IN = [:LineBreak = Inseperable:]; | 78 $IN = [:LineBreak = Inseperable:]; |
78 $IS = [[:LineBreak = Infix_Numeric:] - [\uFE10]]; | 79 $IS = [:LineBreak = Infix_Numeric:]; |
79 $JL = [:LineBreak = JL:]; | 80 $JL = [:LineBreak = JL:]; |
80 $JV = [:LineBreak = JV:]; | 81 $JV = [:LineBreak = JV:]; |
81 $JT = [:LineBreak = JT:]; | 82 $JT = [:LineBreak = JT:]; |
82 $LF = [:LineBreak = Line_Feed:]; | 83 $LF = [:LineBreak = Line_Feed:]; |
83 $NL = [:LineBreak = Next_Line:]; | 84 $NL = [:LineBreak = Next_Line:]; |
84 $NS = [:LineBreak = Nonstarter:]; | 85 $NS = [[:LineBreak = Nonstarter:] $CJ]; |
85 $NU = [:LineBreak = Numeric:]; | 86 $NU = [:LineBreak = Numeric:]; |
86 $OP = [[:LineBreak = Open_Punctuation:] \u23B4]; | 87 $OP = [:LineBreak = Open_Punctuation:]; |
87 $PO = [:LineBreak = Postfix_Numeric:]; | 88 $PO = [:LineBreak = Postfix_Numeric:]; |
88 $PR = [:LineBreak = Prefix_Numeric:]; | 89 $PR = [:LineBreak = Prefix_Numeric:]; |
89 $QU = [:LineBreak = Quotation:]; | 90 $QU = [:LineBreak = Quotation:]; |
90 $RI = [:LineBreak = Regional_Indicator:]; | 91 $RI = [:LineBreak = Regional_Indicator:]; |
91 $SA = [:LineBreak = Complex_Context:]; | 92 $SA = [:LineBreak = Complex_Context:]; |
92 $SG = [:LineBreak = Surrogate:]; | 93 $SG = [:LineBreak = Surrogate:]; |
93 $SP = [:LineBreak = Space:]; | 94 $SP = [:LineBreak = Space:]; |
94 $SY = [:LineBreak = Break_Symbols:]; | 95 $SY = [:LineBreak = Break_Symbols:]; |
95 $WJ = [:LineBreak = Word_Joiner:]; | 96 $WJ = [:LineBreak = Word_Joiner:]; |
96 $XX = [:LineBreak = Unknown:]; | 97 $XX = [:LineBreak = Unknown:]; |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 # of context. | 665 # of context. |
665 # | 666 # |
666 # It might be slightly more efficient to have specific rules | 667 # It might be slightly more efficient to have specific rules |
667 # instead of one generic one, but only if we could | 668 # instead of one generic one, but only if we could |
668 # turn off rule chaining. We don't want to move more | 669 # turn off rule chaining. We don't want to move more |
669 # than necessary. | 670 # than necessary. |
670 # | 671 # |
671 [$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2
$PR $HY $BA $dictionary]; | 672 [$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2
$PR $HY $BA $dictionary]; |
672 $dictionary $dictionary; | 673 $dictionary $dictionary; |
673 | 674 |
OLD | NEW |