add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / contrib / icu / src / data / uax29 / Default.rbbi
1 #
2 # Licensed to the Apache Software Foundation (ASF) under one or more
3 # contributor license agreements.  See the NOTICE file distributed with
4 # this work for additional information regarding copyright ownership.
5 # The ASF licenses this file to You under the Apache License, Version 2.0
6 # (the "License"); you may not use this file except in compliance with
7 # the License.  You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # Default RBBI rules, based on UAX#29.
18 #
19
20 !!chain;
21
22 #
23 #  Character Class Definitions.
24 #
25
26 $CR           = [\p{Word_Break = CR}];
27 $LF           = [\p{Word_Break = LF}];
28 $Newline      = [\p{Word_Break = Newline}];
29 $Extend       = [\p{Word_Break = Extend}];
30 $Format       = [\p{Word_Break = Format}];
31 $Katakana     = [\p{Word_Break = Katakana}];
32 $ALetter      = [\p{Word_Break = ALetter}];
33 $MidNumLet    = [\p{Word_Break = MidNumLet}];
34 $MidLetter    = [\p{Word_Break = MidLetter}];
35 $MidNum       = [\p{Word_Break = MidNum}];
36 $Numeric      = [\p{Word_Break = Numeric}[[:Decomposition_Type=Wide:]&[:General_Category=Decimal_Number:]]];
37 $ExtendNumLet = [\p{Word_Break = ExtendNumLet}];
38
39
40 #   Dictionary character set, for triggering language-based break engines. Currently
41 #   limited to LineBreak=Complex_Context. Note that this set only works in Unicode
42 #   5.0 or later as the definition of Complex_Context was corrected to include all
43 #   characters requiring dictionary break.
44
45 $dictionary   = [:LineBreak = Complex_Context:];
46 $Control        = [\p{Grapheme_Cluster_Break = Control}]; 
47 $ALetterPlus  = [$ALetter [$dictionary-$Extend-$Control]];   # Note:  default ALetter does not
48                                                              #  include the dictionary characters.
49
50 #
51 #  Rules 4    Ignore Format and Extend characters, 
52 #             except when they appear at the beginning of a region of text.
53 #
54 $KatakanaEx     = $Katakana     ($Extend |  $Format)*;
55 $ALetterEx      = $ALetterPlus  ($Extend |  $Format)*;
56 $MidNumLetEx    = $MidNumLet    ($Extend |  $Format)*;
57 $MidLetterEx    = $MidLetter    ($Extend |  $Format)*;
58 $MidNumEx       = $MidNum       ($Extend |  $Format)*;
59 $NumericEx      = $Numeric      ($Extend |  $Format)*;
60 $ExtendNumLetEx = $ExtendNumLet ($Extend |  $Format)*;
61
62 $Hiragana       = [\p{script=Hiragana}];
63 $Ideographic    = [\p{Ideographic}];
64 $HiraganaEx     = $Hiragana     ($Extend |  $Format)*;
65 $IdeographicEx  = $Ideographic  ($Extend |  $Format)*;
66
67 ## -------------------------------------------------
68
69 !!forward;
70
71
72 # Rule 3 - CR x LF
73 #
74 $CR $LF;
75
76 # Rule 4 - ignore Format and Extend characters, except when they appear at the beginning
77 #          of a region of Text.   The rule here comes into play when the start of text
78 #          begins with a group of Format chars, or with a "word" consisting of a single
79 #          char that is not in any of the listed word break categories followed by
80 #          format char(s).
81 [^$CR $LF $Newline]? ($Extend |  $Format)+;
82
83 $NumericEx {100};
84 $ALetterEx {200};
85 $KatakanaEx {300};       # note:  these status values override those from rule 5
86 $HiraganaEx {300};       #        by virtual of being numerically larger.
87 $IdeographicEx {400};    #
88
89 #
90 # rule 5
91 #    Do not break between most letters.
92 #
93 $ALetterEx $ALetterEx {200};
94
95 # rule 6 and 7
96 $ALetterEx ($MidLetterEx | $MidNumLetEx) $ALetterEx {200};
97
98 # rule 8
99
100 $NumericEx $NumericEx {100};
101
102 # rule 9
103
104 $ALetterEx $NumericEx {200};
105
106 # rule 10
107
108 $NumericEx $ALetterEx {200};
109
110 # rule 11 and 12 
111
112 $NumericEx ($MidNumEx | $MidNumLetEx) $NumericEx {100};
113
114 # rule 13
115
116 $KatakanaEx  $KatakanaEx {300};
117
118 # rule 13a/b
119
120 $ALetterEx      $ExtendNumLetEx {200};    #  (13a)
121 $NumericEx      $ExtendNumLetEx {100};    #  (13a)
122 $KatakanaEx     $ExtendNumLetEx {300};    #  (13a)
123 $ExtendNumLetEx $ExtendNumLetEx {200};    #  (13a)
124
125 $ExtendNumLetEx $ALetterEx  {200};    #  (13b)
126 $ExtendNumLetEx $NumericEx  {100};    #  (13b)
127 $ExtendNumLetEx $KatakanaEx {300};    #  (13b)