forked from GitHub/gf-core
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 {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
param
|
||||
Prep = P_de | P_a ;
|
||||
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 (aagr a.g a.n) ; --- subty
|
||||
|
||||
placeNewClitic = \ci,c,pro,isc,old ->
|
||||
let new = if_then_Str isc (pro.s ! Aton c) []
|
||||
in
|
||||
case pro.a.p of {
|
||||
P1 | P2 => new ++ old ;
|
||||
_ => old ++ new
|
||||
} ;
|
||||
pronArg = \n,p,acc,dat ->
|
||||
let
|
||||
pacc = case acc of {
|
||||
CRefl => case p of {
|
||||
P3 => elision "s" ; --- use of reflPron incred. expensive
|
||||
_ => 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 {
|
||||
Pos => <[],[]> ;
|
||||
@@ -95,19 +109,35 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
|
||||
|
||||
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
|
||||
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 ;
|
||||
_ => moi
|
||||
} ;
|
||||
cases3 : (x,y,z : Str) -> Case -> Str = \les,leur,eux,c -> case c of {
|
||||
Acc => les ;
|
||||
CPrep P_a => leur ;
|
||||
_ => eux
|
||||
} ;
|
||||
in
|
||||
\\n,p => case <n,p> of {
|
||||
<Sg,P1> => cases (elision "m") "moi" ;
|
||||
<Sg,P2> => cases (elision "t") "toi" ;
|
||||
<Pl,P1> => \\_ => "nous" ;
|
||||
<Pl,P2> => \\_ => "vous" ;
|
||||
_ => cases (elision "s") "soi"
|
||||
\g,n,p -> case <g,n,p> of {
|
||||
<_,Sg,P1> => cases (elision "m") "moi" ;
|
||||
<_,Sg,P2> => cases (elision "t") "toi" ;
|
||||
<_,Pl,P1> => \_ -> "nous" ;
|
||||
<_,Pl,P2> => \_ -> "vous" ;
|
||||
<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 ;
|
||||
|
||||
@@ -8,4 +8,6 @@
|
||||
|
||||
instance ResFre of ResRomance = DiffFre ** open CommonRomance, Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -21,7 +21,7 @@ incomplete concrete AdjectiveRomance of Adjective =
|
||||
|
||||
ReflA2 adj = {
|
||||
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
|
||||
} ;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ incomplete concrete CatRomance of Cat =
|
||||
|
||||
-- Verb
|
||||
|
||||
VP = ResRomance.VP ;
|
||||
VP = CommonRomance.VP ;
|
||||
Comp = {s : Agr => Str} ;
|
||||
SC = {s : Str} ;
|
||||
|
||||
|
||||
@@ -113,6 +113,10 @@ oper
|
||||
param
|
||||
RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr
|
||||
|
||||
-- Clitic slots.
|
||||
|
||||
CAgr = CPron {g : Gender ; n : Number ; p : Person} | CRefl | CNone ; --- Agr
|
||||
|
||||
oper
|
||||
aagr : Gender -> Number -> AAgr = \g,n ->
|
||||
{g = g ; n = n} ;
|
||||
@@ -169,5 +173,20 @@ oper
|
||||
| VPAgrClit -- elle a dormi; elle les a vues
|
||||
{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 ;
|
||||
|
||||
-- If a new clitic is placed before an existing one.
|
||||
-- (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.)
|
||||
-- To render pronominal arguments as clitics and/or ordinary complements.
|
||||
|
||||
pronArg : Number -> Person -> CAgr -> CAgr -> Str * Str ;
|
||||
|
||||
--2 Constants that must derivatively depend on language
|
||||
|
||||
@@ -89,7 +81,8 @@ interface DiffRomance = open CommonRomance, Prelude in {
|
||||
|
||||
partQIndir : Str ; -- ce, ciò
|
||||
|
||||
reflPron : Number => Person => Case => Str ;
|
||||
reflPron : Number -> Person -> Case -> Str ;
|
||||
argPron : Gender -> Number -> Person -> Case -> Str ;
|
||||
|
||||
auxPassive : Verb ;
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
incomplete concrete PhraseRomance of Phrase =
|
||||
CatRomance ** open CommonRomance, ResRomance, Prelude in {
|
||||
|
||||
flags optimize = all_subs ;
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
interface ResRomance = DiffRomance ** open CommonRomance, Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--2 Constants uniformly defined in terms of language-dependent constants
|
||||
|
||||
@@ -38,21 +39,6 @@ oper
|
||||
_ => 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 ->
|
||||
comp.s ++ np ! Ton comp.c ;
|
||||
|
||||
@@ -77,11 +63,6 @@ oper
|
||||
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 {
|
||||
s = table {
|
||||
VPFinite t Simul => vf (vfin t) (\_ -> []) ;
|
||||
@@ -92,8 +73,11 @@ oper
|
||||
} ;
|
||||
agr = partAgr typ ;
|
||||
neg = negation ;
|
||||
clit1 = cli.p1 ;
|
||||
clInfo = cli.p2 ;
|
||||
clAcc = case isVRefl typ of {
|
||||
True => CRefl ;
|
||||
_ => CNone
|
||||
} ;
|
||||
clDat = CNone ; --- no dative refls
|
||||
clit2 = [] ;
|
||||
comp = \\a => [] ;
|
||||
ext = \\p => []
|
||||
@@ -101,51 +85,58 @@ oper
|
||||
|
||||
insertObject : Compl -> Pronoun -> VP -> VP = \c,np,vp ->
|
||||
let
|
||||
cc : Bool * Str * VPAgr = case <c.isDir, c.c, np.hasClit> of {
|
||||
<False,_,_> |
|
||||
<_,_,False> => <False, c.s ++ np.s ! Ton c.c, vp.agr> ;
|
||||
<_,Acc,_> => <True, [], vpAgrClit np.a> ;
|
||||
_ => <True, [], vp.agr>
|
||||
vpacc = vp.clAcc ;
|
||||
vpdat = vp.clDat ;
|
||||
vpagr = vp.agr ;
|
||||
npa = np.a ;
|
||||
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 {
|
||||
s = vp.s ;
|
||||
agr = cc.p3 ;
|
||||
clit1 = \\a => placeNewClitic vp.clInfo c.c np cc.p1 (vp.clit1 ! a) ;
|
||||
clInfo = case cc.p1 of {
|
||||
False => vp.clInfo ; -- no new clitic
|
||||
_ => <c.c, np.a.n, np.a.p>
|
||||
} ;
|
||||
agr = cc.p4 ;
|
||||
clAcc = cc.p1 ;
|
||||
clDat = cc.p2 ;
|
||||
clit2 = vp.clit2 ;
|
||||
neg = vp.neg ;
|
||||
comp = \\a => vp.comp ! a ++ cc.p2 ;
|
||||
comp = \\a => vp.comp ! a ++ cc.p3 ;
|
||||
ext = vp.ext ;
|
||||
} ;
|
||||
|
||||
insertComplement : (Agr => Str) -> VP -> VP = \co,vp -> {
|
||||
s = vp.s ;
|
||||
agr = vp.agr ;
|
||||
clit1 = vp.clit1 ;
|
||||
clInfo = vp.clInfo ;
|
||||
clAcc = vp.clAcc ;
|
||||
clDat = vp.clDat ;
|
||||
clit2 = vp.clit2 ;
|
||||
neg = vp.neg ;
|
||||
comp = \\a => vp.comp ! a ++ co ! a ;
|
||||
ext = vp.ext ;
|
||||
} ;
|
||||
|
||||
insertAdv : Str -> VP -> VP = \co,vp -> {
|
||||
s = vp.s ;
|
||||
agr = vp.agr ;
|
||||
clit1 = vp.clit1 ;
|
||||
clInfo = vp.clInfo ;
|
||||
clAcc = vp.clAcc ;
|
||||
clDat = vp.clDat ;
|
||||
clit2 = vp.clit2 ;
|
||||
neg = vp.neg ;
|
||||
comp = \\a => vp.comp ! a ++ co ;
|
||||
ext = vp.ext ;
|
||||
} ;
|
||||
|
||||
insertExtrapos : (Polarity => Str) -> VP -> VP = \co,vp -> {
|
||||
s = vp.s ;
|
||||
agr = vp.agr ;
|
||||
clit1 = vp.clit1 ;
|
||||
clInfo = vp.clInfo ;
|
||||
clAcc = vp.clAcc ;
|
||||
clDat = vp.clDat ;
|
||||
clit2 = vp.clit2 ;
|
||||
neg = vp.neg ;
|
||||
comp = vp.comp ;
|
||||
@@ -167,20 +158,20 @@ oper
|
||||
verb = vps.fin ! agr ;
|
||||
inf = vps.inf ! (appVPAgr vp.agr (aagr agr.g agr.n)) ; --- subtype bug
|
||||
neg = vp.neg ! b ;
|
||||
clit = vp.clit1 ! agr ++ vp.clit2 ;
|
||||
compl = vp.comp ! agr ++ vp.ext ! b
|
||||
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||
compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! b
|
||||
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 ->
|
||||
let
|
||||
inf = (vp.s ! VPInfinit Simul).inf ! (aagr agr.g agr.n) ;
|
||||
neg = vp.neg ! Pos ; --- Neg not in API
|
||||
cli = vp.clit1 ! agr ++ vp.clit2 ;
|
||||
obj = vp.comp ! agr
|
||||
inf = (vp.s ! VPInfinit Simul).inf ! (aagr agr.g agr.n) ;
|
||||
neg = vp.neg ! Pos ; --- Neg not in API
|
||||
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||
obj = clpr.p2 ++ vp.comp ! agr
|
||||
in
|
||||
clitInf cli inf ++ obj ;
|
||||
clitInf clpr.p1 inf ++ obj ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ incomplete concrete VerbRomance of Verb =
|
||||
lin
|
||||
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) ;
|
||||
|
||||
@@ -34,7 +34,7 @@ incomplete concrete VerbRomance of Verb =
|
||||
ReflV2 v = case v.c2.isDir of {
|
||||
True => predV {s = v.s ; vtyp = vRefl} ;
|
||||
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) ;
|
||||
|
||||
Reference in New Issue
Block a user