forked from apertium/apertium-tyv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apertium-tyv.tyv.rlx
345 lines (214 loc) · 7.48 KB
/
apertium-tyv.tyv.rlx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
###############################################################################
DELIMITERS = "<.>" "<!>" "<?>" "<..>" "<...>" "<¶>" ;
SOFT-DELIMITERS = "<,>" ;
OPTIONS += no-inline-sets no-inline-templates ;
SUBREADINGS = LTR ; # Alternate, left-to-right (main reading on the left)
###############################################################################
SETS
LIST BOS = (>>>) ;
LIST EOS = (<<<) ;
LIST V = v ;
LIST A = adj ;
LIST N = n ;
LIST Prop = np ;
LIST Adv = adv ;
LIST Det = det ;
LIST Num = num ;
LIST Pron = prn ;
LIST Post = post ;
LIST Cop = cop ;
LIST Mod = mod ;
LIST Abbr = abbr ;
LIST Aux = vaux ;
LIST Qst = qst ;
LIST Subst = subst ;
LIST Attr = attr ;
LIST Coop = coop ;
LIST Acc = acc ;
LIST Gen = gen ;
LIST Nom = nom ;
LIST Loc = loc ;
LIST Dat = dat ;
LIST Abl = abl ;
LIST All = all ;
LIST Px1Sg = px1sg ;
LIST Px2Sg = px2sg ;
LIST Px3Sp = px3sp ;
LIST Px1Pl = px1pl ;
LIST Px2Pl = px1pl ;
LIST Px3Pl = px3pl ;
LIST TV = tv ;
LIST IV = iv ;
LIST Ger/Aor = ger_aor ;
LIST Ger/Past = ger_past ;
LIST Gpr/Aor = gpr_aor ;
LIST Gpr/Past = gpr_past ;
LIST Gna/Past = gna_past ;
LIST Prc/Aor = prc_aor ;
LIST Prc/Impf = prc_impf ;
LIST Prc/Perf = prc_perf ;
LIST Past = past ;
LIST Aor = aor ;
LIST Imper = imp ;
LIST Ant = ant ;
LIST Cog = cog ;
LIST Pat = pat ;
LIST CC = cnjcoo ;
LIST Guio = "-" ;
LIST Cm = "," ;
LIST Ques = "?" ;
LIST Sent = "." ".." "..." ;
LIST Elip = "..." ;
LIST Excl = "!" ;
LIST Quot = lquot rquot quot ;
LIST Title/Word = ("<[А-ЯҢӨҮA-Z][а-яңөүa-z]+>"r) ;
LIST Maj/Word = ("<[А-ЯҢӨҮA-Z]+>"r) ;
LIST Min/Word = ("<[а-яңөүa-z]+>"r) ;
LIST Title/Dict = ("[А-ЯҢӨҮA-Z][а-яңөүa-z]+"r) ;
LIST Maj/Dict = ("[А-ЯҢӨҮA-Z]+"r) ;
LIST Min/Dict = ("[а-яңөүa-z]+"r) ;
LIST Year = "чыл" "ч." ;
LIST Month = "ай" ;
LIST Months = "январь" "февраль" "март" "апрел" "май" "июнь" "июль" "август" "сентябрь" "октябрь" "ноябрь" "декябр" ;
LIST Measure = "кг" "мм" ;
LIST Bol = ("бол" v iv) ;
LIST Bar = ("бар" adj) ;
LIST Beer = "бээр" ;
###############################################################################
SET Gpr = Gpr/Aor | Gpr/Past ;
SET Prc = Prc/Aor | Prc/Perf | Prc/Impf ;
SET Gna = Gna/Past ;
SET Ger = Ger/Aor | Ger/Past ;
SET Fin = Past | Aor | Imper ;
SET Local = Loc | Dat | Abl | All ;
SET Poss = Px1Sg | Px2Sg | Px3Sp | Px1Pl | Px2Pl | Px3Pl ;
SET Nominal = Pron | Subst | N | Prop ;
SET Modifier = A - Subst | Det | Num - Subst | Gpr | Gen ;
SET Punct = Guio | Cm | Sent | Ques | Elip | Excl | Quot ;
SET Name = Ant | Cog | Pat ;
SET Copula = Cop | Bol ;
SET ABL-POST = Beer ;
###############################################################################
SECTION
REMOVE Gpr IF (1 EOS) ;
## Ол сеңээ бүзүрээр.
SELECT Aux IF (-1C Prc);
REMOVE Aux IF (NOT -1 Prc) ;
## Ол кижи биске бо номну берген.
SELECT Qst IF (1 Ques) ;
## Олар ол кино көргени ол бе?
REMOVE Attr IF (1C* Fin BARRIER (*) - Prc) ;
REMOVE Attr IF (1C Post) ;
REMOVE Prc (NOT 1 Prc OR Aux) ;
REMOVE Attr IF (1C Poss) (NOT -1 Gen) ;
REMOVE Attr IF (1 EOS) ;
REMOVE Attr IF (1C Det) ;
REMOVE Attr IF (1 Prc OR Cop) ;
## Картофельде соланин деп ногаанзымаар өңнүг, хоранныг бүдүмел бар.
REMOVE Attr IF (1 Cm) ;
##REMOVE Poss IF (-1 Cm) ;
## ## Оон аңгыда, кижини ооң хамааржып турары күрүнениң азы девискээрниң политиктиг, хоойлу-дүрүм ...
## This is a terrible rule -JNW
REMOVE Poss IF (-1 Local) ;
REMOVE Fin IF (0 Fin OR Subst) (1C Local + Poss) ;
## Ол ышкаш үүлгедигниң болган үезинде берип болур турган кеземчеден аар кеземче бээри болдунмас.
REMOVE Imper IF (1 Cm) ;
## Олар бадыланышканынга хамаарыштыр, бадылалдыг турган үезинде база ону күш чок деп санаан үезинде дең эргелерни ажыглаар.
REMOVE Poss IF (-1 BOS) ;
REMOVE SUB:* Qst IF (1 Punct) (NOT 1 Ques) ;
## 30 чүүл.
SELECT Title/Dict IF (NOT -1 BOS) (0 Title/Word) ;
## Абакан биле Кызылдың аразы.
REMOVE SUB:* Cop IF (NOT 1 EOS) ;
REMOVE Imper IF (NOT 1* Excl) ;
SELECT Attr IF (0C Nom OR Attr) (1 Guio LINK 1 N) ;
##
SELECT SUB:* Cop IF (1 EOS) (NOT 0 Fin) (NOT -1* Fin) ;
## Азамат биле Айгуль садта.
REMOVE Num + Subst IF (1C N + Nom) ;
SELECT Attr IF (0C Ant OR Pat) (1C Cog) ;
SELECT Attr IF (0C Ant) (1C Pat OR Cog) ;
SELECT Cog IF (-1C Abbr) (0 Cog OR Ant) ;
SELECT Attr IF (0 Months) (1 Month) ;
SELECT Fin IF (0 Aux) (-1C Prc) (1 EOS) ;
REMOVE Subst IF (0 Bar) (1 EOS) ;
SELECT CC IF (0 CC OR Gna) (NOT 1 Cm OR V) ;
REMOVE Prc IF (0 CC OR Prc) (1 Nominal) ;
# биле
SELECT Post IF (0C Beer) (-1 Abl) ;
SELECT Abl IF (1 ABL-POST) ;
###############################################################################
SECTION
REMOVE Coop IF (0C Coop OR V - Coop) ;
###############################################################################
#SECTION
#LIST @csubj = @csubj ;
#LIST @cmpnd = @cmpnd ;
#LIST @amod = @amod ;
#LIST @advmod = @advmod ;
#LIST @det = @det ;
#LIST @acl = @acl ;
#LIST @acl:relcl = @acl:relcl ;
#LIST @obj = @obj ;
#LIST @case = @case ;
#LIST @punct = @punct ;
#LIST @conj = @conj ;
#LIST @cc = @cc ;
#LIST @root = @root ;
#LIST @aux = @aux ;
#LIST @cop = @cop ;
#LIST @disc = @disc ;
#LIST @nmod = @nmod ;
#LIST @nmod:poss = @nmod:poss ;
#LIST @nummod = @nummmod ;
#LIST @name = @name ;
#LIST @ccomp = @ccomp ;
#LIST @advcl = @advcl ;
#LIST @nsubj = @nsubj ;
#MAP @cc TARGET CC ;
#MAP @cmpnd TARGET Attr - Name ;
#MAP @amod TARGET A - Subst (NOT 0/* Cop) ;
#MAP @det TARGET Det ;
#MAP (@obj @nsubj) TARGET Acc ;
#MAP @nmod:poss TARGET Nominal + Gen - Subst ;
#MAP @nmod TARGET Nominal + Local - Subst ;
#MAP @case TARGET Post ;
#MAP @punct TARGET Punct ;
#MAP @root TARGET Fin IF (NOT 0 Aux OR Copula) ;
#MAP @root TARGET Bar IF (1 EOS) (0/* Cop) ;
#MAP @advmod TARGET Adv ;
#MAP @aux TARGET Aux + Fin;
#MAP @root TARGET Prc IF (1C Fin + @aux) (NOT 0 Aux) ;
#MAP @cop TARGET Copula ;
#MAP SUB:* @cop TARGET Cop ;
#MAP @disc TARGET Mod OR Qst ;
#MAP SUB:* @disc TARGET Mod OR Qst ;
#MAP @nummod TARGET Num - Subst (NOT 1 Year) ;
#MAP @amod TARGET Num - Subst (1 Year) ;
#MAP @name TARGET Name + Attr ;
#MAP (@nsubj @obj @nmod:poss @nmod) TARGET Nominal + Nom ;
#MAP @acl:relcl TARGET Gpr - Aux ;
#MAP @aux TARGET Aux ;
#MAP (@advcl @ccomp) TARGET Ger + Dat ;
#MAP @name TARGET Abbr (1C* Cog BARRIER (*) - Abbr) ;
#MAP @advcl TARGET Ger + Local - Cop ;
#MAP @ccomp TARGET Ger + Acc - Cop ;
#MAP @acl TARGET Ger + Gen - Cop ;
#MAP (@csubj @acl) TARGET Ger + Nom - Cop ;
################################################################################
#SECTION
#SELECT @root IF (0 @root) (1 EOS) ;
#REMOVE @nummod IF (1C Fin) ;
#SELECT @amod IF (0 A - Subst) (1 A OR N) ;
#REMOVE @nsubj IF (1C @case) ;
#REMOVE @obj IF (1C @case) ;
#SELECT @amod IF (0C Num) (1 Year + Local) ;
#SELECT @nummod IF (0C Num) (1 Measure) ;
#REMOVE @cmpnd IF (1 Cm) ;
#SELECT @nmod:poss IF (1C Poss) ;
#REMOVE @nsubj IF (0C Acc) (NOT 1* V - @root) ;
#REMOVE @cmpnd IF (1 @root) ;
#REMOVE @nmod:poss IF (1 @case) ;
#REMOVE @nmod:poss IF (NOT 1* Poss) ;
#REMOVE @name IF (1C N) ;
#REMOVE @obj IF (NOT 1* TV) ;