forked from GitHub/gf-core
adding tense to french
This commit is contained in:
@@ -105,7 +105,7 @@ oper
|
|||||||
|
|
||||||
-- Exampe: 'to be or not to be'.
|
-- 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
|
{s = \\w => posNeg b (verbEtre.s ! w) []} ; ---- v reveals a BUG in refresh
|
||||||
|
|
||||||
embedConj = elisQue ;
|
embedConj = elisQue ;
|
||||||
@@ -175,8 +175,8 @@ oper
|
|||||||
intVerbPhrase = \qui, dort ->
|
intVerbPhrase = \qui, dort ->
|
||||||
{s = table {
|
{s = table {
|
||||||
DirQ => qui.s ! Nom ++ optStr (estCeQue Nom) ++
|
DirQ => qui.s ! Nom ++ optStr (estCeQue 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 Ind qui.n P3
|
IndirQ => "ce" ++ qui.s ! Nom ++ dort.s ! qui.g ! VFin presInd qui.n P3
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -141,13 +141,20 @@ oper
|
|||||||
|
|
||||||
-- Verbs: conversion from full verbs to present-tense verbs.
|
-- Verbs: conversion from full verbs to present-tense verbs.
|
||||||
|
|
||||||
verbPres = \aller -> {s = table {
|
verbPres = \aller,a -> {s = table {
|
||||||
VInfin => aller ! Inf ;
|
VInfin => aller ! Inf ;
|
||||||
VFin Ind n p => aller ! Indic Pres n p ;
|
VFin (VPres Ind) n p => aller ! Indic Pres n p ;
|
||||||
VFin Sub n p => aller ! Subjo SPres 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 ;
|
VImper np => aller ! Imper np ;
|
||||||
VPart g n => aller ! Part (PPasse g n)
|
VPart g n => aller ! Part (PPasse g n)
|
||||||
}} ;
|
} ;
|
||||||
|
aux = a
|
||||||
|
} ;
|
||||||
|
|
||||||
-- The full conjunction is a table on $VForm$:
|
-- The full conjunction is a table on $VForm$:
|
||||||
|
|
||||||
|
|||||||
@@ -389,19 +389,38 @@ oper
|
|||||||
-- So far we restrict the syntax to present-tense verbs, even though
|
-- So far we restrict the syntax to present-tense verbs, even though
|
||||||
-- morphology has complete conjugations.
|
-- morphology has complete conjugations.
|
||||||
|
|
||||||
VerbPhrase = {s : Gender => VF => Str} ;
|
param
|
||||||
VerbGroup = {s : Bool => Gender => VF => Str} ;
|
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 -> {
|
predVerbGroup : Bool -> VerbGroup -> VerbPhrase = \b,vg -> {
|
||||||
s = vg.s ! b
|
s = vg.s ! b
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Verb = VerbPres ;
|
auxVerb : Verb -> Verb ; -- gives the copula
|
||||||
|
|
||||||
|
|
||||||
-- Predication is language-dependent in the negative case.
|
-- Predication is language-dependent in the negative case.
|
||||||
|
|
||||||
predVerb : VerbPres -> VerbGroup = \aller ->
|
predVerb : Verb -> VerbGroup = \aller ->
|
||||||
{s = \\b,_,v => if_then_Str b (aller.s ! v) (negVerb (aller.s ! v))} ;
|
{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 ;
|
negVerb : Str -> Str ;
|
||||||
|
|
||||||
@@ -433,9 +452,9 @@ oper
|
|||||||
|
|
||||||
-- complement a verb with noun phrase and optional preposition
|
-- 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} ;
|
complementOfTransVerb : TransVerb -> Complement = \v -> {s2 = v.s2 ; c = v.c} ;
|
||||||
|
|
||||||
isNounPhraseClit : NounPhrase -> Bool = \n -> case n.c of {
|
isNounPhraseClit : NounPhrase -> Bool = \n -> case n.c of {
|
||||||
@@ -581,7 +600,7 @@ oper
|
|||||||
|
|
||||||
predVerbPhrase : NounPhrase -> VerbPhrase -> Sentence = \jean,dort ->
|
predVerbPhrase : NounPhrase -> VerbPhrase -> Sentence = \jean,dort ->
|
||||||
{s = \\m => jean.s ! unstressed nominative ++
|
{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
|
-- for positive and negative uses of the verb
|
||||||
-- ("je crois qu'elle vient" -"je ne crois pas qu'elle vienne"),
|
-- ("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 ->
|
complSentVerb : SentenceVerb -> Sentence -> VerbGroup = \croire,jeanboit ->
|
||||||
{s = \\b,_,w =>
|
{s = \\b,g,w =>
|
||||||
let {m = if_then_else Mode b croire.mp croire.mn}
|
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 ->
|
verbSent : Verb -> Mode -> Mode -> SentenceVerb = \v,mp,mn ->
|
||||||
v ** {mp = mp ; mn = mn} ;
|
v ** {mp = mp ; mn = mn} ;
|
||||||
@@ -679,7 +698,8 @@ oper
|
|||||||
-- slash expressions ("que je vois", "dont je parle").
|
-- slash expressions ("que je vois", "dont je parle").
|
||||||
|
|
||||||
relVerbPhrase : RelPron -> VerbPhrase -> RelClause = \qui,dort ->
|
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 ->
|
relSlash : RelPron -> SentenceSlashNounPhrase -> RelClause = \dont,jeparle ->
|
||||||
|
|||||||
@@ -155,10 +155,18 @@ oper
|
|||||||
|
|
||||||
param
|
param
|
||||||
VF =
|
VF =
|
||||||
VFin Mode Number Person
|
VInfin
|
||||||
|
| VFin TMode Number Person
|
||||||
| VImper NumPersI
|
| VImper NumPersI
|
||||||
| VPart Gender Number
|
| VPart Gender Number
|
||||||
| VInfin
|
;
|
||||||
|
|
||||||
|
TMode =
|
||||||
|
VPres Mode
|
||||||
|
| VImperf Mode
|
||||||
|
| VPasse
|
||||||
|
| VFut
|
||||||
|
| VCondit
|
||||||
;
|
;
|
||||||
|
|
||||||
NumPersI = SgP2 | PlP1 | PlP2 ;
|
NumPersI = SgP2 | PlP1 | PlP2 ;
|
||||||
@@ -171,6 +179,7 @@ oper
|
|||||||
_ => singular ---
|
_ => singular ---
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
presInd = VPres Ind ;
|
||||||
-- The imperative forms depend on number and person.
|
-- The imperative forms depend on number and person.
|
||||||
|
|
||||||
vImper : Number -> Person -> VF = \n,p -> case <n,p> of {
|
vImper : Number -> Person -> VF = \n,p -> case <n,p> of {
|
||||||
@@ -182,7 +191,10 @@ oper
|
|||||||
|
|
||||||
Verbum : Type ;
|
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 ;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user