~slub.team/goobi-indexserver/3.x

« back to all changes in this revision

Viewing changes to lucene/contrib/icu/src/data/uax29/Lao.rbbi

  • Committer: Sebastian Meyer
  • Date: 2012-08-03 09:12:40 UTC
  • Revision ID: sebastian.meyer@slub-dresden.de-20120803091240-x6861b0vabq1xror
Remove Lucene and Solr source code and add patches instead
Fix Bug #985487: Auto-suggestion for the search interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
# Parses Lao text, with syllable as token.
18
 
#
19
 
# The definition of Lao syllable is based from:
20
 
#
21
 
#   Syllabification of Lao Script for Line Breaking
22
 
#   Phonpasit Phissamay, Valaxay Dalolay, Chitaphone Chanhsililath, Oulaiphone Silimasak, 
23
 
#     Sarmad Hussain, Nadir Durrani, Science Technology and Environment Agency, CRULP
24
 
#   http://www.panl10n.net/english/final%20reports/pdf%20files/Laos/LAO06.pdf
25
 
#       http://www.panl10n.net/Presentations/Cambodia/Phonpassit/LineBreakingAlgo.pdf
26
 
#
27
 
# NOTE:
28
 
# There are some ambiguities in Lao syllabification without additional processing, as mentioned in the paper.
29
 
# For this reason, this RBBI grammar really only works with LaoBreakIterator, as it does this additional work.
30
 
#
31
 
# Syllable structure, where X is the nuclear consonant:
32
 
#
33
 
#           +----+
34
 
#           | X5 |
35
 
#           +----+
36
 
#           | X4 |
37
 
# +----+----+----+----+----+----+----+-----+
38
 
# | X0 | X1 | X  | X6 | X7 | X8 | X9 | X10 |
39
 
# +----+----+----+----+----+----+----+-----+
40
 
#           | X2 |
41
 
#           +----+
42
 
#           | X3 |
43
 
#           +----+
44
 
#
45
 
# X0 represents a vowel which occurs before the nuclear consonant. 
46
 
# It can always define the beginning of syllable.
47
 
$X0 = [\u0EC0-\u0EC4];
48
 
# X1 is a combination consonant which comes before the nuclear consonant, 
49
 
# but only if nuclear consonant is one of {ງ ຍ ລ ວ ຼ ມ ນ ຣ}
50
 
$X1 = [\u0EAB];
51
 
# X represents the nuclear consonant.
52
 
$X = [\u0E81-\u0EAE\u0EDC\u0EDD];
53
 
# X2 is a combination consonant which comes after the nuclear consonant, 
54
 
# which is placed under or next to the nuclear consonant.
55
 
$X2 = [\u0EBC\u0EA3\u0EA7\u0EA5];
56
 
# X3 represents a vowel which occurs under the nuclear consonant.
57
 
$X3 = [\u0EB8\u0EB9];
58
 
# X4 represents a vowel which occurs above the nuclear consonant. 
59
 
$X4 = [\u0EB4-\u0EB7\u0ECD\u0EBB\u0EB1];
60
 
# X5 represents a tone mark which occurs above the nuclear consonant or upper vowel.
61
 
$X5 = [\u0EC8-\u0ECB];
62
 
# X6 represents a consonant vowel, which occurs after the nuclear consonant. 
63
 
# It functions when the syllable doesn’t have any vowels. And it always exists with X8.
64
 
$X6 = [\u0EA7\u0EAD\u0EBD];
65
 
# X7 represents a final vowel. 
66
 
# However X7_1 always represents the end of syllable and it never exists with tone mark.
67
 
$X7 = [\u0EB0\u0EB2\u0EB3];
68
 
# X8 represents an alternate consonant.
69
 
$X8 = [\u0E81\u0E87\u0E8D\u0E94\u0E99\u0EA1\u0E9A\u0EA7];
70
 
# X9 represents alternate consonants to pronounce foreign terms, it always exist with X10_3.
71
 
$X9 = [\u0E88\u0EAA\u0E8A\u0E9E\u0E9F\u0EA5];
72
 
# X10 represents a sign mark. 
73
 
# It always occurs at the end of a syllable, but mostly people keep it separate from syllable.
74
 
$X10 = [\u0EAF\u0EC6\u0ECC];
75
 
 
76
 
# Section 1
77
 
$X0_1 = [\u0EC0];
78
 
$X4_1_2 = [\u0EB4\u0EB5];
79
 
$X4_3_4 = [\u0EB6\u0EB7];
80
 
$X4_6 = [\u0EBB];
81
 
$X4_7 = [\u0EB1];
82
 
$X6_2 = [\u0EAD];
83
 
$X6_3 = [\u0EBD];
84
 
$X7_1 = [\u0EB0];
85
 
$X7_2 = [\u0EB2];
86
 
$X10_1 = [\u0EAF];
87
 
$X10_2 = [\u0EC6];
88
 
$X10_3 = [\u0ECC];
89
 
 
90
 
$Rule1_1 = $X0_1 ($X1)? $X ($X2)? ($X5)? ($X8)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
91
 
$Rule1_2 = $X0_1 ($X1)? $X ($X2)? $X4_1_2 ($X5)? ($X8)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
92
 
$Rule1_3 = $X0_1 ($X1)? $X ($X2)? $X4_3_4 ($X5)? $X6_2 ($X8)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
93
 
$Rule1_4 = $X0_1 ($X1)? $X ($X2)? ($X7_2)? $X7_1;
94
 
$Rule1_5 = $X0_1 ($X1)? $X ($X2)? $X4_6 ($X5)? $X7_2 ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
95
 
$Rule1_6 = $X0_1 ($X1)? $X ($X2)? $X4_7 ($X5)? $X8 ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
96
 
