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
|
--# -path=.:../romance:../../prelude
instance SyntaxFra of SyntaxRomance = TypesFra ** open Prelude, (CO=Coordination), MorphoFra in {
oper
nameNounPhrase = \jean ->
normalNounPhrase
(\\c => prepCase c ++ jean.s)
jean.g
Sg ;
chaqueDet = mkDeterminer1 Sg "chaque" ;
tousDet = mkDeterminer Pl ["tous les"] ["toutes les"] ;
plupartDet = mkDeterminer1 Pl ["la plupart des"] ;
unDet = mkDeterminer Sg "un" "une" ;
plDet = mkDeterminer1 Pl "des" ; ---
quelDet = mkDeterminer Sg "quel" "quelle" ;
quelsDet = mkDeterminer Pl "quels" "quelles" ;
npGenPoss = \n,ton,mec ->
\\c => prepCase c ++ ton.s ! Poss n mec.g ++ mec.s ! n ;
mkAdjReg : Str -> Bool -> Adjective = \adj,p ->
mkAdjective (adjGrand adj) p ;
comparConj = elisQue ;
mkAdjDegrReg : Str -> Bool -> AdjDegr = \adj,p ->
mkAdjDegrLong (adjGrand adj) p ;
-- The commonest case for functions is common noun + "de".
funDe : CommNounPhrase -> Function = \mere ->
mere ** complementCas genitive ;
-- Chains of "dont" - "dont" do not arise.
funRelPron : Function -> RelPron -> RelPron = \mere,lequel ->
{s = table {
RComplex g n c => variants {
case mere.c of { ---
Gen => lequel.s ! RSimple Gen ++
artDef mere.g n c ++ mere.s ! n ;
_ => nonExist} ;
artDef mere.g n c ++ mere.s ! n ++
mere.s2 ++ lequel.s ! RComplex g n mere.c
} ;
_ => nonExist
} ;
g = RG mere.g
} ;
-- Verbs
negVerb = \va -> elisNe ++ va ++ "pas" ;
copula = \b -> (etreNetre b).s ;
isTransVerbClit = \v -> case v.c of {
Acc => True ;
_ => False --- hmmm
} ;
-- The "ne - pas" negation.
posNeg = \b,v,c ->
if_then_else Str b
(v ++ c)
(elisNe ++ v ++ "pas" ++ c) ; --- exception: infinitive!
-- Exampe: 'to be or not to be'.
etreNetre : Bool -> VerbPres = \b ->
{s = \\w => posNeg b (verbEtre.s ! w) []} ; ---- v reveals a BUG in refresh
locativeNounPhrase = \jean ->
{s = "dans" ++ jean.s ! Ton Acc} ;
embedConj = elisQue ;
-- Relative pronouns
identRelPron = {
s = table {
RSimple c => relPronForms ! c ;
RComplex g n c => composRelPron g n c
} ;
g = RNoGen
} ;
suchPron = telPron ;
composRelPron = lequelPron ;
allRelForms = \lequel,g,n,c ->
variants {
lequel.s ! RSimple c ;
lequel.s ! RComplex g n c
} ;
-- Interrogative pronouns
nounIntPron = \n, mec ->
{s = \\c => prepCase c ++ quelPron mec.g n ++ mec.s ! n ;
g = mec.g ;
n = n
} ;
intPronWho = \num -> {
s = \\c => prepCase c ++ "qui" ;
g = Masc ; --- can we decide this?
n = num
} ;
intPronWhat = \num -> {
s = table {
Gen => ["de quoi"] ;
Acc => ["à quoi"] ;
c => elisQue
} ;
g = Masc ; --- can we decide this?
n = num
} ;
-- Questions
questVerbPhrase = \jean,dort ->
{s = table {
DirQ => optStr (estCeQue Acc) ++ (predVerbPhrase jean dort).s ! Ind ;
IndirQ => elisSi ++ (predVerbPhrase jean dort).s ! Ind
}
} ;
intVerbPhrase = \qui, dort ->
{s = table {
DirQ => qui.s ! Nom ++ optStr (estCeQue Nom) ++
dort.s ! qui.g ! VFin Ind qui.n P3 ;
IndirQ => "ce" ++ qui.s ! Nom ++ dort.s ! qui.g ! VFin Ind qui.n P3
}
} ;
intSlash = \Qui, Tuvois ->
let {qui = Tuvois.s2 ++ Qui.s ! Tuvois.c ; tuvois = Tuvois.s ! Ind} in
{s = table {
DirQ => qui ++ optStr (estCeQue Acc) ++ tuvois ;
IndirQ => ifCe Tuvois.c ++ qui ++ tuvois
}
} ;
-- An auxiliary to distinguish between
-- "je ne sais pas" ("ce qui dort" / "ce que tu veux" / "à qui tu penses").
ifCe : Case -> Str = \c -> case c of {
Nom => "ce" ;
Acc => "ce" ;
_ => []
} ;
questAdverbial = \quand, jean, dort ->
let {jeandort = (predVerbPhrase jean dort).s ! Ind} in
{s = table {
DirQ => quand.s ++ optStr (estCeQue Acc) ++ jeandort ;
IndirQ => quand.s ++ jeandort
}
} ;
----- moved from Morpho
--2 Articles
--
-- A macro for defining gender-dependent tables will be useful.
-- Its first application is in the indefinite article.
--
-- Notice that the plural genitive is special: "de femmes".
genForms : Str -> Str -> Gender => Str = \bon,bonne ->
table {Masc => bon ; Fem => bonne} ;
artIndef = \g,n,c -> case <n,c> of {
<Sg,_> => prepCase c ++ genForms "un" "une" ! g ;
<Pl,Gen> => elisDe ;
_ => prepCase c ++ "des"
} ;
artDef = \g,n,c -> artDefTable ! g ! n ! c ;
pronJe = mkPronoun
(elision "j")
(elision "m")
(elision "m")
"moi"
"mon" (elisPoss "m") "mes"
PNoGen -- gender cannot be known from pronoun alone
Sg
P1
Clit1 ;
pronTu = mkPronoun
"tu"
(elision "t")
(elision "t")
"toi"
"ton" (elisPoss "t") "tes"
PNoGen
Sg
P2
Clit1 ;
pronIl = mkPronoun
"il"
(elision "l")
"lui"
"lui"
"son" (elisPoss "s") "ses"
(PGen Masc)
Sg
P3
Clit2 ;
pronElle = mkPronoun
"elle"
elisLa
"lui"
"elle"
"son" (elisPoss "s") "ses"
(PGen Fem)
Sg
P3
Clit2 ;
pronNous = mkPronoun
"nous"
"nous"
"nous"
"nous"
"notre" "notre" "nos"
PNoGen
Pl
P1
Clit3 ;
pronVous = mkPronoun
"vous"
"vous"
"vous"
"vous"
"votre" "votre" "vos"
PNoGen
Pl --- depends!
P2
Clit3 ;
pronIls = mkPronoun
"ils"
"les"
"leur"
"eux"
"leur" "leur" "leurs"
(PGen Masc)
Pl
P3
Clit1 ;
pronElles = mkPronoun
"elles"
"les"
"leur"
"elles"
"leur" "leur" "leurs"
(PGen Fem)
Pl
P3
Clit1 ;
-- moved from ResFra
commentAdv = ss "comment" ;
quandAdv = ss "quand" ;
ouAdv = ss "où" ;
pourquoiAdv = ss "pourquoi" ;
etConj = ss "et" ** {n = Pl} ;
ouConj = ss "ou" ** {n = Sg} ;
etetConj = sd2 "et" "et" ** {n = Pl} ;
ououConj = sd2 "ou" "ou" ** {n = Sg} ;
niniConj = sd2 "ni" "ni" ** {n = Sg} ; --- requires ne !
siSubj = ss elisSi ;
quandSubj = ss "quand" ;
ouiPhr = ss ["Oui ."] ;
nonPhr = ss ["Non ."] ; --- and also Si!
}
|