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 # | 15 # CHROME: 1. Use line_ja.txt to apply small kana rules in all locales. |
16 # Character Classes defined by TR 14. | 16 # 2. Adjust CL, OP, and IS to handle 'comma-variants' consistently. |
17 # | 17 # 3. Adjust CL, QU, and OP to handle quotation marks around Chinese |
| 18 # characters. |
18 | 19 |
19 !!chain; | 20 !!chain; |
20 !!LBCMNoChain; | 21 !!LBCMNoChain; |
21 | 22 |
22 | 23 |
23 !!lookAheadHardBreak; | 24 !!lookAheadHardBreak; |
24 # | 25 # |
25 # !!lookAheadHardBreak Described here because it is (as yet) undocumented el
sewhere | 26 # !!lookAheadHardBreak Described here because it is (as yet) undocumented el
sewhere |
26 # and only used for the line break rules. | 27 # and only used for the line break rules. |
27 # | 28 # |
(...skipping 22 matching lines...) Expand all Loading... |
50 # | 51 # |
51 # !!lookAheadHardBreak forces the run time state machine to | 52 # !!lookAheadHardBreak forces the run time state machine to |
52 # stop immediately when a look ahead rule ( '/' operator) matches, | 53 # stop immediately when a look ahead rule ( '/' operator) matches, |
53 # and set the match position to that of the look-ahead operator, | 54 # 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 # no matter what other rules may be in play at the time. |
55 # | 56 # |
56 # See rule LB 19 for an example. | 57 # See rule LB 19 for an example. |
57 # | 58 # |
58 | 59 |
59 $AI = [:LineBreak = Ambiguous:]; | 60 $AI = [:LineBreak = Ambiguous:]; |
60 $AL = [:LineBreak = Alphabetic:]; | 61 $AL = [[:LineBreak = Alphabetic:] - [\u23B4\u23B5]]; |
61 $BA = [:LineBreak = Break_After:]; | 62 $BA = [:LineBreak = Break_After:]; |
62 $BB = [:LineBreak = Break_Before:]; | 63 $BB = [:LineBreak = Break_Before:]; |
63 $BK = [:LineBreak = Mandatory_Break:]; | 64 $BK = [:LineBreak = Mandatory_Break:]; |
64 $B2 = [:LineBreak = Break_Both:]; | 65 $B2 = [:LineBreak = Break_Both:]; |
65 $CB = [:LineBreak = Contingent_Break:]; | 66 $CB = [:LineBreak = Contingent_Break:]; |
66 $CJ = [:LineBreak = Conditional_Japanese_Starter:]; | 67 $CJ = [:LineBreak = Conditional_Japanese_Starter:]; |
67 $CL = [:LineBreak = Close_Punctuation:]; | 68 $QU2CL = [\u2019\u201D\u275C\u275E]; |
| 69 $CL = [[:LineBreak = Close_Punctuation:] [\uFE51\uFE10\u23B5] $QU2CL]; |
68 $CM = [:LineBreak = Combining_Mark:]; | 70 $CM = [:LineBreak = Combining_Mark:]; |
69 $CP = [:LineBreak = Close_Parenthesis:]; | 71 $CP = [:LineBreak = Close_Parenthesis:]; |
70 $CR = [:LineBreak = Carriage_Return:]; | 72 $CR = [:LineBreak = Carriage_Return:]; |
71 $EX = [:LineBreak = Exclamation:]; | 73 $EX = [:LineBreak = Exclamation:]; |
72 $GL = [:LineBreak = Glue:]; | 74 $GL = [:LineBreak = Glue:]; |
73 $HL = [:LineBreak = Hebrew_Letter:]; | 75 $HL = [:LineBreak = Hebrew_Letter:]; |
74 $HY = [:LineBreak = Hyphen:]; | 76 $HY = [:LineBreak = Hyphen:]; |
75 $H2 = [:LineBreak = H2:]; | 77 $H2 = [:LineBreak = H2:]; |
76 $H3 = [:LineBreak = H3:]; | 78 $H3 = [:LineBreak = H3:]; |
77 $ID = [:LineBreak = Ideographic:]; | 79 $ID = [[[:LineBreak = Ideographic:] $CJ] - [\uFE51]]; |
78 $IN = [:LineBreak = Inseperable:]; | 80 $IN = [:LineBreak = Inseperable:]; |
79 $IS = [:LineBreak = Infix_Numeric:]; | 81 $IS = [[:LineBreak = Infix_Numeric:] - [\uFE10]]; |
80 $JL = [:LineBreak = JL:]; | 82 $JL = [:LineBreak = JL:]; |
81 $JV = [:LineBreak = JV:]; | 83 $JV = [:LineBreak = JV:]; |
82 $JT = [:LineBreak = JT:]; | 84 $JT = [:LineBreak = JT:]; |
83 $LF = [:LineBreak = Line_Feed:]; | 85 $LF = [:LineBreak = Line_Feed:]; |
84 $NL = [:LineBreak = Next_Line:]; | 86 $NL = [:LineBreak = Next_Line:]; |
85 $NS = [[:LineBreak = Nonstarter:] $CJ]; | 87 $NS = [:LineBreak = Nonstarter:]; |
86 $NU = [:LineBreak = Numeric:]; | 88 $NU = [:LineBreak = Numeric:]; |
87 $OP = [:LineBreak = Open_Punctuation:]; | 89 $QU2OP = [\u2018\u201B\u201C\u201F\u275B\u275D]; |
| 90 $OP = [[:LineBreak = Open_Punctuation:] \u23B4 $QU2OP]; |
88 $PO = [:LineBreak = Postfix_Numeric:]; | 91 $PO = [:LineBreak = Postfix_Numeric:]; |
89 $PR = [:LineBreak = Prefix_Numeric:]; | 92 $PR = [:LineBreak = Prefix_Numeric:]; |
90 $QU = [:LineBreak = Quotation:]; | 93 $QU = [[:LineBreak = Quotation:] - $QU2CL - $QU2OP]; |
91 $RI = [:LineBreak = Regional_Indicator:]; | 94 $RI = [:LineBreak = Regional_Indicator:]; |
92 $SA = [:LineBreak = Complex_Context:]; | 95 $SA = [:LineBreak = Complex_Context:]; |
93 $SG = [:LineBreak = Surrogate:]; | 96 $SG = [:LineBreak = Surrogate:]; |
94 $SP = [:LineBreak = Space:]; | 97 $SP = [:LineBreak = Space:]; |
95 $SY = [:LineBreak = Break_Symbols:]; | 98 $SY = [:LineBreak = Break_Symbols:]; |
96 $WJ = [:LineBreak = Word_Joiner:]; | 99 $WJ = [:LineBreak = Word_Joiner:]; |
97 $XX = [:LineBreak = Unknown:]; | 100 $XX = [:LineBreak = Unknown:]; |
98 $ZW = [:LineBreak = ZWSpace:]; | 101 $ZW = [:LineBreak = ZWSpace:]; |
99 | 102 |
100 # Dictionary character set, for triggering language-based break engines. Curre
ntly | 103 # Dictionary character set, for triggering language-based break engines. Curre
ntly |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 # of context. | 668 # of context. |
666 # | 669 # |
667 # It might be slightly more efficient to have specific rules | 670 # It might be slightly more efficient to have specific rules |
668 # instead of one generic one, but only if we could | 671 # instead of one generic one, but only if we could |
669 # turn off rule chaining. We don't want to move more | 672 # turn off rule chaining. We don't want to move more |
670 # than necessary. | 673 # than necessary. |
671 # | 674 # |
672 [$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2
$PR $HY $BA $dictionary]; | 675 [$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2
$PR $HY $BA $dictionary]; |
673 $dictionary $dictionary; | 676 $dictionary $dictionary; |
674 | 677 |
OLD | NEW |