$Rule1_7 = $X0_1 ($X1)? $X ($X2)? ($X4_7)? ($X5)? $X6_3 ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
97
 
 
98
 
$Rule1 = ($Rule1_1 | $Rule1_2 | $Rule1_3 | $Rule1_4 | $Rule1_5 | $Rule1_6 | $Rule1_7);
99
 
 
100
 
# Section 2
101
 
$X0_2 = [\u0EC1];
102
 
 
103
 
$Rule2_1 = $X0_2 ($X1)? $X ($X2)? ($X5)? ($X6)? ($X8)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
104
 
$Rule2_2 = $X0_2 ($X1)? $X ($X2)? $X7_1;
105
 
$Rule2_3 = $X0_2 ($X1)? $X ($X2)? $X4_7 ($X5)? $X8 ($X9 $X10_3)? ($X10_2)? ($X10_1)?; 
106
 
 
107
 
$Rule2 = ($Rule2_1 | $Rule2_2 | $Rule2_3);
108
 
 
109
 
# Section 3
110
 
$X0_3 = [\u0EC2];
111
 
$X8_3 = [\u0E8D];
112
 
$X8_8 = [\u0EA7];
113
 
 
114
 
$Rule3_1 = $X0_3 ($X1)? $X ($X2)? ($X5)? ($X8)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
115
 
$Rule3_2 = $X0_3 ($X1)? $X ($X2)? $X7_1;
116
 
$Rule3_3 = $X0_3 ($X1)? $X ($X2)? $X4_7 ($X5)? ($X8_3 | $X8_8);
117
 
 
118
 
$Rule3 = ($Rule3_1 | $Rule3_2 | $Rule3_3);
119
 
 
120
 
# Section 4
121
 
$X0_4 = [\u0EC4];
122
 
$X6_1 = [\u0EA7];
123
 
 
124
 
$Rule4 = $X0_4 ($X1)? $X ($X2)? ($X5)? ($X6_1)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
125
 
 
126
 
# Section 5
127
 
$X0_5 = [\u0EC3];
128
 
 
129
 
$Rule5 = $X0_5 ($X1)? $X ($X2)? ($X5)? ($X6_1)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
130
 
 
131
 
# Section 6
132
 
$Rule6 = ($X1)? $X ($X2)? $X3 ($X5)? ($X8)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
133
 
 
134
 
# Section 7
135
 
$X4_1_4 = [\u0EB4-\u0EB7];
136
 
 
137
 
$Rule7 = ($X1)? $X ($X2)? $X4_1_4 ($X5)? ($X8)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
138
 
 
139
 
# Section 8
140
 
$X4_5 = [\u0ECD];
141
 
 
142
 
$Rule8 = ($X1)? $X ($X2)? $X4_5 ($X5)? ($X7_2)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
143
 
 
144
 
# Section 9
145
 
 
146
 
$Rule9_1 = ($X1)? $X ($X2)? $X4_6 ($X5)? $X8 ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
147
 
$Rule9_2 = ($X1)? $X ($X2)? $X4_6 ($X5)? $X6_1 $X7_1;
148
 
 
149
 
$Rule9 = ($Rule9_1 | $Rule9_2);
150
 
 
151
 
# Section 10
152
 
$Rule10 = ($X1)? $X ($X2)? $X4_7 ($X5)? ($X6_1)? $X8 ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
153
 
 
154
 
# Section 11
155
 
$Rule11 = ($X1)? $X ($X2)? ($X5)? $X6 $X8 ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
156
 
 
157
 
# Section 12
158
 
$Rule12 = ($X1)? $X ($X2)? ($X5)? $X7_1;
159
 
 
160
 
# Section 13
161
 
$Rule13 = ($X1)? $X ($X2)? ($X5)? $X7_2 ($X8)? ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
162
 
 
163
 
# Section 14
164
 
$X7_3 = [\u0EB3];
165
 
 
166
 
$Rule14 = ($X1)? $X ($X2)? ($X5)? $X7_3 ($X9 $X10_3)? ($X10_2)? ($X10_1)?;
167
 
 
168
 
$LaoSyllableEx = ($Rule1 | $Rule2 | $Rule3 | $Rule4 | $Rule5 | $Rule6 | $Rule7 | $Rule8 | $Rule9 | $Rule10 | $Rule11 | $Rule12 | $Rule13 | $Rule14);
169
 
 
170
 
$WordJoin = [:Line_Break=Word_Joiner:];
171
 
 
172
 
$LaoJoinedSyllableEx = $LaoSyllableEx ($WordJoin $LaoSyllableEx)*;
173
 
 
174
 
#
175
 
# default numerical definitions
176
 
#
177
 
$Extend       = [\p{Word_Break = Extend}];
178
 
$Format       = [\p{Word_Break = Format}];
179
 
$MidNumLet    = [\p{Word_Break = MidNumLet}];
180
 
$MidNum       = [\p{Word_Break = MidNum}];
181
 
$Numeric      = [\p{Word_Break = Numeric}];
182
 
$ExtendNumLet = [\p{Word_Break = ExtendNumLet}];                                                          
183
 
$MidNumLetEx    = $MidNumLet    ($Extend |  $Format)*;
184
 
$MidNumEx       = $MidNum       ($Extend |  $Format)*;
185
 
$NumericEx      = $Numeric      ($Extend |  $Format)*;
186
 
$ExtendNumLetEx = $ExtendNumLet ($Extend |  $Format)*;
187
 
 
188
 
!!forward;
189
 
 
190
 
$LaoJoinedSyllableEx {200};
191
 
# default numeric rules
192
 
$NumericEx $ExtendNumLetEx? (($MidNumEx | $MidNumLetEx)? $NumericEx $ExtendNumLetEx?)*  {100};