-
Notifications
You must be signed in to change notification settings - Fork 0
/
MiniresourceGle.gf
224 lines (158 loc) · 6.01 KB
/
MiniresourceGle.gf
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
--A miniature resource grammar of Irish
--Michal Boleslav Měchura, http://www.lexiconista.com/
--Last updated: 11 October 2014
concrete MiniresourceGle of Miniresource = open Prelude, ResGle in {
flags coding = utf8;
--SENTENCE:
lincat S = {s : Str};
--Build a sentence from a tense, a polarity and a clause:
lin UseCl t p cl = { --UseCl : Tense -> Pol -> Cl -> S
s = cl.s ! t.t ! p.b
};
--Build a new sentence by connecting two existing sentences with a conjunction:
lin ConjS co sx sy = { --ConjS : Conj -> S -> S -> S
s = sx.s ++ (ResGle.conj co) ++ sy.s
};
--TENSE:
param TTense = TPres | TPast;
lincat Tense = {s : Str; t : TTense};
--Two prefabricated tenses:
lin Pres = {s = ""; t = TPres};
lin Perf = {s = ""; t = TPast};
--POLARITY:
lincat Pol = {s : Str; b : Bool};
--Two prefabricated polarities:
lin Pos = {s = ""; b = True};
lin Neg = {s = ""; b = False};
--CLAUSE:
lincat Cl = {
s : TTense => Bool => Str --tense => polarity => clause form
};
--Build a clause from a noun phrase (= the subject) and a verb phrase:
lin PredVP np vp = { --PredVP : NP -> VP -> Cl
s = \\tense,polarity =>
vp.head!tense!polarity --the verb phrase bit before the subject (= the verb)
++ np.s!(NPNom Unmut) --the subject, in the nominative case
++ vp.tail --the verb phrase bit after the subject (= the verb's object and whatever else)
};
--VERB PHRASE:
lincat VP = {
head : TTense => Bool => Str; --the bit that goes before the subject; tense => polarity => verb form
tail : Str --the bit that goes after the subject, such as the verb's object; can be empty
};
--Build a verb phrase by elevating a verb:
lin UseV v = { --UseV : V -> VP
head = v.s;
tail = ""
};
--Build a verb phrase from a two-place verb and a noun phrase (= the object):
lin ComplV2 v2 np = { --ComplV2 : V2 -> NP -> VP
head = v2.s;
tail = np.s!NPAcc --the verb's object will be in the accusative case
};
--Build a verb phrase from an adjective phrase, using the verb 'to be' ("big" --> "is big"):
lin CompAP ap = { --CompAP : AP -> VP
head = table {
TPres => table { True => "tá"; False => "níl" };
TPast => table { True => "bhí"; False => "ní raibh" }
};
tail = ap.sg!NNom!Masc!Unmut
};
--VERB:
lincat V = {
s : TTense => Bool => Str --tense => polarity => verb form
};
--Some prefabricated verbs:
lin walk_V = {
s = table {
TPres => table { True => "siúlann"; False => "ní shiúlann" };
TPast => table { True => "shiúil"; False => "níor shiúil" }
}
};
lin arrive_V = {
s = table {
TPres => table { True => "tagann"; False => "ní thagann" };
TPast => table { True => "tháinig"; False => "níor tháinig" }
}
};
--TWO-PLACE VERB:
lincat V2 = {
s : TTense => Bool => Str --tense => polarity => verb form
};
--Some prefabricated two-place verbs:
lin love_V2 = {
--The usual Irish equivalent of 'to love' is a periphrastic construction ('to be in love with').
--There's a verb "gráigh" 'to love' but it is used extremely rarely.
--So I'm using the verb "póg" 'to kiss' instead here.
s = table {
TPres => table { True => "pógann"; False => "ní phógann" };
TPast => table { True => "phóg"; False => "níor phóg" }
}
};
lin please_V2 = {
--I can think of several good Irish equivalents of 'to please somebody' but they're all periphrastic constructions.
--So I'm using the verb "sásaigh" 'to satisfy' instead here.
s = table {
TPres => table { True => "sásaíonn"; False => "ní shásaíonn" };
TPast => table { True => "shásaigh"; False => "níor shásaigh" }
}
};
--NOUN PHRASE:
lincat NP = ResGle.NP;
--Some prefabricated noun phrases:
lin i_NP = ResGle.mkPronounNP ResGle.mePron;
lin youSg_NP = ResGle.mkPronounNP ResGle.tuPron;
lin he_NP = ResGle.mkPronounNP ResGle.sePron;
lin she_NP = ResGle.mkPronounNP ResGle.siPron;
lin we_NP = ResGle.mkPronounNP ResGle.muidPron;
lin youPl_NP = ResGle.mkPronounNP ResGle.sibhPron;
lin they_NP = ResGle.mkPronounNP ResGle.siadPron;
--Build a noun phrase from a determiner and a common noun:
lin DetCN det cn = ResGle.mkNounNP cn det; --DetCN : Det -> CN -> NP
--Build a new noun phrase by connecting two existing noun phrases with a conjunction:
lin ConjNP co nx ny = ResGle.conjNP co nx ny; --ConjNP : Conj -> NP -> NP -> NP
--DETERMINER:
lincat Det = ResGle.Determiner;
--Some prefabricated determiners:
lin a_Det = DetZero Sg;
lin the_Det = DetArt Sg DemZero;
lin every_Det = DetGach;
lin this_Det = DetArt Sg DemSeo;
lin that_Det = DetArt Sg DemSin;
lin these_Det = DetArt Pl DemSeo;
lin those_Det = DetArt Pl DemSin;
--COMMON NOUN:
lincat CN = ResGle.Noun;
--Build a common noun by elevating a noun:
lin UseN n = n; --UseN : N -> CN
--Build a new common noun by adding an adjective phrase to an existing common noun:
lin ModCN ap cn = ResGle.addAdjNoun cn ap; --ModCN : AP -> CN -> CN
--NOUN:
lincat N = ResGle.Noun;
--Some prefabricated nouns:
lin man_N = ResGle.fearNoun;
lin woman_N = ResGle.beanNoun;
lin house_N = ResGle.teachNoun;
lin tree_N = ResGle.crannNoun;
--ADJECTIVE PHRASE:
lincat AP = ResGle.Adj;
--Build an adjective phrase by elevating an adjective:
lin UseA a = a; --UseA : A -> AP
--Build a new adjective phrase by adding an ad-adjective to an existing adjective phrase:
lin AdAP ad ap = prefAdj ap ad; --AdAP : AdA -> AP -> AP
--ADJECTIVE:
lincat A = ResGle.Adj;
--Some prefabricated adjectives:
lin big_A = ResGle.morAdj;
lin small_A = ResGle.beagAdj;
lin green_A = ResGle.glasAdj;
--AD-ADJECTIVE:
lincat AdA = ResGle.Pref;
--A prefabricated ad-adjective:
lin very_AdA = ResGle.anPref;
--CONJUNCTION:
lincat Conj = ResGle.Conjunction;
--Two prefabricated conjunctions:
lin and_Conj = ResGle.ConjAgus;
lin or_Conj = ResGle.ConjNo;
}