1
0
forked from GitHub/gf-core

change in Romance agreement to produce correct number for polite singular pronouns ; linking functions that involve mkClause now takes a long time and should be revised

This commit is contained in:
aarne
2010-04-06 14:08:01 +00:00
parent f6db1ad200
commit d1d1c6215d
27 changed files with 118 additions and 69 deletions

View File

@@ -63,12 +63,12 @@ oper
_ => Masc
} ;
conjAgr : Agr -> Agr -> Agr = \a,b -> {
g = conjGender a.g b.g ;
n = conjNumber a.n b.n ;
p = conjPerson a.p b.p
} ;
conjAgr : Agr -> Agr -> Agr = \a,b -> case <a,b> of {
<Ag g n p, Ag h m q> => Ag (conjGender g h) (conjNumber n m) (conjPerson p q) ;
<Ag g n p, AgPol h> => Ag (conjGender g h) Pl (conjPerson p P2) ;
<AgPol h, Ag g n p> => Ag (conjGender g h) Pl (conjPerson p P2) ;
<AgPol g, AgPol h> => AgPol (conjGender g h)
} ;
--3 Verbs
--
@@ -122,7 +122,19 @@ param
oper
AAgr : Type = {g : Gender ; n : Number} ;
Agr : Type = AAgr ** {p : Person} ;
param
Agr = Ag Gender Number Person | AgPol Gender ;
oper
complAgr : Agr -> {g : Gender ; n : Number} = \a -> case a of {
Ag g n _ => {g = g ; n = n} ;
AgPol g => {g = g ; n = Sg} -- vous êtes fatiguée
} ;
verbAgr : Agr -> {g : Gender ; n : Number ; p : Person} = \a -> case a of {
Ag g n p => {g = g ; n = n ; p = p} ;
AgPol g => {g = g ; n = Pl ; p = P2}
} ;
param
RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr
@@ -137,7 +149,7 @@ oper
aagr : Gender -> Number -> AAgr = \g,n ->
{g = g ; n = n} ;
agrP3 : Gender -> Number -> Agr = \g,n ->
aagr g n ** {p = P3} ;
Ag g n P3 ;
vf2numpers : VF -> (Number * Person) = \v -> case v of {
@@ -156,11 +168,11 @@ oper
_ => VInfin False
} ;
vImperForm : Agr -> VF = \a -> case <a.n,a.p> of {
<Pl,P1> => VImper PlP1 ;
<_, P3> => VFin (VPres Conjunct) a.n P3 ;
<Sg,_> => VImper SgP2 ;
<Pl,_> => VImper PlP2
vImperForm : Agr -> VF = \a -> case a of {
Ag _ Pl P1 => VImper PlP1 ;
Ag _ n P3 => VFin (VPres Conjunct) n P3 ;
Ag _ Sg _ => VImper SgP2 ;
_ => VImper PlP2 -- covers French AgPol
} ;

View File

@@ -10,7 +10,7 @@ incomplete concrete ConjunctionRomance of Conjunction =
ConjAdv conj ss = conjunctDistrSS conj ss ;
ConjNP conj ss = heavyNP (conjunctDistrTable Case conj ss ** {
a = {g = ss.a.g ; n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
a = conjAgr (Ag Masc conj.n P3) ss.a ;
hasClit = False
}) ;
ConjAP conj ss = conjunctDistrTable AForm conj ss ** {

View File

@@ -49,7 +49,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
-- To render imperatives (with their clitics etc).
oper mkImperative : Bool -> Person -> VP -> {s : Polarity => AAgr => Str} ;
oper mkImperative : Bool -> Person -> VP -> {s : Polarity => Agr => Str} ;
--2 Constants that must derivatively depend on language

View File

@@ -18,16 +18,20 @@ incomplete concrete NounRomance of Noun =
UsePron p = p ;
PredetNP pred np = heavyNP {
s = \\c => pred.s ! aagr (np.a.g) (np.a.n) ! c ++ (np.s ! pred.c).ton ;
a = case pred.a of {PAg n => agrP3 np.a.g n ; _ => np.a} ;
hasClit = False
PredetNP pred np =
let agr = complAgr np.a in
heavyNP {
s = \\c => pred.s ! agr ! c ++ (np.s ! pred.c).ton ;
a = case pred.a of {PAg n => agrP3 agr.g n ; _ => np.a} ;
hasClit = False
} ;
PPartNP np v2 = heavyNP {
s = \\c => (np.s ! c).ton ++ v2.s ! VPart np.a.g np.a.n ;
a = np.a ;
hasClit = False
PPartNP np v2 =
let agr = complAgr np.a in
heavyNP {
s = \\c => (np.s ! c).ton ++ v2.s ! VPart agr.g agr.n ;
a = np.a ;
hasClit = False
} ;
RelNP np rs = heavyNP {

View File

@@ -52,7 +52,7 @@ incomplete concrete QuestionRomance of Question =
vp = predV copula ;
cls = (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s !
DInv ! t ! a ! p ! Indic ;
why = icomp.s ! {g = np.a.g ; n = np.a.n}
why = icomp.s ! complAgr np.a ;
in why ++ cls
} ;

View File

@@ -6,7 +6,7 @@ incomplete concrete RelativeRomance of Relative =
lin
RelCl cl = {
s = \\ag,t,a,p,m => pronSuch ! {g=ag.g; n=ag.n} ++ conjThat ++
s = \\ag,t,a,p,m => pronSuch ! complAgr ag ++ conjThat ++
cl.s ! DDir ! t ! a ! p ! m ;
c = Nom
} ;
@@ -15,12 +15,12 @@ incomplete concrete RelativeRomance of Relative =
RelVP rp vp = case rp.hasAgr of {
True => {s = \\ag =>
(mkClause
(rp.s ! False ! {g = ag.g ; n = ag.n} ! Nom) False
{g = rp.a.g ; n = rp.a.n ; p = P3}
(rp.s ! False ! complAgr ag ! Nom) False
(Ag rp.a.g rp.a.n P3)
vp).s ! DDir ; c = Nom} ;
False => {s = \\ag =>
(mkClause
(rp.s ! False ! {g = ag.g ; n = ag.n} ! Nom) False
(rp.s ! False ! complAgr ag ! Nom) False
ag
vp).s ! DDir ; c = Nom
}
@@ -28,7 +28,7 @@ incomplete concrete RelativeRomance of Relative =
RelSlash rp slash = {
s = \\ag,t,a,p,m =>
let aag = {g = ag.g ; n = ag.n}
let aag = complAgr ag
in
slash.c2.s ++
rp.s ! False ! aag ! slash.c2.c ++
@@ -38,7 +38,7 @@ incomplete concrete RelativeRomance of Relative =
FunRP p np rp = {
s = \\_,a,c => (np.s ! Nom).ton ++ p.s ++ rp.s ! True ! a ! p.c ;
a = {g = np.a.g ; n = np.a.n} ;
a = complAgr np.a ;
hasAgr = True
} ;
IdRP = {

View File

@@ -190,12 +190,13 @@ oper
mkClause : Str -> Bool -> Agr -> VP ->
{s : Direct => RTense => Anteriority => Polarity => Mood => Str} =
\subj, hasClit, agr, vp -> {
\subj, hasClit, ag, vp -> {
s = \\d,te,a,b,m =>
let
neg = vp.neg ! b ;
compl = vp.comp ! agr ++ vp.ext ! b ;
compl = vp.comp ! ag ++ vp.ext ! b ;
agr = verbAgr ag ;
gen = agr.g ;
num = agr.n ;
per = agr.p ;

View File

@@ -10,13 +10,13 @@ incomplete concrete SentenceRomance of Sentence =
ImpVP vp = {
s = \\p,i,g => case i of {
ImpF n b => (mkImperative b P2 vp).s ! p ! (aagr g n)
ImpF n b => (mkImperative b P2 vp).s ! p ! (Ag g n P2) ---- AgPol ?
}
} ;
SlashVP np v2 =
-- agreement decided afterwards: la fille qu'il a trouvée
{s = \\ag =>
{s = \\_ =>
let
vp = v2
----e vp = case <v2.c2.c, v2.c2.isDir> of {

View File

@@ -11,7 +11,7 @@ incomplete concrete VerbRomance of Verb =
ComplVS v s = insertExtrapos (\\b => conjThat ++ s.s ! (v.m ! b)) (predV v) ;
ComplVQ v q = insertExtrapos (\\_ => q.s ! QIndir) (predV v) ;
ComplVA v ap =
insertComplement (\\a => ap.s ! AF a.g a.n) (predV v) ;
insertComplement (\\a => let agr = complAgr a in ap.s ! AF agr.g agr.n) (predV v) ;
SlashV2a v = mkVPSlash v.c2 (predV v) ;
@@ -58,7 +58,7 @@ incomplete concrete VerbRomance of Verb =
ReflVP v = case v.c2.isDir of {
True => insertRefl v ;
False => insertComplement
(\\a => v.c2.s ++ reflPron a.n a.p v.c2.c) v
(\\a => let agr = verbAgr a in v.c2.s ++ reflPron agr.n agr.p v.c2.c) v
} ;
SlashVV v vp =
@@ -73,14 +73,15 @@ incomplete concrete VerbRomance of Verb =
UseComp comp = insertComplement comp.s (predV copula) ;
CompAP ap = {s = \\ag => ap.s ! AF ag.g ag.n} ;
CompAP ap = {s = \\ag => let agr = complAgr ag in ap.s ! AF agr.g agr.n} ;
CompNP np = {s = \\_ => (np.s ! Nom).ton} ;
CompAdv a = {s = \\_ => a.s} ;
AdvVP vp adv = insertAdv adv.s vp ;
AdVVP adv vp = insertAdV adv.s vp ;
PassV2 v = insertComplement (\\a => v.s ! VPart a.g a.n) (predV auxPassive) ;
PassV2 v = insertComplement
(\\a => let agr = complAgr a in v.s ! VPart agr.g agr.n) (predV auxPassive) ;
}