-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapertium-sme-sma.sme-sma.rtx
164 lines (144 loc) · 6.17 KB
/
apertium-sme-sma.sme-sma.rtx
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
! sme
! ^Mun<prn><pers><p1><sg><nom><@SUBJ→>/Mån<prn><pers><p1><sg><nom><@SUBJ→>$
! ^oaidnit<vblex><tv><indic><pres><p1><sg><@+FMAINV>/vuojnnet<vblex><tv><indic><pres><p1><sg><@+FMAINV>$
! ^don<prn><pers><p2><sg><gen><@→N>/dån<prn><pers><p2><sg><gen><@→N>$
! ^viellja<n><sem_hum><sg><acc><@←OBJ>/viellja<n><sem_hum><sg><acc><@←OBJ>$
! smj
! Mån vuojnáv vieljat.
! "<Mån>"
! "mån" prn pers p1 sg nom
! "<vuojnáv>"
! "vuojnnet" vblex tv indic pres p1 sg @+FMAINV MAP:3256
! "<vieljat>"
! "viellja" n sem_hum sg acc px2sg
gender = m f ;
sem = sem_hum sem_food ;
number = sg pl ;
prn_type_other = rel dem indef itg ;
prn_type = pers ref [prn_type_other] ;
case = acc nom gen loc ine ela ill ;
np_type_other = top hyd cog org al pat ;
poss = ("" "") px1sg px1du px1pl px2sg px2du px2pl px3sg px3du px3pl ;
person = p1 p2 p3 ;
pron_type = pers refl dem indef recipr rel ;
attr = attr ;
transitivity = tv iv ;
mood = indic imp ;
qst = qst ;
tense = pres pret ;
vform = inf conneg prfprc ;
np_type = ant [np_type_other] ;
neg = neg ;
person_number = "p1.sg" "p1.du" "p1.pl"
"p2.sg" "p2.du" "p2.pl"
"p3.sg" "p3.du" "p3.pl" ;
person_number > poss : "p1.sg" px1sg, "p1.du" px1du, "p1.pl" px1pl,
"p2.sg" px2sg, "p2.du" px2du, "p2.pl" px2pl,
"p3.sg" px3sg, "p3.du" px3du, "p3.pl" px3pl ;
! a rule for converting person+number tag pairs to possessive tags
! this applies if you write poss=1.person_number or 1.person_number>poss
! "" because these are pairs instead of single tags
case > case : loc ine ;
n: _.number.case.poss ;
np_ant: _.<ant>.gender.number.case ;
np_other: _.np_type.number.case ;
np: (if (1.np_type = ant) 1(np_ant)
else 1(np_other)) ;
np: _.np_type.gender.number.case ;
adj_attr: _.attr ;
adj_pred: _.number.case ;
adj: (if (1.attr = attr) 1(adj_attr)
else 1(adj_pred)) ;
adv: _ ;
cnjcoo: _ ;
prn: _.pron_type.person.number.case ; ! mun<prn><pers><p1><sg><loc>
NP: _.number.case.poss.sem ;
! <vblex><tv><indic><pres><p3><pl>
vblex_fin: _.transitivity.neg.mood.tense.person.number ; ! neg usually empty
vblex_inf: _.transitivity.vform ;
vblex: (if (1.vform = "") 1(vblex_fin)
else 1(vblex_inf)) ;
VP: _.mood.tense.vform ;
S: _ ;
p1_or_p2 = p1 p2 ;
NP -> prn.pers.[p1_or_p2].*.gen.$lemcase/sl %NP
{ %2[poss=1.person_number,lemcase=$lemcase]
! the following is equivalent
! 2[poss=(if (1.person = p1 and 1.number = sg) px1sg
! if (1.person = p1 and 1.number = du) px1du
! if (1.person = p1 and 1.number = pl) px1pl
! if (1.person = p2 and 1.number = sg) px2sg
! if (1.person = p2 and 1.number = du) px2du
! if (1.person = p2 and 1.number = pl) px2pl
! if (1.person = p3 and 1.number = sg) px3sg
! if (1.person = p3 and 1.number = du) px3du
! if (1.person = p3 and 1.number = pl) px3pl
! )]
} ;
NP -> %n { %1[poss=$poss,lemcase=$lemcase] } ;
NP -> adj.attr.$lemcase/sl %NP { 1[lemcase=$lemcase] _ %2[poss=$poss] } ;
NP -> %NP cnjcoo NP { %1[lemcase=$lemcase] _ 2 _ 3[case=$case] } ;
NP -> %prn { 1[lemcase=$lemcase] } ; ! % = NP får taggene fra pronomene
! Danielgo -> Daniel dïhte
NP -> %np { 1 (if (1.qst = qst) [ _ dïhte@pcle ]) } ;
VP -> %vblex.tv.$lemcase/sl NP ! hvis transitivt verb, kjør OV - verb + nomen
{
2[case=(if (2.number = pl and 2.case = acc) nom ! case som er acc, blir nominativ hvis nummer er plural
if (2.sem = sem_food and 2.case = loc) ela ! hvis sem_taggen er food og case er loc - gir output elativ.
else 2.case), ! ellers gi samme case som er i input.
lemcase=$lemcase]
_ %1[lemcase=aa]
} ;
VP -> NP %vblex.tv { 1 _ %2 } ; ! VO gir OV som output
VP -> %vblex.iv { %1[lem=(if ($lem equalcl gåaradidh) gåaradidh
else 1.lem)] } ;
VP -> adv %VP { 1 _ %2[lem=$lem] } ;
verb_ill_to_ine = aelkedh ;
verb_loc_to_acc = gihtjedh ;
!verb_ill_to_ell = steeredh ;
! Mun álggán skuvlii (sme: Ill)
! Manne skuvlesne aalkam (sma: Ine)
ill_or_loc = ill loc ;
VP -> %VP NP.*.[ill_or_loc]
{ 2[case=(if (2.case = ill and 1.lem in_caseless verb_ill_to_ine) ine
if (2.case = loc and 1.lem in_caseless verb_loc_to_acc) acc
! if (2.case = ill and 1.lem in_caseless verb_ill_to_ell) ela
! if (2.case = ill and 1.lem in_caseless verb_ill_to_com) com
else 2.case)]
_ %1[lem=$lem] } ;
! ****************************
! I want to make this valens-rule:
! SME: Mun doalan gáibái (ill) --> SMA: Manne gaejpeste steerem (ela)
! if (2.case = ill and 1.lem in_caseless verb_ill_to_ell) ela
! ****************************
! ****************************
! I want to make this valens-rule:
! SME: Mun lean harjanan dasa (ill) --> SMA: Manne dejnie vaananamme (com)
! SME: Dasa lean oahpasmuvvan (ill) ---> SMA: Manne dejnie åahpanamme (com)
! if (2.case = ill and 1.lem in_caseless verb_ill_to_com) com
! ****************************
! In leat skuvlii vel álgán (sme: Ill)
! Im leah skuvlesne annje aalkeme. (sma: Ine)
VP -> NP.*.[ill_or_loc] %VP
{ 1[case=(if (1.case = ill and 2.lem in_caseless verb_ill_to_ine) ine
if (1.case = loc and 2.lem in_caseless verb_loc_to_acc) acc
else 1.case)]
_ %2[lem=$lem] } ;
! Ruovttosiiddu bokte lea vejolaš árvalit áššiid.
! Nehtebielien tjïrrh gåarede aamhtesh raeriestidh.
VP -> %lea@VP vejolaš@adj.*.nom { %1[lem=2.lem/tl] } ;
VP -> %VP adv { %1[lem=$lem] _ 2 } ;
! AuxP: _ ;
! AuxP -> [email protected] VP.*.conneg
! { 1[tense=2.tense,mood=2.mood] _ 2[tense="",mood=""] } ;
! sme - Gánddas leat vieljat - Mov leah vïellh
! Gánddas lea viellja. - Mov lea vïelle
! This rule dont work?
!SME: Leago Márehis maid beana? Ii, Márehis ii leat beana, sus lea bussá.
!SMA: Máretisnie #Mejtie dovne bïenje? Ij, Máretisnie ij leah bïenje, desnie lea gaahtoe.
!
S -> NP.*.loc [email protected] NP { 1[case=gen] _ 2 _ 3 } ;
! Mun in boahtán. -> Idtjim manne båetieh.
S -> NP.*.nom.$lemcase [email protected] VP.*.conneg
{ 2[tense=3.tense,mood=3.mood,lemcase=$lemcase]
_ 1[lemcase=aa] _ 3[tense="",mood=""] } ;