-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrafske.peg
1265 lines (1029 loc) · 24.5 KB
/
rafske.peg
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
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
lojban-word <- cmene
/ cmavo
/ brivla
brivla <- gismu
-> brivla-gismu
/ fuhivla
-> brivla-fuhivla
/ lujvo
-> brivla-lujvo
;-------------------------------------------------------------------
cmene <- jbocme
/ zifcme
zifcme <- !h
( nucleus / glide / h / consonant !pause / digit )*
consonant
&pause
-> zifcme
jbocme <- &zifcme
( any-syllable
/ digit )*
&pause
-> jbocme
;-------------------------------------------------------------------
cmavo <- !cmene !CVCy-lujvo cmavo-form &post-word
-> cmavo
CVCy-lujvo <- CVC-rafsi
y
h?
initial-rafsi*
brivla-core
-> CVCy-lujvo-brivla-core
/ stressed-CVC-rafsi
y
short-final-rafsi
-> CVCy-lujvo-short-final-rafsi
cmavo-form <- !h
!cluster
onset
(nucleus h)*
( !stressed nucleus
/ nucleus !cluster )
-> cmavo-form
/ y+
-> cmavo-form-y
/ digit
;-------------------------------------------------------------------
lujvo <- !gismu
!fuhivla
!cmavo
initial-rafsi*
brivla-core
-> lujvo
brivla-core <- fuhivla
/ gismu
/ CVV-final-rafsi
/ stressed-initial-rafsi short-final-rafsi
-> brivla-core
stressed-initial-rafsi <- stressed-extended-rafsi
/ stressed-y-rafsi
/ stressed-y-less-rafsi
initial-rafsi <- extended-rafsi
/ y-rafsi
/ !any-extended-rafsi
y-less-rafsi
any-extended-rafsi <- fuhivla
/ extended-rafsi
/ stressed-extended-rafsi
;-------------------------------------------------------------------
fuhivla <- fuhivla-head
stressed-syllable
consonantal-syllable*
final-syllable
-> fuhivla
stressed-extended-rafsi <- stressed-brivla-rafsi
/ stressed-fuhivla-rafsi
extended-rafsi <- brivla-rafsi
/ fuhivla-rafsi
stressed-brivla-rafsi <- &unstressed-syllable
brivla-head
stressed-syllable
h
y
-> stressed-brivla-rafsi
brivla-rafsi <- &( syllable
consonantal-syllable*
syllable )
brivla-head
h
y
h?
-> brivla-rafsi
stressed-fuhivla-rafsi <- fuhivla-head
stressed-syllable
&consonant
onset
y
-> stressed-fuhivla-rafsi
fuhivla-rafsi <- &unstressed-syllable
fuhivla-head
&consonant
onset
y
h?
-> fuhivla-rafsi
fuhivla-head <- !rafsi-string
brivla-head
brivla-head <- !cmavo
!slinkuhi
!h
&onset
unstressed-syllable*
-> brivla-head
slinkuhi <- consonant
rafsi-string
-> slinkuhi
rafsi-string <- y-less-rafsi*
( gismu
/ CVV-final-rafsi
/ stressed-y-less-rafsi
short-final-rafsi
-> rafsi-string-short-final
/ y-rafsi
/ stressed-y-rafsi
/ stressed-y-less-rafsi?
initial-pair
y
-> rafsi-string-initial-pair )
-> rafsi-string
;-------------------------------------------------------------------
gismu <- ( initial-pair
stressed-vowel
/ consonant
stressed-vowel
consonant )
&final-syllable
consonant
vowel
&post-word
-> gismu
CVV-final-rafsi <- consonant
stressed-vowel
h
&final-syllable
vowel
&post-word
-> CVV-final-rafsi
short-final-rafsi <- &final-syllable
( consonant
diphthong
/ initial-pair
vowel )
&post-word
-> short-final-rafsi
stressed-y-rafsi <- ( stressed-long-rafsi
/ stressed-CVC-rafsi )
y
-> stressed-y-rafsi
stressed-y-less-rafsi <- stressed-CVC-rafsi
!y
/ stressed-CCV-rafsi
/ stressed-CVV-rafsi
stressed-long-rafsi <- initial-pair
stressed-vowel
consonant
-> stressed-long-rafsi-CCVC
/ consonant
stressed-vowel
consonant
consonant
-> stressed-long-rafsi-CVCC
stressed-CVC-rafsi <- consonant
stressed-vowel
consonant
-> stressed-CVC-rafsi
stressed-CCV-rafsi <- initial-pair
stressed-vowel
-> stressed-CCV-rafsi
stressed-CVV-rafsi <- consonant
( unstressed-vowel
h
stressed-vowel
-> stressed-CVV-rafsi-VhV
/ stressed-diphthong )
r-hyphen?
-> stressed-CVV-rafsi
y-rafsi <- ( long-rafsi
/ CVC-rafsi )
y
h?
-> y-rafsi
y-less-rafsi <- !y-rafsi
( CVC-rafsi
!y
/ CCV-rafsi
/ CVV-rafsi )
!any-extended-rafsi
long-rafsi <- initial-pair
unstressed-vowel
consonant
-> long-rafsi-CCVC
/ consonant
unstressed-vowel
consonant
consonant
-> long-rafsi-CVCC
CVC-rafsi <- consonant
unstressed-vowel
consonant
-> CVC-rafsi
CCV-rafsi <- initial-pair
unstressed-vowel
-> CCV-rafsi
CVV-rafsi <- consonant
( unstressed-vowel
h
unstressed-vowel
-> CVV-rafsi-VhV
/ unstressed-diphthong )
r-hyphen?
-> CVV-rafsi
r-hyphen <- r &consonant
/ n &r
;-------------------------------------------------------------------
final-syllable <- onset
!y
!stressed
nucleus
!cmene
&post-word
-> final-syllable
stressed-syllable <- &stressed
syllable
/ syllable
&stress
stressed-diphthong <- &stressed
diphthong
/ diphthong
&stress
stressed-vowel <- &stressed
vowel
/ vowel
&stress
unstressed-syllable <- !stressed
syllable
!stress
/ consonantal-syllable
unstressed-diphthong <- !stressed
diphthong
!stress
unstressed-vowel <- !stressed
vowel
!stress
stress <- consonant*
y?
syllable
pause
stressed <- onset
comma*
[AEIOU]
any-syllable <- onset nucleus coda?
-> any-syllable
/ consonantal-syllable
syllable <- onset
!y
nucleus
coda?
-> syllable
consonantal-syllable <- consonant
syllabic
&(consonantal-syllable / onset)
(consonant &spaces)?
-> consonantal-syllable
coda <- !any-syllable
consonant
&any-syllable
/ syllabic?
consonant?
&pause
-> coda
onset <- h
/ consonant?
glide
-> onset
/ initial
nucleus <- vowel
/ diphthong
/ y
!nucleus
;-----------------------------------------------------------------
glide <- ( i / u ) &nucleus !glide
diphthong <- ( a i
/ a u
/ e i
/ o i )
!nucleus
!glide
-> diphthong
vowel <- ( a / e / i / o / u ) !nucleus
a <- comma* [aA] -> a
e <- comma* [eE] -> e
i <- comma* [iI] -> i
o <- comma* [oO] -> o
u <- comma* [uU] -> u
y <- comma* [yY] -> y
;-------------------------------------------------------------------
cluster <- consonant consonant+
-> cluster
initial-pair <- &initial
consonant
consonant
!consonant
-> initial-pair
initial <- ( affricate
/ sibilant?
other?
liquid?
-> initial )
!consonant
!glide
affricate <- t c -> affricate
/ t s -> affricate
/ d j -> affricate
/ d z -> affricate
liquid <- l
/ r
other <- p
/ t !l
/ k
/ f
/ x
/ b
/ d !l
/ g
/ v
/ m
/ n !liquid
sibilant <- c
/ s !x
/ ( j / z )
!n
!liquid
consonant <- voiced
/ unvoiced
/ syllabic
syllabic <- l / m / n / r
voiced <- b / d / g / j / v / z
unvoiced <- c / f / k / p / s / t / x
l <- comma* [lL] !h !l -> l
m <- comma* [mM] !h !m !z -> m
n <- comma* [nN] !h !n !affricate -> n
r <- comma* [rR] !h !r -> r
b <- comma* [bB] !h !b !unvoiced -> b
d <- comma* [dD] !h !d !unvoiced -> d
g <- comma* [gG] !h !g !unvoiced -> g
v <- comma* [vV] !h !v !unvoiced -> v
j <- comma* [jJ] !h !j !z !unvoiced -> j
z <- comma* [zZ] !h !z !j !unvoiced -> z
s <- comma* [sS] !h !s !c !voiced -> s
c <- comma* [cC] !h !c !s !x !voiced -> c
x <- comma* [xX] !h !x !c !k !voiced -> x
k <- comma* [kK] !h !k !x !voiced -> k
f <- comma* [fF] !h !f !voiced -> f
p <- comma* [pP] !h !p !voiced -> p
t <- comma* [tT] !h !t !voiced -> t
h <- comma* ['h] &nucleus -> h
;-------------------------------------------------------------------
digit <- comma* [[:digit:]] !h !nucleus
-> digit
post-word <- pause
/ !nucleus
lojban-word
pause <- comma*
space-char+
/ EOF
EOF <- comma* !.
comma <- [,]
non-lojban-word <- !lojban-word non-space+
-> non-lojban-word
non-space <- !space-char .
space-char <- [[:jboca'u:]]
;-------------------------------------------------------------------
spaces <- ( comma* space-char )+ EOF?
/ EOF
;spaces <- !Y initial-spaces
;
;initial-spaces <- ( comma* space-char
; / !ybu Y )+
; EOF?
; / EOF
ybu <- Y `space-char* BU
-> ybu
;-------------------------------------------------------------------
A <- &cmavo ( a / e / j i / o / u ) &post-word -> A
BAI <- &cmavo
( d u h o
/ s i h u
/ z a u
/ k i h i
/ d u h i
/ c u h u
/ t u h i
/ t i h u
/ d i h o
/ j i h u
/ r i h a
/ n i h i
/ m u h i
/ k i h u
/ v a h u
/ k o i
/ c a h i
/ t a h i
/ p u h e
/ j a h i
/ k a i
/ b a i
/ f i h e
/ d e h i
/ c i h o
/ m a u
/ m u h u
/ r i h i
/ r a h i
/ k a h a
/ p a h u
/ p a h a
/ l e h a
/ k u h u
/ t a i
/ b a u
/ m a h i
/ c i h e
/ f a u
/ p o h i
/ c a u
/ m a h e
/ c i h u
/ r a h a
/ p u h a
/ l i h e
/ l a h u
/ b a h i
/ k a h i
/ s a u
/ f a h e
/ b e h i
/ t i h i
/ j a h e
/ g a h a
/ v a h o
/ j i h o
/ m e h a
/ d o h e
/ j i h e
/ p i h o
/ g a u
/ z u h e
/ m e h e
/ r a i )
&post-word
-> BAI
BAhE <- &cmavo ( b a h e / z a h e ) &post-word -> BAhE
BE <- &cmavo ( b e ) &post-word -> BE
BEI <- &cmavo ( b e i ) &post-word -> BEI
BEhO <- &cmavo ( b e h o ) &post-word -> BEhO
BIhE <- &cmavo ( b i h e ) &post-word -> BIhE
BIhI <- &cmavo ( m i h i / b i h o / b i h i ) &post-word -> BIhI
BO <- &cmavo ( b o ) &post-word -> BO
BOI <- &cmavo ( b o i ) &post-word -> BOI
BU <- &cmavo ( b u ) &post-word -> BU
BY <- ybu
/ &cmavo
( j o h o
/ r u h o
/ g e h o
/ j e h o
/ l o h a
/ n a h a
/ s e h e
/ t o h a
/ g a h e
/ y h y
/ b y
/ c y
/ d y
/ f y
/ g y
/ j y
/ k y
/ l y
/ m y
/ n y
/ p y
/ r y
/ s y
/ t y
/ v y
/ x y
/ z y )
&post-word
-> BY
CAhA <- &cmavo
( c a h a
/ p u h i
/ n u h o
/ k a h e )
&post-word
-> CAhA
CAI <- &cmavo
( p e i
/ c a i
/ c u h i
/ s a i
/ r u h e )
&post-word
-> CAI
CEI <- &cmavo ( c e i ) &post-word -> CEI
CEhE <- &cmavo ( c e h e ) &post-word -> CEhE
CO <- &cmavo ( c o ) &post-word -> CO
COI <- &cmavo
( j u h i
/ c o i
/ f i h i
/ t a h a
/ m u h o
/ f e h o
/ c o h o
/ p e h u
/ k e h o
/ n u h e
/ r e h i
/ b e h e
/ j e h e
/ m i h e
/ k i h e
/ v i h o )
&post-word
-> COI
CU <- &cmavo ( c u ) &post-word -> CU
CUhE <- &cmavo ( c u h e / n a u ) &post-word -> CUhE
DAhO <- &cmavo ( d a h o ) &post-word -> DAhO
DOI <- &cmavo ( d o i ) &post-word -> DOI
DOhU <- &cmavo ( d o h u ) &post-word -> DOhU
FA <- &cmavo
( f a i
/ f a
/ f e
/ f o
/ f u
/ f i h a
/ f i )
&post-word
-> FA
FAhA <- &cmavo
( d u h a
/ b e h a
/ n e h u
/ v u h a
/ g a h u
/ t i h a
/ n i h a
/ c a h u
/ z u h a
/ r i h u
/ r u h u
/ r e h o
/ t e h e
/ b u h u
/ n e h a
/ p a h o
/ n e h i
/ t o h o
/ z o h i
/ z e h o
/ z o h a
/ f a h a )
&post-word
-> FAhA
FAhO <- &cmavo ( f a h o ) &post-word -> FAhO
FEhE <- &cmavo ( f e h e ) &post-word -> FEhE
FEhU <- &cmavo ( f e h u ) &post-word -> FEhU
FIhO <- &cmavo ( f i h o ) &post-word -> FIhO
FOI <- &cmavo ( f o i ) &post-word -> FOI
FUhA <- &cmavo ( f u h a ) &post-word -> FUhA
FUhE <- &cmavo ( f u h e ) &post-word -> FUhE
FUhO <- &cmavo ( f u h o ) &post-word -> FUhO
GA <- &cmavo ( g e h i / g e / g o / g a / g u ) &post-word -> GA
GAhO <- &cmavo ( k e h i / g a h o ) &post-word -> GAhO
GEhU <- &cmavo ( g e h u ) &post-word -> GEhU
GI <- &cmavo ( g i ) &post-word -> GI
GIhA <- &cmavo
( g i h e
/ g i h i
/ g i h o
/ g i h a
/ g i h u )
&post-word
-> GIhA
GOI <- &cmavo
( n o h u
/ n e
/ g o i
/ p o h u
/ p e
/ p o h e
/ p o )
&post-word
-> GOI
GOhA <- &cmavo
( m o
/ n e i
/ g o h u
/ g o h o
/ g o h i
/ n o h a
/ g o h e
/ g o h a
/ d u
/ b u h a
/ b u h e
/ b u h i
/ c o h e )
&post-word
-> GOhA
GUhA <- &cmavo
( g u h e
/ g u h i
/ g u h o
/ g u h a
/ g u h u )
&post-word
-> GUhA
I <- &cmavo ( i ) &post-word -> I
JA <- &cmavo ( j e h i / j e / j o / j a / j u ) &post-word -> JA
JAI <- &cmavo ( j a i ) &post-word -> JAI
JOhI <- &cmavo ( j o h i ) &post-word -> JOhI
JOI <- &cmavo
( f a h u
/ p i h u
/ j o i
/ c e h o
/ c e
/ j o h u
/ k u h a
/ j o h e
/ j u h e )
&post-word
-> JOI
KE <- &cmavo ( k e ) &post-word -> KE
KEhE <- &cmavo ( k e h e ) &post-word -> KEhE
KEI <- &cmavo ( k e i ) &post-word -> KEI
KI <- &cmavo ( k i ) &post-word -> KI
KOhA <- &cmavo
( d a h u
/ d a h e
/ d i h u
/ d i h e
/ d e h u
/ d e h e
/ d e i
/ d o h i
/ m i h o
/ m a h a
/ m i h a
/ d o h o
/ k o h a
/ f o h u
/ k o h e
/ k o h i
/ k o h o
/ k o h u
/ f o h a
/ f o h e
/ f o h i
/ f o h o
/ v o h a
/ v o h e
/ v o h i
/ v o h o
/ v o h u
/ r u
/ r i
/ r a
/ t a
/ t u
/ t i
/ z i h o
/ k e h a
/ m a
/ z u h i
/ z o h e
/ c e h u
/ d a
/ d e
/ d i
/ k o
/ m i
/ d o )
&post-word
-> KOhA
KU <- &cmavo ( k u ) &post-word -> KU
KUhE <- &cmavo ( k u h e ) &post-word -> KUhE
KUhO <- &cmavo ( k u h o ) &post-word -> KUhO
LA <- &cmavo ( l a i / l a h i / l a ) &post-word -> LA
LAU <- &cmavo ( c e h a / l a u / z a i / t a u ) &post-word -> LAU
LAhE <- &cmavo
( t u h a
/ l u h a
/ l u h o
/ l a h e
/ v u h i
/ l u h i
/ l u h e )
&post-word
-> LAhE
LE <- &cmavo
( l e i
/ l o i
/ l e h i
/ l o h i
/ l e h e
/ l o h e
/ l o
/ l e )
&post-word
-> LE
LEhU <- &cmavo ( l e h u ) &post-word -> LEhU
LI <- &cmavo ( m e h o / l i ) &post-word -> LI
LIhU <- &cmavo ( l i h u ) &post-word -> LIhU
LOhO <- &cmavo ( l o h o ) &post-word -> LOhO
LOhU <- &cmavo ( l o h u ) &post-word -> LOhU
LU <- &cmavo ( l u ) &post-word -> LU
LUhU <- &cmavo ( l u h u ) &post-word -> LUhU
MAhO <- &cmavo ( m a h o ) &post-word -> MAhO
MAI <- &cmavo ( m o h o / m a i ) &post-word -> MAI
ME <- &cmavo ( m e ) &post-word -> ME
MEhU <- &cmavo ( m e h u ) &post-word -> MEhU
MOhE <- &cmavo ( m o h e ) &post-word -> MOhE
MOhI <- &cmavo ( m o h i ) &post-word -> MOhI
MOI <- &cmavo
( m e i
/ m o i
/ s i h e
/ c u h o
/ v a h e )
&post-word
-> MOI
NA <- &cmavo ( j a h a / n a ) &post-word -> NA
NAI <- &cmavo ( n a i ) &post-word -> NAI
NAhE <- &cmavo
( t o h e
/ j e h a
/ n a h e
/ n o h e )
&post-word
-> NAhE
NAhU <- &cmavo ( n a h u ) &post-word -> NAhU
NIhE <- &cmavo ( n i h e ) &post-word -> NIhE
NIhO <- &cmavo ( n i h o / n o h i ) &post-word -> NIhO
NOI <- &cmavo ( v o i / n o i / p o i ) &post-word -> NOI
NU <- &cmavo
( n i
/ d u h u
/ s i h o
/ n u
/ l i h i
/ k a
/ j e i
/ s u h u
/ z u h o
/ m u h e
/ p u h u
/ z a h i )
&post-word
-> NU
NUhA <- &cmavo ( n u h a ) &post-word -> NUhA
NUhI <- &cmavo ( n u h i ) &post-word -> NUhI
NUhU <- &cmavo ( n u h u ) &post-word -> NUhU
PA <- &cmavo
( d a u
/ f e i
/ g a i
/ j a u
/ r e i
/ v a i
/ p i h e
/ p i
/ f i h u
/ z a h u
/ m e h i
/ n i h u
/ k i h o
/ c e h i
/ m a h u
/ r a h e
/ d a h a
/ s o h a
/ j i h i
/ s u h o
/ s u h e
/ r o
/ r a u