1
0
forked from GitHub/gf-core

adding tense to french

This commit is contained in:
aarne
2004-11-17 21:26:26 +00:00
parent 15fd8ec71b
commit 2754a5a758
4 changed files with 62 additions and 23 deletions

View File

@@ -105,7 +105,7 @@ oper
-- Exampe: 'to be or not to be'.
etreNetre : Bool -> VerbPres = \b ->
etreNetre : Bool -> Verb = \b ->
{s = \\w => posNeg b (verbEtre.s ! w) []} ; ---- v reveals a BUG in refresh
embedConj = elisQue ;
@@ -175,8 +175,8 @@ oper
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
dort.s ! qui.g ! VFin presInd qui.n P3 ;
IndirQ => "ce" ++ qui.s ! Nom ++ dort.s ! qui.g ! VFin presInd qui.n P3
}
} ;

View File

@@ -141,13 +141,20 @@ oper
-- Verbs: conversion from full verbs to present-tense verbs.
verbPres = \aller -> {s = table {
verbPres = \aller,a -> {s = table {
VInfin => aller ! Inf ;
VFin Ind n p => aller ! Indic Pres n p ;
VFin Sub n p => aller ! Subjo SPres n p ;
VFin (VPres Ind) n p => aller ! Indic Pres n p ;
VFin (VPres Sub) n p => aller ! Subjo SPres n p ;
VFin (VImperf Ind) n p => aller ! Indic Imparf n p ;
VFin (VImperf Sub) n p => aller ! Subjo SImparf n p ;
VFin VPasse n p => aller ! Indic Passe n p ;
VFin VFut n p => aller ! Indic Futur n p ;
VFin VCondit n p => aller ! Cond n p ;
VImper np => aller ! Imper np ;
VPart g n => aller ! Part (PPasse g n)
}} ;
} ;
aux = a
} ;
-- The full conjunction is a table on $VForm$:

View File

@@ -389,19 +389,38 @@ oper
-- So far we restrict the syntax to present-tense verbs, even though
-- morphology has complete conjugations.
VerbPhrase = {s : Gender => VF => Str} ;
VerbGroup = {s : Bool => Gender => VF => Str} ;
param
VPForm = VPF Anteriority VForm ;
Anteriority = Simul | Anter ;
oper
VerbPhrase = {s : Gender => VPForm => Str} ;
VerbGroup = {s : Bool => Gender => VPForm => Str} ;
predVerbGroup : Bool -> VerbGroup -> VerbPhrase = \b,vg -> {
s = vg.s ! b
} ;
Verb = VerbPres ;
auxVerb : Verb -> Verb ; -- gives the copula
-- Predication is language-dependent in the negative case.
predVerb : VerbPres -> VerbGroup = \aller ->
{s = \\b,_,v => if_then_Str b (aller.s ! v) (negVerb (aller.s ! v))} ;
predVerb : Verb -> VerbGroup = \aller ->
{s = \\b,g => table {
VPF Simul v => if_then_Str b (aller.s ! v) (negVerb (aller.s ! v)) ;
VPF Anter v =>
let
part = case aller.aux of {
AEsse => VPart g (nombreVerb v) ;
AHabere => VPart Masc Sg
} ;
allee = aller.s ! part ;
est = (auxVerb aller.aux).s ! v
in
if_then_Str b est (negVerb est) ++ allee
}
} ;
negVerb : Str -> Str ;
@@ -433,9 +452,9 @@ oper
-- complement a verb with noun phrase and optional preposition
TransVerb : Type = VerbPres ** Complement ;
TransVerb : Type = Verb ** Complement ;
verbOfTransVerb : TransVerb -> VerbPres = \v -> {s = v.s} ;
verbOfTransVerb : TransVerb -> Verb = \v -> {s = v.s} ;
complementOfTransVerb : TransVerb -> Complement = \v -> {s2 = v.s2 ; c = v.c} ;
isNounPhraseClit : NounPhrase -> Bool = \n -> case n.c of {
@@ -581,7 +600,7 @@ oper
predVerbPhrase : NounPhrase -> VerbPhrase -> Sentence = \jean,dort ->
{s = \\m => jean.s ! unstressed nominative ++
dort.s ! pgen2gen jean.g ! VFin m jean.n jean.p
dort.s ! pgen2gen jean.g ! VFin (VPres m) jean.n jean.p
} ;
@@ -592,12 +611,12 @@ oper
-- for positive and negative uses of the verb
-- ("je crois qu'elle vient" -"je ne crois pas qu'elle vienne"),
SentenceVerb : Type = VerbPres ** {mp, mn : Mode} ;
SentenceVerb : Type = Verb ** {mp, mn : Mode} ;
complSentVerb : SentenceVerb -> Sentence -> VerbGroup = \croire,jeanboit ->
{s = \\b,_,w =>
{s = \\b,g,w =>
let {m = if_then_else Mode b croire.mp croire.mn}
in posNeg b (croire.s ! w) (embedConj ++ jeanboit.s ! m)} ; ----w
in (predVerb croire).s ! b ! g ! w ++ (embedConj ++ jeanboit.s ! m)} ; ----w
verbSent : Verb -> Mode -> Mode -> SentenceVerb = \v,mp,mn ->
v ** {mp = mp ; mn = mn} ;
@@ -679,7 +698,8 @@ oper
-- 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 ! VFin m n P3
{s = \\m,g,n =>
allRelForms qui g n nominative ++ dort.s ! g ! VFin (VPres m) n P3
} ;
relSlash : RelPron -> SentenceSlashNounPhrase -> RelClause = \dont,jeparle ->

View File

@@ -155,10 +155,18 @@ oper
param
VF =
VFin Mode Number Person
VInfin
| VFin TMode Number Person
| VImper NumPersI
| VPart Gender Number
| VInfin
;
TMode =
VPres Mode
| VImperf Mode
| VPasse
| VFut
| VCondit
;
NumPersI = SgP2 | PlP1 | PlP2 ;
@@ -171,6 +179,7 @@ oper
_ => singular ---
} ;
presInd = VPres Ind ;
-- The imperative forms depend on number and person.
vImper : Number -> Person -> VF = \n,p -> case <n,p> of {
@@ -182,7 +191,10 @@ oper
Verbum : Type ;
VerbPres : Type = {s : VF => Str} ;
Verb : Type = {s : VF => Str ; aux : VAux} ;
verbPres : Verbum -> VAux -> Verb ;
param VAux = AEsse | AHabere ;
verbPres : Verbum -> VerbPres ;
}