mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-18 17:29:32 -06:00
order of clitiques and auxiliary
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
abstract Numerals = {
|
||||
|
||||
flags startcat=Numeral ;
|
||||
|
||||
cat
|
||||
Numeral ; -- 0..
|
||||
Digit ; -- 2..9
|
||||
|
||||
@@ -478,8 +478,8 @@ oper
|
||||
ced = troncVerb céder ;
|
||||
d = Predef.dp 1 ced ;
|
||||
c = Predef.tk 2 ced ;
|
||||
cèd = c + "è" + "d" ;
|
||||
céd = c + "é" + "d"
|
||||
cèd = c + "è" + d ;
|
||||
céd = c + "é" + d
|
||||
}
|
||||
in auxConj1 céd cèd céder ;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ lin
|
||||
ItNP = pronNounPhrase pronIl ;
|
||||
|
||||
EveryDet = chaqueDet ;
|
||||
AllMassDet = toutDet ;
|
||||
AllMassDet = toutDet ;
|
||||
AllNumDet = tousDet ;
|
||||
WhichDet = quelDet ;
|
||||
WhichNumDet = mkDeterminerNum plural "quels" "quelles" ;
|
||||
|
||||
@@ -25,7 +25,7 @@ oper
|
||||
|
||||
toutDet : Determiner =
|
||||
{s = \\g => genForms "tout" "toute" ! g ++ artDef g Sg nominative ;
|
||||
n = Pl
|
||||
n = Sg
|
||||
} ;
|
||||
tousDet : Numeral -> Determiner = \nu ->
|
||||
{s = \\g => genForms "tous" "toutes" ! g ++ artDef g Pl nominative ++ nu.s ! g ;
|
||||
@@ -91,10 +91,10 @@ oper
|
||||
copula = \b,w -> let etre = (predVerb verbEtre).s in
|
||||
etre ! b ! Masc ! w ;
|
||||
|
||||
isTransVerbClit = \v -> case v.c of {
|
||||
isClitCase = \c -> case c of {
|
||||
Acc => True ;
|
||||
Dat => True ;
|
||||
_ => False
|
||||
_ => False --- this is not quite correct
|
||||
} ;
|
||||
|
||||
auxVerb ve = case ve.aux of {
|
||||
|
||||
@@ -29,7 +29,7 @@ lin
|
||||
Drink = mkTransVerbDir (verbPres (conj3boire "boire") AHabere) ;
|
||||
Wait = mkTransVerbDir (verbPres (conj3rendre "attendre") AHabere) ;
|
||||
Give = mkDitransVerb (verbPres (conj1aimer "donner") AHabere) [] dative [] accusative ;
|
||||
Prefer = mkDitransVerb (verbPres (conj1aimer "preférer") AHabere) [] accusative [] dative ;
|
||||
Prefer = mkDitransVerb (verbPres (conj1céder "préférer") AHabere) [] accusative [] dative ;
|
||||
Say = verbSent (verbPres (conj3dire "dire") AHabere) Ind Ind ;
|
||||
Prove = verbSent (verbPres (conj1aimer "démontrer") AHabere) Ind Ind ;
|
||||
SwitchOn = mkTransVerbDir (verbPres (conj1aimer "allumer") AHabere) ;
|
||||
|
||||
@@ -121,8 +121,8 @@ lin
|
||||
PhrNP = useNounPhrase ;
|
||||
PhrOneCN = useCommonNounPhrase singular ;
|
||||
PhrManyCN = useCommonNounPhrase plural ;
|
||||
PhrIP ip = ip ;
|
||||
PhrIAdv ia = ia ;
|
||||
PhrIP ip = postfixSS "?" ip ;
|
||||
PhrIAdv ia = postfixSS "?" ia ;
|
||||
|
||||
OnePhr p = p ;
|
||||
ConsPhr = cc2 ;
|
||||
|
||||
@@ -428,6 +428,28 @@ oper
|
||||
formVerb : Verb -> Bool -> Gender -> VPForm -> Str = \aller,b,g,vf ->
|
||||
(predVerb aller).s ! b ! g ! vf ;
|
||||
|
||||
-- This is needed to take apart the auxiliary ("avoir" or "être") and
|
||||
-- the participle, to form correct order of negation and clitique.
|
||||
|
||||
formVerb2 : Verb -> Gender -> VPForm ->
|
||||
{verb : Str ; part : Gender => Number => Str} = \aller,g,vf ->
|
||||
case vf of {
|
||||
VPF Simul v => {
|
||||
verb = aller.s ! v ;
|
||||
part = \\_,_ => []
|
||||
} ;
|
||||
VPF Anter v => {
|
||||
verb = (auxVerb aller).s ! v ;
|
||||
part = --\\gen,num => --- cannot infer type
|
||||
table Gender {gen => table Number {num =>
|
||||
aller.s ! case aller.aux of {
|
||||
AEsse => VPart g (nombreVerb v) ;
|
||||
AHabere => VPart gen num
|
||||
}
|
||||
}}
|
||||
}
|
||||
} ;
|
||||
|
||||
negVerb : Str -> Str ;
|
||||
|
||||
-- Verb phrases can also be formed from adjectives ("est bon"),
|
||||
@@ -472,8 +494,12 @@ oper
|
||||
-- This function is language-dependent, because it uses the language-dependent
|
||||
-- type of case.
|
||||
|
||||
isTransVerbClit : TransVerb -> Bool ;
|
||||
isClitCase : CaseA -> Bool ;
|
||||
|
||||
isTransVerbClit : TransVerb -> Bool = \v -> isClitCase v.c ;
|
||||
|
||||
isDitransVerbClit : DitransVerb -> Bool * Bool = \v ->
|
||||
<isClitCase v.c,isClitCase v.c3> ;
|
||||
|
||||
--3 Transitive verbs
|
||||
--
|
||||
@@ -492,11 +518,13 @@ oper
|
||||
{s = \\b,g,w => ---- BUG: v gives stack overflow
|
||||
let
|
||||
Jean = jean.s ! (case2pformClit aime.c) ;
|
||||
Aime = formVerb aime b g w
|
||||
AAime = formVerb2 aime g w ;
|
||||
A = AAime.verb ;
|
||||
Aime = AAime.part ! pgen2gen jean.g ! jean.n
|
||||
in
|
||||
if_then_Str (andB (isNounPhraseClit jean) (isTransVerbClit aime))
|
||||
(Jean ++ Aime) ---- (posNeg b (Jean ++ Aime) [])
|
||||
(Aime ++ Jean) ---- (posNeg b Aime Jean)
|
||||
(posNeg b (Jean ++ A) Aime)
|
||||
(posNeg b A (Aime ++ Jean))
|
||||
} ;
|
||||
|
||||
mkTransVerb : Verb -> Preposition -> CaseA -> TransVerb = \v,p,c ->
|
||||
@@ -529,16 +557,18 @@ oper
|
||||
\v,p1,c1,p2,c2 ->
|
||||
v ** {s2 = p1 ; c = c1 ; s3 = p2 ; c3 = c2} ;
|
||||
|
||||
--- This must be completed to account for the order of the clitics, and also, to
|
||||
--- distinguish between different types of complements.
|
||||
--- This must be completed to account for the order of the clitics.
|
||||
|
||||
complDitransVerb :
|
||||
DitransVerb -> NounPhrase -> NounPhrase -> VerbGroup = \donner,jean,vin ->
|
||||
{s = \\b,g,w =>
|
||||
let
|
||||
donne = formVerb donner b g w ;
|
||||
cJean = isNounPhraseClit jean ;
|
||||
cVin = isNounPhraseClit vin ;
|
||||
adonne = formVerb2 donner g w ;
|
||||
a = adonne.verb ;
|
||||
donne = adonne.part ! pgen2gen vin.g ! vin.n ;
|
||||
isClit = isDitransVerbClit donner ;
|
||||
cJean = andB (isNounPhraseClit jean) (isClit.p1) ;
|
||||
cVin = andB (isNounPhraseClit vin) (isClit.p2) ;
|
||||
Jean = jean.s ! (case2pformClit donner.c) ;
|
||||
Vin = vin.s ! (case2pformClit donner.c3) ;
|
||||
aJean = if_then_Str cJean [] Jean ;
|
||||
@@ -546,10 +576,25 @@ oper
|
||||
lui = if_then_Str cJean Jean [] ;
|
||||
te = if_then_Str cVin Vin []
|
||||
in
|
||||
te ++ lui ++ donne ++ aJean ++ duVin
|
||||
---- posNeg b (te ++ lui ++ donne) (aJean ++ duVin)
|
||||
posNeg b (te ++ lui ++ a) (donne ++ aJean ++ duVin)
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
complTransVerb : TransVerb -> NounPhrase -> VerbGroup = \aime,jean ->
|
||||
{s = \\b,g,w => ---- BUG: v gives stack overflow
|
||||
let
|
||||
Jean = jean.s ! (case2pformClit aime.c) ;
|
||||
AAime = formVerb2 aime g w ;
|
||||
A = AAime.verb ;
|
||||
Aime = AAime.part ! pgen2gen jean.g ! jean.n
|
||||
in
|
||||
if_then_Str (andB (isNounPhraseClit jean) (isTransVerbClit aime))
|
||||
(posNeg b (Jean ++ A) Aime)
|
||||
(posNeg b A (Aime ++ Jean))
|
||||
} ;
|
||||
|
||||
|
||||
-- The following macro builds the "ne - pas" or "non" negation. The second
|
||||
-- string argument is used for the complement of a verb phrase. In Italian,
|
||||
-- one string argument would actually be enough.
|
||||
|
||||
Reference in New Issue
Block a user