mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-14 13:42:50 -06:00
changed representation of clitics in romance VP (French ready)
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
|
instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
param
|
param
|
||||||
Prep = P_de | P_a ;
|
Prep = P_de | P_a ;
|
||||||
NPForm = Ton Case | Aton Case | Poss {g : Gender ; n : Number} ; --- AAgr
|
NPForm = Ton Case | Aton Case | Poss {g : Gender ; n : Number} ; --- AAgr
|
||||||
@@ -57,13 +59,25 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
|
|||||||
vpAgrClit : Agr -> VPAgr = \a ->
|
vpAgrClit : Agr -> VPAgr = \a ->
|
||||||
VPAgrClit (aagr a.g a.n) ; --- subty
|
VPAgrClit (aagr a.g a.n) ; --- subty
|
||||||
|
|
||||||
placeNewClitic = \ci,c,pro,isc,old ->
|
pronArg = \n,p,acc,dat ->
|
||||||
let new = if_then_Str isc (pro.s ! Aton c) []
|
let
|
||||||
in
|
pacc = case acc of {
|
||||||
case pro.a.p of {
|
CRefl => case p of {
|
||||||
P1 | P2 => new ++ old ;
|
P3 => elision "s" ; --- use of reflPron incred. expensive
|
||||||
_ => old ++ new
|
_ => argPron Fem n p Acc
|
||||||
} ;
|
} ;
|
||||||
|
CPron a => argPron a.g a.n a.p Acc ;
|
||||||
|
_ => []
|
||||||
|
} ;
|
||||||
|
pdat = case dat of {
|
||||||
|
CPron a => argPron a.g a.n a.p dative ;
|
||||||
|
_ => []
|
||||||
|
} ;
|
||||||
|
in
|
||||||
|
case dat of {
|
||||||
|
CPron {p = P3} => <pacc ++ pdat,[]> ;
|
||||||
|
_ => <pdat ++ pacc, []>
|
||||||
|
} ;
|
||||||
|
|
||||||
negation : Polarity => (Str * Str) = table {
|
negation : Polarity => (Str * Str) = table {
|
||||||
Pos => <[],[]> ;
|
Pos => <[],[]> ;
|
||||||
@@ -95,19 +109,35 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
|
|||||||
|
|
||||||
partQIndir = elision "c" ;
|
partQIndir = elision "c" ;
|
||||||
|
|
||||||
reflPron : Number => Person => Case => Str =
|
reflPron : Number -> Person -> Case -> Str = \n,p,c ->
|
||||||
|
let pron = argPron Fem n p c in
|
||||||
|
case <p,c> of {
|
||||||
|
<P3, Acc | CPrep P_a> => elision "s" ;
|
||||||
|
<P3, _> => prepCase c ++ "soi" ;
|
||||||
|
_ => pron
|
||||||
|
} ;
|
||||||
|
|
||||||
|
argPron : Gender -> Number -> Person -> Case -> Str =
|
||||||
let
|
let
|
||||||
cases : (x,y : Str) -> (Case => Str) = \me,moi -> table {
|
cases : (x,y : Str) -> Case -> Str = \me,moi,c -> case c of {
|
||||||
Acc | CPrep P_a => me ;
|
Acc | CPrep P_a => me ;
|
||||||
_ => moi
|
_ => moi
|
||||||
} ;
|
} ;
|
||||||
|
cases3 : (x,y,z : Str) -> Case -> Str = \les,leur,eux,c -> case c of {
|
||||||
|
Acc => les ;
|
||||||
|
CPrep P_a => leur ;
|
||||||
|
_ => eux
|
||||||
|
} ;
|
||||||
in
|
in
|
||||||
\\n,p => case <n,p> of {
|
\g,n,p -> case <g,n,p> of {
|
||||||
<Sg,P1> => cases (elision "m") "moi" ;
|
<_,Sg,P1> => cases (elision "m") "moi" ;
|
||||||
<Sg,P2> => cases (elision "t") "toi" ;
|
<_,Sg,P2> => cases (elision "t") "toi" ;
|
||||||
<Pl,P1> => \\_ => "nous" ;
|
<_,Pl,P1> => \_ -> "nous" ;
|
||||||
<Pl,P2> => \\_ => "vous" ;
|
<_,Pl,P2> => \_ -> "vous" ;
|
||||||
_ => cases (elision "s") "soi"
|
<Fem,Sg,P3> => cases3 elisLa "lui" "elle" ;
|
||||||
|
<_,Sg,P3> => cases3 (elision "l") "lui" "lui" ;
|
||||||
|
<Fem,Pl,P3> => cases3 "les" "leur" "elles" ;
|
||||||
|
<_,Pl,P3> => cases3 "les" "leur" "eux"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
vRefl : VType = VRefl ;
|
vRefl : VType = VRefl ;
|
||||||
|
|||||||
@@ -8,4 +8,6 @@
|
|||||||
|
|
||||||
instance ResFre of ResRomance = DiffFre ** open CommonRomance, Prelude in {
|
instance ResFre of ResRomance = DiffFre ** open CommonRomance, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ incomplete concrete AdjectiveRomance of Adjective =
|
|||||||
|
|
||||||
ReflA2 adj = {
|
ReflA2 adj = {
|
||||||
s = \\af =>
|
s = \\af =>
|
||||||
adj.s ! Posit ! af ++ adj.c2.s ++ reflPron ! Sg ! P3 ! adj.c2.c ; --- agr
|
adj.s ! Posit ! af ++ adj.c2.s ++ reflPron Sg P3 adj.c2.c ; --- agr
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ incomplete concrete CatRomance of Cat =
|
|||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
VP = ResRomance.VP ;
|
VP = CommonRomance.VP ;
|
||||||
Comp = {s : Agr => Str} ;
|
Comp = {s : Agr => Str} ;
|
||||||
SC = {s : Str} ;
|
SC = {s : Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ oper
|
|||||||
param
|
param
|
||||||
RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr
|
RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr
|
||||||
|
|
||||||
|
-- Clitic slots.
|
||||||
|
|
||||||
|
CAgr = CPron {g : Gender ; n : Number ; p : Person} | CRefl | CNone ; --- Agr
|
||||||
|
|
||||||
oper
|
oper
|
||||||
aagr : Gender -> Number -> AAgr = \g,n ->
|
aagr : Gender -> Number -> AAgr = \g,n ->
|
||||||
{g = g ; n = n} ;
|
{g = g ; n = n} ;
|
||||||
@@ -169,5 +173,20 @@ oper
|
|||||||
| VPAgrClit -- elle a dormi; elle les a vues
|
| VPAgrClit -- elle a dormi; elle les a vues
|
||||||
{g : Gender ; n : Number} ;
|
{g : Gender ; n : Number} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
VP : Type = {
|
||||||
|
s : VPForm => {
|
||||||
|
fin : Agr => Str ; -- ai
|
||||||
|
inf : AAgr => Str -- dit
|
||||||
|
} ;
|
||||||
|
agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic
|
||||||
|
neg : Polarity => (Str * Str) ; -- ne-pas
|
||||||
|
clAcc : CAgr ; -- le/se
|
||||||
|
clDat : CAgr ; -- lui
|
||||||
|
clit2 : Str ; -- y en
|
||||||
|
comp : Agr => Str ; -- content(e) ; à ma mère ; hier
|
||||||
|
ext : Polarity => Str ; -- que je dors / que je dorme
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,17 +45,9 @@ interface DiffRomance = open CommonRomance, Prelude in {
|
|||||||
|
|
||||||
oper clitInf : Str -> Str -> Str ;
|
oper clitInf : Str -> Str -> Str ;
|
||||||
|
|
||||||
-- If a new clitic is placed before an existing one.
|
-- To render pronominal arguments as clitics and/or ordinary complements.
|
||||||
-- (Fre "le lui", Ita "glie lo").
|
|
||||||
|
|
||||||
placeNewClitic :
|
|
||||||
(Case * Number * Person) -> -- info on old clit
|
|
||||||
Case -> -- case of new clit
|
|
||||||
{s : NPForm => Str ; a : Agr ; hasClit : Bool} -> -- new clit
|
|
||||||
Bool -> -- whether to clit'ze
|
|
||||||
Str -> -- old clit
|
|
||||||
Str ; -- old + new (or rev.)
|
|
||||||
|
|
||||||
|
pronArg : Number -> Person -> CAgr -> CAgr -> Str * Str ;
|
||||||
|
|
||||||
--2 Constants that must derivatively depend on language
|
--2 Constants that must derivatively depend on language
|
||||||
|
|
||||||
@@ -89,7 +81,8 @@ interface DiffRomance = open CommonRomance, Prelude in {
|
|||||||
|
|
||||||
partQIndir : Str ; -- ce, ciò
|
partQIndir : Str ; -- ce, ciò
|
||||||
|
|
||||||
reflPron : Number => Person => Case => Str ;
|
reflPron : Number -> Person -> Case -> Str ;
|
||||||
|
argPron : Gender -> Number -> Person -> Case -> Str ;
|
||||||
|
|
||||||
auxPassive : Verb ;
|
auxPassive : Verb ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
incomplete concrete PhraseRomance of Phrase =
|
incomplete concrete PhraseRomance of Phrase =
|
||||||
CatRomance ** open CommonRomance, ResRomance, Prelude in {
|
CatRomance ** open CommonRomance, ResRomance, Prelude in {
|
||||||
|
|
||||||
|
flags optimize = all_subs ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
interface ResRomance = DiffRomance ** open CommonRomance, Prelude in {
|
interface ResRomance = DiffRomance ** open CommonRomance, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
--2 Constants uniformly defined in terms of language-dependent constants
|
--2 Constants uniformly defined in terms of language-dependent constants
|
||||||
|
|
||||||
@@ -38,21 +39,6 @@ oper
|
|||||||
_ => Ton c
|
_ => Ton c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
VP : Type = {
|
|
||||||
s : VPForm => {
|
|
||||||
fin : Agr => Str ; -- ai
|
|
||||||
inf : AAgr => Str -- dit
|
|
||||||
} ;
|
|
||||||
agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic
|
|
||||||
neg : Polarity => (Str * Str) ; -- ne-pas
|
|
||||||
clit1 : Agr => Str ; -- se lui
|
|
||||||
clInfo : Case * Number * Person ; -- whether and what fills clit1 (Nom = none)
|
|
||||||
clit2 : Str ; -- y en
|
|
||||||
comp : Agr => Str ; -- content(e) ; à ma mère ; hier
|
|
||||||
ext : Polarity => Str ; -- que je dors / que je dorme
|
|
||||||
} ;
|
|
||||||
|
|
||||||
appCompl : Compl -> (NPForm => Str) -> Str = \comp,np ->
|
appCompl : Compl -> (NPForm => Str) -> Str = \comp,np ->
|
||||||
comp.s ++ np ! Ton comp.c ;
|
comp.s ++ np ! Ton comp.c ;
|
||||||
|
|
||||||
@@ -77,11 +63,6 @@ oper
|
|||||||
inf = \\a => inf a
|
inf = \\a => inf a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
cli : (Agr => Str) * (Case * Number * Person) = case isVRefl typ of {
|
|
||||||
True => <\\a => reflPron ! a.n ! a.p ! Acc,<Acc,Sg,P3>> ; --- n,p
|
|
||||||
_ => <\\_ => [], <Nom,Sg,P1>> -- not care
|
|
||||||
} ;
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
s = table {
|
s = table {
|
||||||
VPFinite t Simul => vf (vfin t) (\_ -> []) ;
|
VPFinite t Simul => vf (vfin t) (\_ -> []) ;
|
||||||
@@ -92,8 +73,11 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
agr = partAgr typ ;
|
agr = partAgr typ ;
|
||||||
neg = negation ;
|
neg = negation ;
|
||||||
clit1 = cli.p1 ;
|
clAcc = case isVRefl typ of {
|
||||||
clInfo = cli.p2 ;
|
True => CRefl ;
|
||||||
|
_ => CNone
|
||||||
|
} ;
|
||||||
|
clDat = CNone ; --- no dative refls
|
||||||
clit2 = [] ;
|
clit2 = [] ;
|
||||||
comp = \\a => [] ;
|
comp = \\a => [] ;
|
||||||
ext = \\p => []
|
ext = \\p => []
|
||||||
@@ -101,51 +85,58 @@ oper
|
|||||||
|
|
||||||
insertObject : Compl -> Pronoun -> VP -> VP = \c,np,vp ->
|
insertObject : Compl -> Pronoun -> VP -> VP = \c,np,vp ->
|
||||||
let
|
let
|
||||||
cc : Bool * Str * VPAgr = case <c.isDir, c.c, np.hasClit> of {
|
vpacc = vp.clAcc ;
|
||||||
<False,_,_> |
|
vpdat = vp.clDat ;
|
||||||
<_,_,False> => <False, c.s ++ np.s ! Ton c.c, vp.agr> ;
|
vpagr = vp.agr ;
|
||||||
<_,Acc,_> => <True, [], vpAgrClit np.a> ;
|
npa = np.a ;
|
||||||
_ => <True, [], vp.agr>
|
noNewClit = <vpacc, vpdat, appCompl c np.s, vpagr> ;
|
||||||
|
|
||||||
|
cc : CAgr * CAgr * Str * VPAgr = case <np.hasClit,c.isDir> of {
|
||||||
|
<True,True> => case c.c of {
|
||||||
|
Acc => <CPron npa, vpdat, [], vpAgrClit npa> ;
|
||||||
|
_ => <vpacc, CPron npa, [], vpagr> -- must be dat
|
||||||
|
} ;
|
||||||
|
_ => noNewClit
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
s = vp.s ;
|
s = vp.s ;
|
||||||
agr = cc.p3 ;
|
agr = cc.p4 ;
|
||||||
clit1 = \\a => placeNewClitic vp.clInfo c.c np cc.p1 (vp.clit1 ! a) ;
|
clAcc = cc.p1 ;
|
||||||
clInfo = case cc.p1 of {
|
clDat = cc.p2 ;
|
||||||
False => vp.clInfo ; -- no new clitic
|
|
||||||
_ => <c.c, np.a.n, np.a.p>
|
|
||||||
} ;
|
|
||||||
clit2 = vp.clit2 ;
|
clit2 = vp.clit2 ;
|
||||||
neg = vp.neg ;
|
neg = vp.neg ;
|
||||||
comp = \\a => vp.comp ! a ++ cc.p2 ;
|
comp = \\a => vp.comp ! a ++ cc.p3 ;
|
||||||
ext = vp.ext ;
|
ext = vp.ext ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertComplement : (Agr => Str) -> VP -> VP = \co,vp -> {
|
insertComplement : (Agr => Str) -> VP -> VP = \co,vp -> {
|
||||||
s = vp.s ;
|
s = vp.s ;
|
||||||
agr = vp.agr ;
|
agr = vp.agr ;
|
||||||
clit1 = vp.clit1 ;
|
clAcc = vp.clAcc ;
|
||||||
clInfo = vp.clInfo ;
|
clDat = vp.clDat ;
|
||||||
clit2 = vp.clit2 ;
|
clit2 = vp.clit2 ;
|
||||||
neg = vp.neg ;
|
neg = vp.neg ;
|
||||||
comp = \\a => vp.comp ! a ++ co ! a ;
|
comp = \\a => vp.comp ! a ++ co ! a ;
|
||||||
ext = vp.ext ;
|
ext = vp.ext ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdv : Str -> VP -> VP = \co,vp -> {
|
insertAdv : Str -> VP -> VP = \co,vp -> {
|
||||||
s = vp.s ;
|
s = vp.s ;
|
||||||
agr = vp.agr ;
|
agr = vp.agr ;
|
||||||
clit1 = vp.clit1 ;
|
clAcc = vp.clAcc ;
|
||||||
clInfo = vp.clInfo ;
|
clDat = vp.clDat ;
|
||||||
clit2 = vp.clit2 ;
|
clit2 = vp.clit2 ;
|
||||||
neg = vp.neg ;
|
neg = vp.neg ;
|
||||||
comp = \\a => vp.comp ! a ++ co ;
|
comp = \\a => vp.comp ! a ++ co ;
|
||||||
ext = vp.ext ;
|
ext = vp.ext ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertExtrapos : (Polarity => Str) -> VP -> VP = \co,vp -> {
|
insertExtrapos : (Polarity => Str) -> VP -> VP = \co,vp -> {
|
||||||
s = vp.s ;
|
s = vp.s ;
|
||||||
agr = vp.agr ;
|
agr = vp.agr ;
|
||||||
clit1 = vp.clit1 ;
|
clAcc = vp.clAcc ;
|
||||||
clInfo = vp.clInfo ;
|
clDat = vp.clDat ;
|
||||||
clit2 = vp.clit2 ;
|
clit2 = vp.clit2 ;
|
||||||
neg = vp.neg ;
|
neg = vp.neg ;
|
||||||
comp = vp.comp ;
|
comp = vp.comp ;
|
||||||
@@ -167,20 +158,20 @@ oper
|
|||||||
verb = vps.fin ! agr ;
|
verb = vps.fin ! agr ;
|
||||||
inf = vps.inf ! (appVPAgr vp.agr (aagr agr.g agr.n)) ; --- subtype bug
|
inf = vps.inf ! (appVPAgr vp.agr (aagr agr.g agr.n)) ; --- subtype bug
|
||||||
neg = vp.neg ! b ;
|
neg = vp.neg ! b ;
|
||||||
clit = vp.clit1 ! agr ++ vp.clit2 ;
|
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||||
compl = vp.comp ! agr ++ vp.ext ! b
|
compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! b
|
||||||
in
|
in
|
||||||
subj ++ neg.p1 ++ clit ++ verb ++ neg.p2 ++ inf ++ compl
|
subj ++ neg.p1 ++ clpr.p1 ++ verb ++ neg.p2 ++ inf ++ compl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
infVP : VP -> Agr -> Str = \vp,agr ->
|
infVP : VP -> Agr -> Str = \vp,agr ->
|
||||||
let
|
let
|
||||||
inf = (vp.s ! VPInfinit Simul).inf ! (aagr agr.g agr.n) ;
|
inf = (vp.s ! VPInfinit Simul).inf ! (aagr agr.g agr.n) ;
|
||||||
neg = vp.neg ! Pos ; --- Neg not in API
|
neg = vp.neg ! Pos ; --- Neg not in API
|
||||||
cli = vp.clit1 ! agr ++ vp.clit2 ;
|
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||||
obj = vp.comp ! agr
|
obj = clpr.p2 ++ vp.comp ! agr
|
||||||
in
|
in
|
||||||
clitInf cli inf ++ obj ;
|
clitInf clpr.p1 inf ++ obj ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ incomplete concrete VerbRomance of Verb =
|
|||||||
lin
|
lin
|
||||||
UseV = predV ;
|
UseV = predV ;
|
||||||
|
|
||||||
ComplV2 v np = insertObject v.c2 np (predV v) ;
|
ComplV2 v np1 = insertObject v.c2 np1 (predV v) ;
|
||||||
|
|
||||||
ComplV3 v np np2 = insertObject v.c3 np2 (insertObject v.c2 np (predV v)) ;
|
ComplV3 v np1 np2 = insertObject v.c3 np2 (insertObject v.c2 np1 (predV v)) ;
|
||||||
|
|
||||||
ComplVV v vp = insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v) ;
|
ComplVV v vp = insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v) ;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ incomplete concrete VerbRomance of Verb =
|
|||||||
ReflV2 v = case v.c2.isDir of {
|
ReflV2 v = case v.c2.isDir of {
|
||||||
True => predV {s = v.s ; vtyp = vRefl} ;
|
True => predV {s = v.s ; vtyp = vRefl} ;
|
||||||
False => insertComplement
|
False => insertComplement
|
||||||
(\\a => v.c2.s ++ reflPron ! a.n ! a.p ! v.c2.c) (predV v)
|
(\\a => v.c2.s ++ reflPron a.n a.p v.c2.c) (predV v)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PassV2 v = insertComplement (\\a => v.s ! VPart a.g a.n) (predV auxPassive) ;
|
PassV2 v = insertComplement (\\a => v.s ! VPart a.g a.n) (predV auxPassive) ;
|
||||||
|
|||||||
Reference in New Issue
Block a user