LCGlexicon2.ml
34.9 KB
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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
type cats =
Inumber | Igender | Iperson | Nperson | Plemma | Ctype | Number | Case | Gender | Person |
Nsyn | Nsem | Unumber | Ucase | Ugender | Uperson | Rec | Congr | Postp | Adjsyn | Grad |
Pos | Aspect | Negation | Mood | Tense | Sub | Coord | Lemma | Acm | Int | Rel
(* FIXME: "Można było" - brakuje uzgodnienia rodzaju przymiotnika w przypadku predykatywnym, i ogólnie kontroli składniowej *)
(* x="s" oznacza, że żeby reguła została użyta token musi mieć "s" jako jedną z wartości atrybutu x, reguła zostanie wykonana dla x z usuniętymi pozostałymi wartościami *)
(* x!="s" oznacza, że żeby reguła została użyta token musi mieć jako jedną z wartości atrybutu x symbol inny od "s", reguła zostanie wykonana dla x z usuniętą wartością "s" *)
(* x=="s" oznacza, że żeby reguła została użyta token musi mieć "s" jako jednyną z wartość atrybutu x *)
let symbol_weight = 1.
let measure_weight = 0.5
let grammar = [
(* symbole występujące w tekście - daty itp. i słowa określające ich typy *)
"lemma=dzień,pos=subst,number=sg,case=gen",
[Number,"sg";Case,"gen";Gender,"genders";Person,"ter"],
"day-lex/(date+day+day-month)",
symbol_weight, [Number; Case; Gender; Person];
"lemma=dzień,pos=subst,number=sg",
[Number,"sg";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person/(date+day+day-month)",
symbol_weight, [Number; Case; Gender; Person];
"lemma=dzień,pos=subst,number=pl",
[Number,"pl";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person/(date-interval+day-interval+day-month-interval)",
symbol_weight, [Number; Case; Gender; Person];
"pos=date",[],
"date{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=date-interval",[],
"date-interval{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=day",[],
"day/month-lex",
symbol_weight, [Nsyn; Nsem];
"pos=day-interval",[],
"day-interval/month-lex",
symbol_weight, [Nsyn; Nsem];
"pos=day-month",[],
"day-month{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=day-month-interval",[],
"day-month-interval{schema}",
symbol_weight, [Nsyn; Nsem];
"lemma=styczeń|luty|marzec|kwiecień|maj|czerwiec|lipiec|sierpień|wrzesień|październik|litopad|grudzień,pos=subst,number=sg,case=gen",
[Number,"sg";Case,"gen";Gender,"genders";Person,"ter"],
"month-lex/(Null+year+NP(gen))",
symbol_weight, [Number; Case; Gender; Person];
"lemma=styczeń|luty|marzec|kwiecień|maj|czerwiec|lipiec|sierpień|wrzesień|październik|litopad|grudzień,pos=subst,number=sg",
[Number,"sg";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person/year",
symbol_weight, [Number; Case; Gender; Person];
"pos=month-interval",[],
"month-interval{schema}",
symbol_weight, [Nsyn; Nsem];
"lemma=rok,pos=subst,number=sg",
[Number,"sg";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person|year",
symbol_weight, [Number; Case; Gender; Person];
"lemma=rok,pos=subst,number=pl",
[Number,"pl";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person/year-interval",
symbol_weight, [Number; Case; Gender; Person];
"pos=year",[],
"year{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=year-interval",[],
"year-interval{schema}",
symbol_weight, [Nsyn; Nsem];
"lemma=wiek,pos=subst,number=sg",
[Number,"sg";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person|roman",
symbol_weight, [Number; Case; Gender; Person];
"lemma=wiek,pos=subst,number=pl",
[Number,"pl";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person/roman-interval",
symbol_weight, [Number; Case; Gender; Person];
"pos=roman",[],
"roman{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=roman-interval",[],
"roman-interval{schema}",
symbol_weight, [Nsyn; Nsem];
"lemma=godzina,pos=subst,number=sg",
[Number,"sg";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person/(hour+hour-minute)",
symbol_weight, [Number; Case; Gender; Person];
"lemma=godzina,pos=subst,number=pl",
[Number,"pl";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person/(hour-interval+hour-minute-interval)",
symbol_weight, [Number; Case; Gender; Person];
"pos=hour-minute",[],
"hour-minute{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=hour",[],
"hour{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=hour-minute-interval",[],
"hour-minute-interval{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=hour-interval",[],
"hour-interval{schema}",
symbol_weight, [Nsyn; Nsem];
"lemma=rysunek,pos=subst,number=sg", (* objids *)
[Number,"sg";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person/obj-id",
symbol_weight, [Number; Case; Gender; Person];
"pos=obj-id",[],
"obj-id{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=match-result",[],
"match-result{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=url",[],
"url{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=email",[],
"email{schema}",
symbol_weight, [Nsyn; Nsem];
"pos=symbol",
[Number,"sg";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person{schema}{qub_inclusion}",
0., [Nsyn; Nsem; Number; Case; Gender; Person];
(* frazy rzeczownikowe *)
"pos=subst|depr,check_frame_number2,case!=voc,nsem!=measure",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person{num_congr}{schema}{qub_inclusion}",
0., [Nsyn; Nsem; Number; Case; Gender; Person];
"pos=subst|depr,check_frame_number2,case=voc,nsem!=measure",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"sec"],
"np*number*case*gender*person{num_congr}{schema}{qub_inclusion}",
0., [Nsyn; Nsem; Number; Case; Gender; Person];
"pos=subst,check_frame_number2,case=gen,nsem!=measure",
[Number,"numbers";Case,"all_cases";Gender,"genders";Person,"ter"],
"np*sg*case*n2*person{num_rec}{schema}{qub_inclusion}", (* UWAGA: number "sg" i gender "n2", żeby uzgadniać z podmiotem czasownika *)
0., [Nsyn; Nsem; Number; Case; Gender; Person];
"pos=subst,check_frame_number2,case=gen,nsem!=measure",
[Unumber,"all_numbers";Ucase,"all_cases";Ugender,"all_genders"; Uperson,"all_persons";Number,"numbers";Case,"all_cases";Gender,"genders";Person,"ter"],
"np*unumber*ucase*ugender*uperson{noun_measure}{schema}{qub_inclusion}",
0., [Nsyn; Nsem; Number; Case; Gender; Person];
"pos=ppron12",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"persons"],
"np*number*case*gender*person{schema}{qub_inclusion}",
0., [Number; Case; Gender; Person];
"pos=ppron3,praep=npraep",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"persons"],
"np*number*case*gender*person{schema}{qub_inclusion}",
0., [Number; Case; Gender; Person];
"pos=siebie",
[Number,"all_numbers";Case,"cases";Gender,"all_genders";Person,"ter"],
"np*number*case*gender*person{schema}{qub_inclusion}",
0., [Number; Case; Gender; Person];
"lemma=jakiś|ten|taki,pos=adj",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"np*number*case*gender*person{schema}{qub_inclusion}",
0., [Number; Case; Gender; Person];
(* liczebniki *) (* FIXME trzeba dodać akomodacyjność dla intnum *)
(* FIXME: liczba po rzeczowniku *) (* FIXME: zbadać jak liczebniki współdziałąją z jako COMPAR *)
"pos=num,acm=rec",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"persons"],
"num*number*case*gender*person*rec{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [Rec; Number; Case; Gender; Person];
"pos=num,acm=congr",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"persons"],
"num*number*case*gender*person*congr{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [Congr; Number; Case; Gender; Person];
"lemma=1|-1,pos=intnum", (* FIXME: ustawić atrybut acm dla intnum *)
[Number,"sg";Case,"all_cases";Gender,"all_genders";Person,"ter"],
"num*number*case*gender*person*congr{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [];
"lemma!=1,lemma!=-1,pos=intnum",
[Number,"pl";Case,"all_cases";Gender,"all_genders";Person,"ter"],
"num*number*case*gender*person*rec{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [];
"lemma!=1,lemma!=-1,lemma=*2|*3|*4,pos=intnum",
[Number,"pl";Case,"all_cases";Gender,"all_genders";Person,"ter"],
"num*number*case*gender*person*congr{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [];
"pos=realnum",
[Number,"sg";Case,"all_cases";Gender,"all_genders";Person,"ter"],
"num*number*case*gender*person*rec{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [];
"pos=intnum-interval",
[Number,"pl";Case,"all_cases";Gender,"all_genders";Person,"ter"],
"num*number*case*gender*person*congr{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [];
"pos=intnum-interval",
[Number,"pl";Case,"all_cases";Gender,"all_genders";Person,"ter"],
"num*number*case*gender*person*rec{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [];
"pos=realnum-interval",
[Number,"sg";Case,"all_cases";Gender,"all_genders";Person,"ter"],
"num*number*case*gender*person*rec{qub_inclusion}", (* FIXME: jak usunięcie Phrase ProNG wpływa na pokrycie? *)
0., [];
(* pojemniki *)
"pos=subst,check_frame_number2,case!=voc,nsem=measure",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"measure*number*case*gender*person{num_congr}{schema}{qub_inclusion}",
measure_weight, [Nsyn; Nsem; Number; Case; Gender; Person];
"pos=subst,check_frame_number2,case=voc,nsem=measure",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"sec"],
"measure*number*case*gender*person{num_congr}{schema}{qub_inclusion}",
measure_weight, [Nsyn; Nsem; Number; Case; Gender; Person];
"pos=subst,check_frame_number2,case=gen,nsem=measure",
[Number,"numbers";Case,"all_cases";Gender,"genders";Person,"ter"],
"measure*sg*case*n2*person{num_rec}{schema}{qub_inclusion}", (* UWAGA: number "sg" i gender "n2", żeby uzgadniać z podmiotem czasownika *)
measure_weight, [Nsyn; Nsem; Number; Case; Gender; Person];
(* frazy przyimkowe *)
"lemma!={jak|jako|niż|niczym|niby|co},pos=prep", (* FIXME: trzeba wprowadzić pos=compar w morfologii *)
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/np*T*case*T*T}{qub_inclusion}",
0., [Case];
"lemma!={jak|jako|niż|niczym|niby|co},pos=prep",
[Case,"cases"],
"prepadjp*lemma*case{\\(1+advp),/adjp*T*case*T}{qub_inclusion}",
0., [Case];
"lemma=po,pos=prep",[], (* po polsku, po kreciemu *)
"prepadjp*lemma*postp{\\(1+advp),/(adjp*sg*dat*m1+adjp*T*postp*T)}{qub_inclusion}",
0., [Postp];
"lemma=z,pos=prep",[], (* z bliska *)
"prepadjp*lemma*postp{\\(1+advp),/adjp*sg*nom*f}{qub_inclusion}",
0., [Postp];
"lemma=na,pos=prep",[], (* na lewo *)
"prepadjp*lemma*postp{\\(1+advp),/advp}{qub_inclusion}",
0., [Postp];
(* przimkowe określenia czasu *)
"lemma=z,pos=prep,case=gen",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(day-month+day+year+date+hour+hour-minute)}{qub_inclusion}",
0., [Case];
"lemma=do,pos=prep,case=gen",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(day-month+day+year+date+hour+hour-minute)}{qub_inclusion}",
0., [Case];
"lemma=na,pos=prep,case=acc",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(day-month+day+date+hour+hour-minute)}{qub_inclusion}",
0., [Case];
"lemma=o,pos=prep,case=loc",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(hour+hour-minute)}{qub_inclusion}",
0., [Case];
"lemma=od,pos=prep,case=gen",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(day-month+day+year+date+hour+hour-minute)}{qub_inclusion}",
0., [Case];
"lemma=około,pos=prep,case=gen",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(day-month+day+year+date+hour+hour-minute)}{qub_inclusion}",
0., [Case];
"lemma=po,pos=prep,case=loc",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(day-month+day+year+date+hour+hour-minute)}{qub_inclusion}",
0., [Case];
"lemma=przed,pos=prep,case=inst",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(day-month+day+year+date+hour+hour-minute)}{qub_inclusion}",
0., [Case];
"lemma=w,pos=prep,case=loc",
[Case,"cases"],
"prepnp*lemma*case{\\(1+advp),/(day-month+day+year+date+hour+hour-minute)}{qub_inclusion}",
0., [Case];
(* komparatywy *) (* FIXME: trzeba poprawić comparnp i comparpp w walencji *)
"lemma=jak|jako|niż|niczym|niby|co,pos=prep",
[Case,"nom,gen,dat,acc,inst"],
"compar*lemma*case{\\(1+advp),/np*T*case*T*T}{qub_inclusion}",
0., [Case];
"lemma=jak|jako|niż|niczym|niby|co,pos=prep",
[],
"compar*lemma*postp{\\(1+advp),/(prepnp*T*T+prepadjp*T*T)}{qub_inclusion}",
0., [Case];
(* frazy przymiotnikowe *)
(* FIXME: let grad = match grads with [grad] -> grad | _ -> failwith "make_adjp: grad" in*)
"lemma!={czyj|jaki|który},pos=adj,check_frame_case,adjsyn!=pronoun",
[Number,"numbers";Case,"cases";Gender,"genders"],
"adjp*number*case*gender{schema}{qub_inclusion}{\\(1+adja)}",
0., [Adjsyn; Grad; Number; Case; Gender];
"lemma!={czyj|jaki|który},pos=adj,check_frame_case,adjsyn=pronoun",
[Number,"numbers";Case,"cases";Gender,"genders"],
"adjp*number*case*gender{schema}{qub_inclusion}",
0., [Adjsyn; Grad; Number; Case; Gender];
"pos=adjc",
[Number,"sg";Case,"pred";Gender,"m1&m2&m3"],
"adjp*number*case*gender{schema}{qub_inclusion}{\\(1+adja)}",
0., [Adjsyn; Pos; Number; Case; Gender];
"pos=adjp",
[Number,"all_numbers";Case,"postp";Gender,"all_genders"],
"adjp*number*case*gender{schema}{qub_inclusion}{\\(1+adja)}",
0., [Adjsyn; Pos; Number; Case; Gender];
"pos=ordnum",
[Number,"all_numbers";Case,"all_cases";Gender,"all_genders"],
"adjp*number*case*gender{schema}{qub_inclusion}{\\(1+adja)}",
0., [Adjsyn; Pos; Number; Case; Gender];
"pos=roman",
[Number,"all_numbers";Case,"all_cases";Gender,"all_genders"],
"adjp*number*case*gender{schema}{qub_inclusion}{\\(1+adja)}",
0., [Adjsyn; Pos; Number; Case; Gender];
"pos=adja|intnum|realnum|intnum-interval|realnum-interval|roman|roman-interval",[],
"adja/hyphen",
0., [];
(* przysłówki *)
(* FIXME let grad = match grads with [grad] -> grad | _ -> failwith "make_advp: grad" in*)
"pos=adv",[],
"advp{schema}{qub_inclusion}{\\(1+adja)}",
0., [Grad];
(* relatory *)
(* FIXME: dwa znaczenia jak: pytanie o cechę lub spójnik *)
"lemma=jak|skąd|dokąd|gdzie|którędy|kiedy,pos=adv",
[Inumber,"";Igender,"";Iperson,"";Ctype,"int&rel"],
"cp*ctype*lemma{\\(1+advp),/(ip*inumber*igender*iperson/advp)}",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
"lemma=odkąd|dlaczego|czemu,pos=adv",
[Inumber,"";Igender,"";Iperson,"";Ctype,"int"],
"cp*ctype*lemma{\\(1+advp),/(ip*inumber*igender*iperson/advp)}",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
"lemma=gdy,pos=adv",
[Inumber,"";Igender,"";Iperson,"";Ctype,"sub"],
"cp*ctype*lemma{\\(1+advp),/(ip*inumber*igender*iperson/advp)}",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
(* czasowniki *)
"pos=ger",
[Number,"numbers";Case,"cases";Gender,"genders";Person,"persons";Aspect,"aspects"],
"np*number*case*gender*person{schema}{qub_inclusion}",
0., [Negation; Aspect; Number; Case; Gender; Person];
"pos=pact",
[Number,"numbers";Case,"cases";Gender,"genders";Aspect,"aspects"],
"adjp*number*case*gender{schema}{qub_inclusion}",
0., [Negation; Aspect; Number; Case; Gender];(* FIXME: new_lemma *)
"pos=ppas",
[Number,"numbers";Case,"cases";Gender,"genders";Aspect,"aspects"],
"adjp*number*case*gender{schema}{qub_inclusion}",
0., [Negation; Aspect; Number; Case; Gender];(* FIXME: new_lemma *)
"pos=fin|bedzie,negation=aff,mood=indicative",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=fin|bedzie,negation=neg,mood=indicative",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=fin,negation=aff,mood=imperative",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aux-imp}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=fin,negation=neg,mood=imperative",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aux-imp}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=impt|imps,negation=aff",
[Number,"numbers";Gender,"all_genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=impt|imps,negation=neg",
[Number,"numbers";Gender,"all_genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=pred,negation=aff,tense=pres",
[Number,"numbers";Gender,"numbers";Person,"persons";Aspect,"imperf"],
"ip*number*gender*person{/(1+int)}{schema}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=pred,negation=neg,tense=pres",
[Number,"numbers";Gender,"numbers";Person,"persons";Aspect,"imperf"],
"ip*number*gender*person{/(1+int)}{schema}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=pred,negation=aff,tense=fut",
[Number,"numbers";Gender,"numbers";Person,"persons";Aspect,"imperf"],
"ip*number*gender*person{/(1+int)}{schema,|aux-fut*number*gender*person}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=pred,negation=neg,tense=fut",
[Number,"numbers";Gender,"numbers";Person,"persons";Aspect,"imperf"],
"ip*number*gender*person{/(1+int)}{schema,|aux-fut*number*gender*person}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=pred,negation=aff,tense=past",
[Number,"numbers";Gender,"numbers";Person,"persons";Aspect,"imperf"],
"ip*number*gender*person{/(1+int)}{schema,|aux-past*number*gender*person}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *) (* FIXME: tense *)
"pos=pred,negation=neg,tense=past",
[Number,"numbers";Gender,"numbers";Person,"persons";Aspect,"imperf"],
"ip*number*gender*person{/(1+int)}{schema,|aux-past*number*gender*person}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *) (* FIXME: tense *)
"pos=praet|winien,person=ter,negation=aff,mood=indicative",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=praet|winien,person=ter,negation=neg,mood=indicative",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=praet|winien,person!=ter,negation=aff,mood=indicative",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aglt*number*person}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=praet|winien,person!=ter,negation=neg,mood=indicative",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aglt*number*person}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=praet|winien,person=ter,negation=aff,mood=conditional",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|by}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=praet|winien,person=ter,negation=neg,mood=conditional",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|by}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=praet|winien,person!=ter,negation=aff,mood=conditional",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aglt*number*person,|by},|by{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=praet|winien,person!=ter,negation=neg,mood=conditional",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aglt*number*person,|by}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=praet|winien,negation=aff,tense=fut",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aux-fut*number*gender*person}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=winien,person=ter,negation=aff,tense=past",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aux-past*number*gender*person}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=winien,person=ter,negation=neg,tense=past",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aux-past*number*gender*person}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=winien,person!=ter,negation=aff,tense=past",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aglt*number*person,|aux-past*number*gender*person}{qub_inclusion}",
0., [Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=winien,person!=ter,negation=neg,tense=past",
[Number,"numbers";Gender,"genders";Person,"persons";Aspect,"aspects"],
"ip*number*gender*person{/(1+int)}{schema,|aglt*number*person,|aux-past*number*gender*person}{qub_inclusion}{\\nie}",
0., [Negation; Mood; Tense; Aspect; Number; Case; Gender; Person];(* FIXME: new_lemma *)
"pos=bedzie",
[Number,"numbers";Gender,"genders";Person,"persons"],
"aux-fut*number*gender*person",
0., [];
"lemma=być,pos=praet",
[Number,"numbers";Gender,"genders";Person,"persons"],
"aux-past*number*gender*person",
0., [];
"pos=aglt",
[Number,"numbers";Person,"persons"],
"aglt*number*person",
0., [];
"pos=inf,negation=aff",
[Aspect,"aspects"],
"infp{schema}{qub_inclusion}",
0., [Aspect];
"pos=inf,negation=neg",
[Aspect,"aspects"],
"infp{schema}{qub_inclusion}{\\nie}",
0., [Negation; Aspect];
"pos=pcon,negation=aff",
[Aspect,"aspects"],
"padvp{schema}{qub_inclusion}",
0., [Aspect];
"pos=pcon,negation=neg",
[Aspect,"aspects"],
"padvp{schema}{qub_inclusion}{\\nie}",
0., [Negation; Aspect];
"pos=pant,negation=aff",
[Aspect,"aspects"],
"padvp{schema}{qub_inclusion}",
0., [Aspect];
"pos=pant,negation=neg",
[Aspect,"aspects"],
"padvp{schema}{qub_inclusion}{\\nie}",
0., [Negation; Aspect];
"pos=comp",[],
"cp*sub*lemma/ip*T*T*T",
0., [Sub];
"pos=conj",[],
"cp*coord*lemma/ip*T*T*T",
0., [Coord];
"lemma=i|lub|czy|bądź",
[Number,"all_numbers";Gender,"all_genders";Person,"all_persons"],
"(ip*number*gender*person/ip*T*T*T)\\ip*T*T*T",
0., []; (* FIXME: semantyka z make_conj_frame *)
"lemma=,|i|lub|czy|bądź", [],
"(advp/prepnp*T*T)\\prepnp*T*T",
0., []; (* FIXME: semantyka z make_conj_frame *)
"lemma=,|i|lub|czy|bądź", [],
"(advp/advp)\\prepnp*T*T",
0., []; (* FIXME: semantyka z make_conj_frame *)
"lemma=,|i|lub|czy|bądź", [],
"(advp/prepnp*T*T)\\advp",
0., []; (* FIXME: semantyka z make_conj_frame *)
"lemma=,|i|lub|czy|bądź", [],
"(advp/advp)\\advp",
0., []; (* FIXME: semantyka z make_conj_frame *)
"lemma=,|i|lub|czy|bądź",
[Lemma,"";Case,"all_cases"],
"(prepnp*lemma*case/prepnp*lemma*case)\\prepnp*lemma*case",
0., []; (* FIXME: semantyka z make_conj_frame *)
"lemma=,|i|lub|czy|bądź",
[Number,"all_numbers";Case,"all_cases";Gender,"all_genders";Person,"all_persons"],
"(np*number*case*gender*person/np*T*case*T*T)\\np*T*case*T*T",
0., []; (* FIXME: semantyka z make_conj_frame *)
"lemma=,|i|lub|czy|bądź",
[Number,"all_numbers";Case,"all_cases";Gender,"all_genders"],
"(adjp*number*case*gender/adjp*number*case*gender)\\adjp*number*case*gender",
0., []; (* FIXME: semantyka z make_conj_frame *)
"lemma=co|kto,pos=subst",
[Inumber,"";Igender,"";Iperson,"";Ctype,"int&rel";Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"cp*ctype*lemma/(ip*inumber*igender*iperson/np*number*case*gender*person)",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
"lemma=co|kto,pos=subst",
[Inumber,"";Igender,"";Iperson,"";Plemma,"";Ctype,"int&rel";Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"cp*ctype*lemma{/(ip*inumber*igender*iperson/prepnp*plemma*case),/(prepnp*plemma*case/np*number*case*gender*person)}",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
"lemma=to,pos=subst",
[Ctype,"";Plemma,"";Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"ncp*number*case*gender*person*ctype*plemma{qub_inclusion}{/cp*ctype*plemma}",
0., [Number;Case;Gender;Person;Ctype]; (*coreferential*)
"pos=ppron3,praep==praep",
[Plemma,"";Number,"numbers";Case,"cases";Gender,"genders";Person,"persons"],
"prepnp*plemma*case\\(prepnp*plemma*case/np*number*case*gender*person)", (*inclusion*)
0., [Number;Case;Gender;Person];
"lemma=ile,pos=num", (* FIXME: iloma ma bezpośredni podrzędnik rzeczownikowy, a ile nie *) (* FIXME: mwe "o ile, na ile" *)
[Inumber,"";Igender,"";Iperson,"";Ctype,"int&rel";Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"cp*ctype*lemma/ip*inumber*igender*iperson", (* FIXME: zaślepka, bo podrzędnik ile nie musi z nim sąciadować *)
0., [Number;Case;Gender;Person;Ctype;Acm]; (*["CTYPE",SubstVar "ctype"]*) (* FIXME: trzeba dodać przypadki, bezpośredniego podrzędnika rzeczownikowego i przyimka nad "ile" *)
"lemma=czyj|jaki|który,pos=adj",
[Inumber,"";Igender,"";Iperson,"";Nperson,"";Ctype,"int";Number,"numbers";Case,"cases";Gender,"genders"],
"cp*ctype*lemma{/(ip*inumber*igender*iperson/np*number*case*gender*nperson)}{/(np*number*case*gender*nperson/adjp*number*case*gender)}",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
"lemma=czyj|jaki|który,pos=adj",
[Inumber,"";Igender,"";Iperson,"";Nperson,"";Plemma,"";Ctype,"int";Number,"numbers";Case,"cases";Gender,"genders"],
"cp*ctype*lemma{/(ip*inumber*igender*iperson/prepnp*plemma*case)}{/(prepnp*plemma*case/np*number*case*gender*nperson)}{/(np*number*case*gender*nperson/adjp*number*case*gender)}",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
"lemma=czyj|jaki,pos=adj",
[Inumber,"";Igender,"";Iperson,"";Ctype,"rel";Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"cp*ctype*lemma/(ip*inumber*igender*iperson/np*number*case*gender*person)",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
"lemma=jaki|który,pos=adj",
[Inumber,"";Igender,"";Iperson,"";Plemma,"";Ctype,"rel";Number,"numbers";Case,"cases";Gender,"genders";Person,"ter"],
"cp*ctype*lemma{/(ip*inumber*igender*iperson/prepnp*plemma*case)}{/(prepnp*plemma*case/np*number*case*gender*person)}",
0., [Ctype]; (*["CTYPE",SubstVar "ctype"]*)
"lemma=się,pos=qub",[],"się",0.,[]; (* FIXME: dodać make_np *)
"lemma=nie,pos=qub",[],"nie",0.,[];
"lemma=by,pos=qub",[],"by",0.,[];
"lemma=niech,pos=qub",[],"aux-imp",0.,[];
"lemma=niechaj,pos=qub",[],"aux-imp",0.,[];
"lemma=niechże,pos=qub",[],"aux-imp",0.,[];
"lemma=niechajże,pos=qub",[],"aux-imp",0.,[];
"lemma=czy,pos=qub",[],"cp*int*czy/ip*T*T*T",0.,[Int];
"lemma=gdyby,pos=qub",[],"cp*rel*gdyby/ip*T*T*T",0.,[Rel];
"pos=qub",[],"qub",0.,[];
"pos=interj",[],"interj",0.,[];
"lemma=-,pos=interp",[],"hyphen",0.,[];
"lemma=?,pos=interp",[],"int",0.,[];
"lemma=„,pos=interp",
[Number,"";Case,"";Gender,"";Person,""],
"(np*number*case*gender*person/rquot)/np*number*case*gender*person",
0.,[]; (* make_quot_frame *)
"lemma=«,pos=interp",
[Number,"";Case,"";Gender,"";Person,""],
"(np*number*case*gender*person/rquot2)/np*number*case*gender*person",
0.,[]; (* make_quot_frame *)
"lemma=»,pos=interp",
[Number,"";Case,"";Gender,"";Person,""],
"(np*number*case*gender*person/rquot3)/np*number*case*gender*person",
0.,[]; (* make_quot_frame *)
"lemma=”,pos=interp",[],"rquot",0.,[];
"lemma=»,pos=interp",[],"rquot2",0.,[];
"lemma=«,pos=interp",[],"rquot3",0.,[];
"lemma=(,pos=interp",[],
"(inclusion/rparen)/(np*T*T*T*T+ip*T*T*T+adjp*T*T*T+prepnp*T*T)",
0.,[]; (* make_inclusion_frame *)
"lemma=[,pos=interp",[],
"(inclusion/rparen2)/(np*T*T*T*T+ip*T*T*T+adjp*T*T*T+prepnp*T*T)",
0.,[]; (* make_inclusion_frame *)
"lemma=),pos=interp",[],"rparen",0.,[];
"lemma=],pos=interp",[],"rparen2",0.,[];
"pos=unk",
[Number,"all_numbers";Case,"all_cases";Gender,"all_genders";Person,"all_persons"],
"np*number*case*gender*person",
0., [Number;Case;Gender;Person];
(* | ".","interp",[] -> [LCGrenderer.make_frame_simple [] ["dot"] c (make_node "." "interp" c.weight 0 [])] (* FIXME: to jest potrzebne przy CONLL *)
| "<conll_root>","interp",[] ->
let batrs = (make_node "<conll_root>" "interp" c.weight 0 []) in
let schema_list = [[schema_field CLAUSE "Clause" Forward [Phrase IP;Phrase (CP(Int,CompUndef));Phrase (NP(Case "voc"));Phrase (Lex "interj")]]] in
[LCGrenderer.make_frame false tokens lex_sems [] schema_list ["<conll_root>"] d batrs]
| lemma,c,l -> failwith ("process_interp: " ^ lemma ^ ":" ^ c ^ ":" ^ (String.concat ":" (Xlist.map l (String.concat ".")))) in*)
]
(*
let bracket_rules = [
| ":" ->
[LCGrenderer.make_frame_simple [] ["or"] c (LCGrenderer.make_pro_komunikat tokens lex_sems)]
| ":s" ->
let batrs = make_node "pro-komunikować" "pro" c.weight 0 [] in
[LCGrenderer.make_frame x_flag tokens lex_sems [] [[schema_field SUBJ "Initiator" Backward [Phrase (Lex "<speaker>")]]] (["<colon>"]) {c with orth=""} batrs;
LCGrenderer.make_frame x_flag tokens lex_sems [] [[schema_field SUBJ "Initiator" Backward [Phrase (Lex "<speaker>")]];[schema_field OBJ "Theme" Forward [Phrase (Lex "</query>")]]] (["<colon>"]) {c with orth=""} batrs]
(*| "<or>" -> [LCGrenderer.make_frame x_flag tokens lex_sems [] [[nosem_schema_field Forward [Phrase (Lex "</or>")]]] (["or"]) {d with orth=""} (make_node "<or>" "interp" c.weight 0 [])]*)
| "<or>" -> []
| "<or-sentence>" -> (* FIXME: dodać mówcę jako pro *)
let batrs = make_node "pro-komunikować" "pro" c.weight 0 [] in
[LCGrenderer.make_frame x_flag tokens lex_sems [] [[schema_field ARG ""(*"Theme"*) Forward [Phrase (Lex "s")]]] ["<root>"] {c with orth=""} batrs;
LCGrenderer.or_frame (make_node "<sentence>" "interp" c.weight 0 [])]
| "</or-sentence>" ->
let t = ["or2"] in
let batrs = (make_node "</or-sentence>" "interp" c.weight 0 []) in
let schema_list = [[schema_field CLAUSE "Clause" Backward [Multi[IP;CP(Int,CompUndef);NP(Case "voc");Lex "interj"](*Phrase IP;Phrase(CP(Int,CompUndef));Phrase(NP(Case "voc"))*)]](*;[WalFrames.schema_field NOSEM "" Backward [Phrase(Lex "<sentence>")]]*)] in
[LCGrenderer.make_frame x_flag tokens lex_sems [] schema_list t d batrs]
| "</or>" -> []
(*let t = (["</or>"]) in
let batrs = (make_node "</or>" "interp" c.weight 0 []) in
let schema_list = [[schema_field SENTENCE "Sentence" Backward [Multi[Lex "<sentence>"](*Phrase(Lex "s")*)]]] in
[LCGrenderer.make_frame x_flag tokens lex_sems [] schema_list t d batrs] (* FIXME: semantyka *)*)
| "<sentence>" ->
[LCGrenderer.make_frame x_flag tokens lex_sems [] [[arg_schema_field Forward [Phrase (Lex "s")]]] ["<root>"] {c with orth=""} (make_node "<sentence>" "interp" c.weight 0 []);
LCGrenderer.make_frame x_flag tokens lex_sems [] [[arg_schema_field Forward [Phrase (NP(Case "nom"))]];[nosem_schema_field Forward [Phrase (Lex "</speaker>")]]] (["<speaker>"]) {c with orth=""} (make_node "<speaker>" "interp" c.weight 0 [])]
| "</sentence>" ->
let t = ["s"] in
let batrs = (make_node "</sentence>" "interp" c.weight 0 []) in
let schema_list = [[schema_field CLAUSE "Clause" Backward [Multi[IP;CP(Int,CompUndef);NP(Case "voc");Lex "interj"](*Phrase IP;Phrase(CP(Int,CompUndef));Phrase(NP(Case "voc"))*)]](*;[WalFrames.schema_field NOSEM "" Backward [Phrase(Lex "<sentence>")]]*)] in
[LCGrenderer.make_frame_simple [] ["</speaker>"] c ( (make_node "</speaker>" "interp" c.weight 0 []));
LCGrenderer.make_frame x_flag tokens lex_sems [] schema_list t d batrs]
| lemma -> raise Not_found in
]*)
let rec split_comma found rev = function
"lemma" :: "=" :: "," :: l -> split_comma found ("," :: "=" :: "lemma" :: rev) l
| "," :: l -> split_comma (List.rev rev :: found) [] l
| s :: l -> split_comma found (s :: rev) l
| [] -> if rev = [] then found else List.rev rev :: found
let match_selectors = function
"lemma" :: l -> Lemma,l
| "pos" :: l -> Pos,l
| "number" :: l -> Number,l
| "case" :: l -> Case,l
| "person" :: l -> Person,l
| "nsem" :: l -> Nsem,l
| "praep" :: l -> Pos(*Praep*),l
| "adjsyn" :: l -> Adjsyn,l
| "acm" :: l -> Acm,l
| "negation" :: l -> Negation,l
| "check_frame_number2" :: l -> Pos,l
| "check_frame_case" :: l -> Pos,l
| "mood" :: l -> Mood,l
| s :: l -> (*failwith*)print_endline ("match_selectors: " ^ s); Pos,l
| [] -> failwith "match_selectors: empty"
type selector_relation = Eq | Neq | StrictEq
let match_relation = function
cat,"=" :: "=" :: l -> cat,StrictEq,l
| cat,"!" :: "=" :: l -> cat,Neq,l
| cat,"=" :: l -> cat,Eq,l
| cat,s :: l -> (*failwith*)print_endline ("match_relation: " ^ (String.concat " " (s :: l))); cat,Eq,l
| cat,[] -> (*failwith*)print_endline "match_relation: empty"; cat,Eq,[]
let rec split_mid rev = function
[s] -> List.rev (s :: rev)
| s :: "|" :: l -> split_mid (s :: rev) l
| [] -> print_endline "split_mid: empty"; []
| l -> (*failwith*)print_endline ("split_mid: " ^ (String.concat " " l)); []
let match_value = function
cat,rel,[s] -> cat,StrictEq,[s]
| cat,rel,[] -> (*failwith*)print_endline "match_value: empty"; cat,Eq,[]
| cat,rel,l -> cat,rel, split_mid [] l
let parse_selectors s =
(* print_endline s; *)
let l = Xlist.map (Str.full_split (Str.regexp "|\\|,\\|=\\|!") s) (function
Str.Text s -> s
| Str.Delim s -> s) in
let ll = split_comma [] [] l in
let l = Xlist.rev_map ll match_selectors in
let l = Xlist.rev_map l match_relation in
let l = Xlist.rev_map l match_value in
l
let parse_grammar grammar =
Xlist.fold grammar [] (fun grammar (selectors,quant,syntax,measure,semantics) ->
(parse_selectors selectors,quant,syntax,measure,semantics) :: grammar)
let _ = parse_grammar grammar