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