finished french vp (but buggy)

This commit is contained in:
aarne
2005-02-19 15:49:30 +00:00
parent 5e4929a635
commit 95adb717e2
9 changed files with 185 additions and 110 deletions

View File

@@ -493,11 +493,20 @@ oper
complAdverb : Adverb -> Complemnt = \dehors ->
complCopula (\\_,_,_ => dehors.s) ;
complVerbAdj : (Adjective ** {c : CaseA}) -> VerbPhrase -> Complemnt = \facile,ouvrir ->
complVerbAdj : AdjCompl -> VerbPhrase -> Complemnt = \facile,ouvrir ->
complCopula (\\g,n,p =>
facile.s ! AF g n ++ prepCase facile.c ++
facile.s ! AF g n ++ prepCase facile.c ++ facile.s2 ++
ouvrir.s ! VIInfinit ! g ! n ! p) ;
complVerbAdj2 : Bool -> AdjCompl -> NounPhrase -> VerbPhrase -> Complemnt =
\b,facile,lui,nager ->
complTransVerbGen (copula ** {c = dative ; s2=[]}) lui
(\\g,n,p =>
facile.s ! AF g n ++ prepCase facile.c ++ facile.s2 ++
nager.s ! VIInfinit ! g ! n ! p) ; ---- agr dep on b
progressiveVerbPhrase : VerbPhrase -> VerbGroup ;
-- Passivization is like adjectival predication.
passVerb : Verb -> Complemnt = \aimer ->
@@ -670,10 +679,10 @@ oper
-- as well as the position: "est toujours heureux" / "est heureux à Paris".)
Adverb : Type = SS ;
{-
adVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \chante, bien ->
{s = \\g,v => chante.s ! g ! v ++ bien.s} ;
-}
adVerbPhrase : VerbGroup -> Adverb -> VerbGroup = \chante, bien ->
{s = \\b,g,v => chante.s ! b ! g ! v ++ bien.s} ;
-- Adverbs are typically generated by prefixing prepositions.
-- The rule for prepositional phrases also comprises the use of prepositions
-- treated as cases. Therefore, both a preposition and a case are needed
@@ -726,6 +735,14 @@ param
;
oper
useClForm : Tense -> Anteriority -> Mode -> ClForm =
\t,a,m -> case t of {
Present => ClPres a m ;
Past => ClImperf a m ; --- no passé simple
Future => ClFut a ; ---- mode
Condit => ClCondit a
} ;
Clause = {s : Bool => ClForm => Str} ;
---- VIForm = VIInfinit | VIImperat Bool Number ;
@@ -828,11 +845,25 @@ oper
----- let m = if_then_else Mode b croire.mp croire.mn
embedConj ++ jeanboit.s ! croire.mp) ;
complQuestVerb : Verb -> Question -> Complemnt = \demander,sijeanboit ->
complDitransSentVerb :
(TransVerb ** {mp, mn : Mode}) -> NounPhrase -> Sentence -> Complemnt =
\dire,lui,jeanboit ->
complTransVerbGen
dire lui
(\\g,n,p =>
embedConj ++ jeanboit.s ! dire.mp) ;
complQuestVerb : Verb -> QuestionSent -> Complemnt = \demander,sijeanboit ->
mkCompl
demander
(\\g,n,p => sijeanboit.s ! IndirQ) ;
complDitransQuestVerb : TransVerb -> NounPhrase -> QuestionSent -> Complemnt =
\dire,lui,jeanboit ->
complTransVerbGen
dire lui
(\\g,n,p => jeanboit.s ! IndirQ) ;
complAdjVerb : Verb -> AdjPhrase -> Complemnt = \sent,bon ->
mkCompl sent (\\g,n,_ => bon.s ! AF g n) ;
@@ -869,14 +900,12 @@ oper
-- Notice that the slash category has the same relation to sentences as
-- transitive verbs have to verbs: it's like a *sentence taking a complement*.
SentenceSlashNounPhrase = Sentence ** Complement ;
ClauseSlashNounPhrase = Clause ** Complement ;
{- ----
slashTransVerb : Bool -> NounPhrase -> TransVerb -> SentenceSlashNounPhrase =
\b,jean,aimer ->
predVerbPhrase jean (predVerbGroup b (predVerb (verbOfTransVerb aimer))) **
slashTransVerb : NounPhrase -> TransVerb -> ClauseSlashNounPhrase =
\jean,aimer ->
predVerbGroupClause jean (predClauseGroup aimer (complVerb aimer)) **
complementOfTransVerb aimer ;
-}
--2 Relative pronouns and relative clauses
--
@@ -890,7 +919,9 @@ oper
oper
RelPron : Type = {s : RelFormA => Str ; g : RelGen} ;
RelClause : Type = {s : Mode => Gender => Number => Str} ;
RelClause : Type = {s : Bool => ClForm => Gender => Number => Person => Str} ;
RelSentence : Type = {s : Mode => Gender => Number => Person => Str} ;
mkGenRel : RelGen -> Gender -> Gender = \rg,g -> case rg of {
RG gen => gen ;
@@ -915,21 +946,22 @@ oper
-- Relative clauses can be formed from both verb phrases ("qui dort") and
-- slash expressions ("que je vois", "dont je parle").
{- -----
relVerbPhrase : RelPron -> VerbPhrase -> RelClause = \qui,dort ->
{s = \\m,g,n =>
allRelForms qui g n nominative ++ dort.s ! g ! VPF Simul (VFin (VPres m) n P3)
relVerbPhrase : RelPron -> VerbGroup -> RelClause = \qui,dort ->
{s = \\b,cl,g,n,p =>
allRelForms qui g n nominative ++ dort.s ! b ! g ! cl2vp cl n p
} ;
-}
relSlash : RelPron -> SentenceSlashNounPhrase -> RelClause = \dont,jeparle ->
{s = \\m,g,n => jeparle.s2 ++ allRelForms dont g n jeparle.c ++ jeparle.s ! m
relSlash : RelPron -> ClauseSlashNounPhrase -> RelClause = \dont,jeparle ->
{s = \\b,cl,g,n,p =>
jeparle.s2 ++ allRelForms dont g n jeparle.c ++ jeparle.s ! b ! cl
} ;
-- A 'degenerate' relative clause is the one often used in mathematics, e.g.
-- "nombre x tel que x soit pair".
relSuch : Sentence -> RelClause = \A ->
{s = \\m,g,n => suchPron g n ++ embedConj ++ A.s ! m
relSuch : Clause -> RelClause = \A ->
{s = \\b,cl,g,n,p => suchPron g n ++ embedConj ++ A.s ! b ! cl
} ;
suchPron : Gender -> Number -> Str ;
@@ -942,8 +974,8 @@ oper
-- ("je cherche un mec qui sache chanter") must have another structure
-- (unless common noun phrases are given a mode parameter...).
modRelClause : CommNounPhrase -> RelClause -> CommNounPhrase = \mec,quidort ->
{s = \\n => mec.s ! n ++ quidort.s ! Ind ! mec.g ! n ;
modRelClause : CommNounPhrase -> RelSentence -> CommNounPhrase = \mec,quidort ->
{s = \\n => mec.s ! n ++ quidort.s ! Ind ! mec.g ! n ! P3 ;
g = mec.g
} ;
@@ -990,7 +1022,7 @@ oper
Utterance = SS ;
indicUtt : Sentence -> Utterance = \x -> ss (x.s ! Ind ++ ".") ;
interrogUtt : Question -> Utterance = \x -> ss (x.s ! DirQ ++ "?") ;
interrogUtt : QuestionSent -> Utterance = \x -> ss (x.s ! DirQ ++ "?") ;
--2 Questions
--
@@ -1001,7 +1033,8 @@ param
QuestForm = DirQ | IndirQ ;
oper
Question = SS1 QuestForm ;
Question = {s : Bool => ClForm => QuestForm => Str} ;
QuestionSent = {s : QuestForm => Str} ;
--3 Yes-no questions
@@ -1017,6 +1050,13 @@ oper
-- The leading "est-ce que" is recognized as a variant, and requires
-- direct word order.
questClause : Clause -> Question = \cl ->
{s = \\b,c => table {
DirQ => cl.s ! b ! c ;
IndirQ => cl.s ! b ! c
}
} ;
----- questVerbPhrase : NounPhrase -> VerbPhrase -> Question ;
-- The existence question is treated separately.
@@ -1030,9 +1070,10 @@ oper
--
-- N.B. inversion variants and "est-ce que" are treated as above.
----- intVerbPhrase : IntPron -> VerbPhrase -> Question ;
intVerbPhrase : IntPron -> VerbGroup -> Question = \ip,vg ->
questClause (predVerbGroupClause (ip ** {p = P3 ; c = Clit0}) vg) ;
intSlash : IntPron -> SentenceSlashNounPhrase -> Question ;
intSlash : IntPron -> ClauseSlashNounPhrase -> Question ;
--3 Interrogative adverbials
@@ -1047,7 +1088,18 @@ oper
IntAdverb = SS ;
----- questAdverbial : IntAdverb -> NounPhrase -> VerbPhrase -> Question ;
questAdverbial : IntAdverb -> Clause -> Question =
\quand, jeanDort ->
{s = \\b,cl =>
let
jeandort = jeanDort.s ! b ! cl
in
table {
DirQ => quand.s ++ jeandort ; ---- est-ce que
IndirQ => quand.s ++ jeandort
}
} ;
--2 Imperatives
@@ -1175,6 +1227,7 @@ oper
{s = \\c => co.s1++ xs.s1 ! pform2case c ++ co.s2 ++ xs.s2 ! pform2case c} **
{n = conjNumber co.n xs.n ; g = xs.g ; p = xs.p ; c = Clit0} ;
-- We have to define a calculus of numbers of genders. For numbers,
-- it is like the conjunction with $Pl$ corresponding to $False$. For genders,
-- $Masc$ corresponds to $False$.
@@ -1204,6 +1257,34 @@ oper
<_,P1> => P1 ;
_ => P2
} ;
--3 Coordinating adverbs
--
-- We need a category of lists of adverbs. It is a discontinuous
-- category, the parts corresponding to 'init' and 'last' segments
-- (rather than 'head' and 'tail', because we have to keep track of the slot between
-- the last two elements of the list). A list has at least two elements.
ListAdverb : Type = SD2 ;
twoAdverb : (_,_ : Adverb) -> ListAdverb = CO.twoSS ;
consAdverb : ListAdverb -> Adverb -> ListAdverb =
CO.consSS CO.comma ;
-- To coordinate a list of adverbs by a simple conjunction, we place
-- it between the last two elements; commas are put in the other slots,
conjunctAdverb : Conjunction -> ListAdverb -> Adverb = \c,xs ->
ss (CO.conjunctX c xs) ;
-- To coordinate a list of adverbs by a distributed conjunction, we place
-- the first part (e.g. "either") in front of the first element, the second
-- part ("or") between the last two elements, and commas in the other slots.
conjunctDistrAdverb : ConjunctionDistr -> ListAdverb -> Adverb =
\c,xs ->
ss (CO.conjunctDistrX c xs) ;
@@ -1226,7 +1307,7 @@ oper
{s = \\g,n => subjunctVariants si A (B.s ! g ! n)
} ;
subjunctQuestion : Subjunction -> Sentence -> Question -> Question = \si,A,B ->
subjunctQuestion : Subjunction -> Sentence -> QuestionSent -> QuestionSent = \si,A,B ->
{s = \\q => subjunctVariants si A (B.s ! q)
} ;
@@ -1241,11 +1322,9 @@ oper
B ++ si.s ++ As
} ;
{- -----
subjunctVerbPhrase : VerbPhrase -> Subjunction -> Sentence -> VerbPhrase =
subjunctVerbPhrase : VerbGroup -> Subjunction -> Sentence -> VerbGroup =
\V, si, A ->
adVerbPhrase V (ss (si.s ++ A.s ! si.m)) ;
-}
--2 One-word utterances
--
@@ -1266,7 +1345,7 @@ oper
defaultNounPhrase : NounPhrase -> SS = \jean ->
ss (jean.s ! stressed nominative) ;
defaultQuestion : Question -> SS = \quiesttu ->
defaultQuestion : QuestionSent -> SS = \quiesttu ->
ss (quiesttu.s ! DirQ) ;
defaultSentence : Sentence -> SS = \x -> ss (x.s ! Ind) ;