forked from GitHub/gf-core
improved the performance of Romance while retaining correct agreement ; removed Diff modules from Phrasebook
This commit is contained in:
@@ -87,23 +87,21 @@ oper
|
||||
|
||||
infForm _ _ _ _ = True ;
|
||||
|
||||
mkImperative b p vp = {
|
||||
s = \\pol,agr =>
|
||||
mkImperative b p vp =
|
||||
\\pol,g,n =>
|
||||
let
|
||||
pe = case b of {True => P3 ; _ => p} ;
|
||||
---- agr = aag ** {p = pe} ;
|
||||
aag = verbAgr agr ; ----
|
||||
agr = {g = g ; n = n ; p = pe} ;
|
||||
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||
----e verb = case <aag.n, pol,pe> of {
|
||||
----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
|
||||
----e _ => (vp.s ! VPImperat).fin ! agr
|
||||
----e } ;
|
||||
verb = vp.s.s ! vImperForm agr ; ----e
|
||||
verb = vp.s.s ! vImper n pe ; ----e
|
||||
neg = vp.neg ! pol ;
|
||||
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
|
||||
in
|
||||
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;
|
||||
} ;
|
||||
|
||||
negation : Polarity => (Str * Str) = table {
|
||||
Pos => <[],[]> ;
|
||||
|
||||
@@ -4,10 +4,10 @@ concrete IdiomCat of Idiom = CatCat **
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ExistNP np = mkClause [] True (agrP3 Masc Sg)
|
||||
ExistNP np = mkClause [] True False (agrP3 Masc Sg)
|
||||
(insertClit3 "hi" (insertComplement (\\_ => (np.s ! Acc).ton) (predV haver_V))) ;
|
||||
GenericCl vp = mkClause "hom" True (agrP3 Masc Sg) vp ;
|
||||
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
|
||||
GenericCl vp = mkClause "hom" True False (agrP3 Masc Sg) vp ;
|
||||
ImpersCl vp = mkClause [] True False (agrP3 Masc Sg) vp ;
|
||||
|
||||
|
||||
ProgrVP vp =
|
||||
@@ -23,7 +23,7 @@ concrete IdiomCat of Idiom = CatCat **
|
||||
|
||||
----AR, for completeness
|
||||
|
||||
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
|
||||
CleftNP np rs = mkClause [] True False (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => rs.s ! Indic ! np.a)
|
||||
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
|
||||
|
||||
@@ -31,17 +31,17 @@ concrete IdiomCat of Idiom = CatCat **
|
||||
ExistIP ip = {
|
||||
s = \\t,a,p,_ =>
|
||||
ip.s ! Nom ++
|
||||
(mkClause [] True
|
||||
(mkClause [] True False
|
||||
(agrP3 Masc Sg)
|
||||
(insertClit3 "hi" (insertComplement (\\_ => ip.s ! Acc) (predV haver_V))))
|
||||
.s ! DDir ! t ! a ! p ! Indic
|
||||
} ;
|
||||
|
||||
ImpPl1 vp = {s =
|
||||
(mkImperative False P1 vp).s ! Pos ! Ag Masc Pl P1 ; --- fem
|
||||
mkImperative False P1 vp ! Pos ! Masc ! Pl --- fem
|
||||
} ;
|
||||
|
||||
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg)
|
||||
CleftAdv ad s = mkClause [] True False (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => conjThat ++ s.s ! Indic)
|
||||
(insertComplement (\\_ => ad.s) (predV copula))) ;
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ oper
|
||||
_ => ses
|
||||
} ;
|
||||
a = Ag g n p ;
|
||||
hasClit = True
|
||||
hasClit = True ; isPol = False
|
||||
} ;
|
||||
|
||||
elisPoss : Str -> Str = \s ->
|
||||
|
||||
@@ -316,7 +316,7 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ;
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False} ** {lock_NP = <>} ;
|
||||
|
||||
mk5A a b c d e =
|
||||
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;
|
||||
|
||||
@@ -118,21 +118,21 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
|
||||
_ => <pdat ++ pacc, []>
|
||||
} ;
|
||||
|
||||
mkImperative b p vp = {
|
||||
s = \\pol,ag =>
|
||||
mkImperative b p vp =
|
||||
\\pol,g,n =>
|
||||
let
|
||||
agr = verbAgr ag ;
|
||||
num = if_then_else Number b Pl agr.n ;
|
||||
verb = vp.s.s ! vImperForm ag ;
|
||||
agr = Ag g n p ;
|
||||
num = if_then_else Number b Pl n ;
|
||||
verb = vp.s.s ! vImper n p ;
|
||||
neg = vp.neg ! pol ;
|
||||
clpr = <vp.clit1 ++ vp.clit2, False> ; ---- TODO: True if clit
|
||||
compl = vp.comp ! ag ++ vp.ext ! pol
|
||||
compl = vp.comp ! agr ++ vp.ext ! pol
|
||||
in
|
||||
case pol of {
|
||||
Pos => verb ++ if_then_Str clpr.p2 "-" [] ++ clpr.p1 ++ compl ;
|
||||
Neg => neg.p1 ++ clpr.p1 ++ verb ++ neg.p2 ++ compl
|
||||
}
|
||||
} ; ---- TODO: vois-le vs. vois-moi vs. ne me vois pas
|
||||
} ;
|
||||
---- TODO: vois-le vs. vois-moi vs. ne me vois pas
|
||||
|
||||
|
||||
negation : Polarity => (Str * Str) = table {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
concrete ExtraFre of ExtraFreAbs = ExtraRomanceFre **
|
||||
open CommonRomance, PhonoFre, MorphoFre, ParadigmsFre, ParamX, ResFre in {
|
||||
open CommonRomance, PhonoFre, MorphoFre, ParadigmsFre, ParamX, ResFre, Prelude in {
|
||||
|
||||
lin
|
||||
EstcequeS qs = {s = "est-ce" ++ elisQue ++ qs.s ! Indic} ;
|
||||
@@ -42,8 +42,9 @@ concrete ExtraFre of ExtraFreAbs = ExtraRomanceFre **
|
||||
Fem Sg P2 ;
|
||||
youPl8fem_Pron,
|
||||
youPol8fem_Pron =
|
||||
let vous = mkPronoun "vous" "vous" "vous" "vous" "votre" "votre" "vos" Masc Pl P2
|
||||
in {s = vous.s ; hasClit = vous.hasClit ; poss = vous.poss ; a = AgPol Fem} ;
|
||||
let vous = mkPronoun "vous" "vous" "vous" "vous" "votre" "votre" "vos" Fem Pl P2
|
||||
in
|
||||
{s = vous.s ; hasClit = vous.hasClit ; poss = vous.poss ; a = vous.a ; isPol = True} ;
|
||||
|
||||
oper
|
||||
prepQue : Case -> Str = \c -> case c of {
|
||||
|
||||
@@ -4,26 +4,26 @@ concrete IdiomFre of Idiom = CatFre **
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ImpersCl vp = mkClause "il" True (agrP3 Masc Sg) vp ;
|
||||
GenericCl vp = mkClause "on" True (agrP3 Masc Sg) vp ;
|
||||
ImpersCl vp = mkClause "il" True False (agrP3 Masc Sg) vp ;
|
||||
GenericCl vp = mkClause "on" True False (agrP3 Masc Sg) vp ;
|
||||
|
||||
ExistNP np =
|
||||
mkClause "il" True (agrP3 Masc Sg)
|
||||
mkClause "il" True False (agrP3 Masc Sg)
|
||||
(insertClit3 "y" (insertComplement (\\_ => (np.s ! Acc).ton) (predV avoir_V))) ;
|
||||
|
||||
ExistIP ip = {
|
||||
s = \\t,a,p,_ =>
|
||||
ip.s ! Nom ++
|
||||
(mkClause "il" True (agrP3 Masc Sg)
|
||||
(mkClause "il" True False (agrP3 Masc Sg)
|
||||
(insertClit3 "y" (predV avoir_V))).s
|
||||
! DDir ! t ! a ! p ! Indic ---- DInv
|
||||
} ;
|
||||
|
||||
CleftNP np rs = mkClause elisCe True (agrP3 Masc Sg)
|
||||
CleftNP np rs = mkClause elisCe True np.isPol (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => rs.s ! Indic ! np.a)
|
||||
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
|
||||
|
||||
CleftAdv ad s = mkClause elisCe True (agrP3 Masc Sg)
|
||||
CleftAdv ad s = mkClause elisCe True False (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => conjThat ++ s.s ! Indic)
|
||||
(insertComplement (\\_ => ad.s) (predV copula))) ;
|
||||
|
||||
@@ -33,12 +33,12 @@ concrete IdiomFre of Idiom = CatFre **
|
||||
(\\a => "en" ++ "train" ++ elisDe ++ infVP vp a)
|
||||
(predV copula) ;
|
||||
|
||||
ImpPl1 vp = {s =
|
||||
(mkImperative False P1 vp).s ! Pos ! Ag Masc Pl P1 --- fem
|
||||
ImpPl1 vp = {
|
||||
s = mkImperative False P1 vp ! Pos ! Masc ! Pl --- fem
|
||||
} ;
|
||||
|
||||
ImpP3 np vp = {
|
||||
s = (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s
|
||||
s = (mkClause (np.s ! Nom).comp np.hasClit False np.a vp).s
|
||||
! DInv ! RPres ! Simul ! Pos ! Conjunct
|
||||
} ;
|
||||
|
||||
|
||||
@@ -178,7 +178,8 @@ oper
|
||||
_ => ses
|
||||
} ;
|
||||
a = Ag g n p ;
|
||||
hasClit = True
|
||||
hasClit = True ;
|
||||
isPol = False
|
||||
} ;
|
||||
|
||||
elisPoss : Str -> Str = \s ->
|
||||
|
||||
@@ -403,7 +403,7 @@ oper
|
||||
--------------------------- obsolete
|
||||
|
||||
makeNP : Str -> Gender -> Number -> NP ;
|
||||
makeNP x g n = {s = (pn2np {s=x;g= g}).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ;
|
||||
makeNP x g n = {s = (pn2np {s=x;g= g}).s; a = agrP3 g n ; hasClit = False ; isPol = False ; lock_NP = <>} ;
|
||||
regPN : Str -> PN ;
|
||||
mk2PN : Str -> Gender -> PN = \x,g -> {s = x ; g = g} ** {lock_PN = <>} ;
|
||||
|
||||
|
||||
@@ -172,7 +172,8 @@ lin
|
||||
Masc Pl P2 ;
|
||||
youPol_Pron =
|
||||
let vous = mkPronoun "vous" "vous" "vous" "vous" "votre" "votre" "vos" Masc Pl P2
|
||||
in {s = vous.s ; hasClit = vous.hasClit ; poss = vous.poss ; a = AgPol Masc} ;
|
||||
in
|
||||
{s = vous.s ; hasClit = vous.hasClit ; poss = vous.poss ; a = vous.a ; isPol = True} ;
|
||||
|
||||
not_Predet = {s = \\a,c => prepCase c ++ "pas" ; c = Nom ; a = PNoAg} ;
|
||||
|
||||
|
||||
@@ -108,22 +108,21 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
|
||||
|
||||
infForm n p x y = (pronArg n p x y).p3 ;
|
||||
|
||||
mkImperative b p vp = {
|
||||
s = \\pol,agr =>
|
||||
mkImperative b p vp =
|
||||
\\pol,g,n =>
|
||||
let
|
||||
pe = case b of {True => P3 ; _ => p} ;
|
||||
---- agr = aag ** {p = pe} ;
|
||||
aag = verbAgr agr ; ----
|
||||
agr = {g = g ; n = n ; p = pe} ;
|
||||
clpr = <vp.clit1 ++ vp.clit2,[],False> ; ---- TODO: True is clit
|
||||
verb = case <aag.n, pol,pe> of {
|
||||
verb = case <n,pol,pe> of {
|
||||
<Sg,Neg,P2> => vp.s.s ! VInfin clpr.p3 ; ---- ! aag ;
|
||||
_ => vp.s.s ! vImperForm agr
|
||||
_ => vp.s.s ! vImper n pe
|
||||
} ;
|
||||
neg = vp.neg ! pol ;
|
||||
compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
|
||||
in
|
||||
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;
|
||||
} ; ---- TODO non mi mangi
|
||||
---- TODO non mi mangi
|
||||
|
||||
negation : Polarity => (Str * Str) = table {
|
||||
Pos => <[],[]> ;
|
||||
|
||||
@@ -4,22 +4,22 @@ concrete IdiomIta of Idiom = CatIta **
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
|
||||
ImpersCl vp = mkClause [] True False (agrP3 Masc Sg) vp ;
|
||||
|
||||
GenericCl vp =
|
||||
mkClause [] True (agrP3 Masc Sg) (insertRefl vp) ;
|
||||
mkClause [] True False (agrP3 Masc Sg) (insertRefl vp) ;
|
||||
|
||||
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
|
||||
CleftNP np rs = mkClause [] True False (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => rs.s ! Indic ! np.a)
|
||||
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
|
||||
|
||||
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg)
|
||||
CleftAdv ad s = mkClause [] True False (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => conjThat ++ s.s ! Indic)
|
||||
(insertComplement (\\_ => ad.s) (predV copula))) ;
|
||||
|
||||
ExistNP np =
|
||||
let npa = complAgr np.a in
|
||||
mkClause [] True (agrP3 npa.g npa.n)
|
||||
mkClause [] True False (agrP3 npa.g npa.n)
|
||||
(insertClit3 (elision "ci" "c'" "ci")
|
||||
(insertComplement (\\_ => (np.s ! Nom).ton)
|
||||
(predV copula))) ;
|
||||
@@ -27,7 +27,7 @@ concrete IdiomIta of Idiom = CatIta **
|
||||
ExistIP ip = {
|
||||
s = \\t,a,p,_ =>
|
||||
ip.s ! Nom ++
|
||||
(mkClause [] True (agrP3 ip.a.g ip.a.n)
|
||||
(mkClause [] True False (agrP3 ip.a.g ip.a.n)
|
||||
(insertClit3 (elision "ci" "c'" "ci")
|
||||
(predV copula))).s ! DDir ! t ! a ! p ! Indic
|
||||
} ;
|
||||
@@ -44,7 +44,7 @@ concrete IdiomIta of Idiom = CatIta **
|
||||
(predV (essereV (verboV (stare_16 "stare")))) ;
|
||||
|
||||
ImpPl1 vp = {s =
|
||||
(mkImperative False P1 vp).s ! Pos ! Ag Masc Pl P1 --- fem
|
||||
mkImperative False P1 vp ! Pos ! Masc ! Pl --- fem
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ oper
|
||||
<Pl,Fem> => see
|
||||
} ;
|
||||
a = Ag g n p ;
|
||||
hasClit = True
|
||||
hasClit = True ; isPol = False
|
||||
} ;
|
||||
|
||||
{- --e
|
||||
|
||||
@@ -321,7 +321,7 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ;
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False} ** {lock_NP = <>} ;
|
||||
|
||||
mk5A a b c d e =
|
||||
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;
|
||||
|
||||
@@ -63,12 +63,6 @@ oper
|
||||
_ => Masc
|
||||
} ;
|
||||
|
||||
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
|
||||
--
|
||||
@@ -123,6 +117,27 @@ param
|
||||
oper
|
||||
AAgr : Type = {g : Gender ; n : Number} ;
|
||||
|
||||
Agr : Type = {g : Gender ; n : Number ; p : Person} ;
|
||||
|
||||
complAgr : Agr -> {g : Gender ; n : Number} = \a -> {g = a.g ; n = a.n} ;
|
||||
|
||||
verbAgr : Agr -> {g : Gender ; n : Number ; p : Person} = \a -> a ;
|
||||
|
||||
conjAgr : Agr -> Agr -> Agr = \a,b ->
|
||||
{g = conjGender a.g b.g ; n = conjNumber a.n b.n ; p = conjPerson a.p b.p} ;
|
||||
|
||||
Ag : Gender -> Number -> Person -> Agr = \g,n,p -> {g = g ; n = n ; p = p} ;
|
||||
|
||||
-- The imperative forms depend on number and person.
|
||||
|
||||
vImper : Number -> Person -> VF = \n,p -> case <n,p> of {
|
||||
<Sg,P2> => VImper SgP2 ;
|
||||
<Pl,P1> => VImper PlP1 ;
|
||||
<Pl,P2> => VImper PlP2 ;
|
||||
_ => VInfin False
|
||||
} ;
|
||||
|
||||
{-
|
||||
param
|
||||
Agr = Ag Gender Number Person | AgPol Gender ;
|
||||
|
||||
@@ -136,6 +151,21 @@ param
|
||||
AgPol g => {g = g ; n = Pl ; p = P2}
|
||||
} ;
|
||||
|
||||
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)
|
||||
} ;
|
||||
|
||||
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
|
||||
} ;
|
||||
|
||||
-}
|
||||
param
|
||||
RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr
|
||||
PAgr = PAg Number | PNoAg ;
|
||||
@@ -159,23 +189,6 @@ oper
|
||||
|
||||
presInd = VPres Indic ;
|
||||
|
||||
-- The imperative forms depend on number and person.
|
||||
|
||||
vImper : Number -> Person -> VF = \n,p -> case <n,p> of {
|
||||
<Sg,P2> => VImper SgP2 ;
|
||||
<Pl,P1> => VImper PlP1 ;
|
||||
<Pl,P2> => VImper PlP2 ;
|
||||
_ => VInfin False
|
||||
} ;
|
||||
|
||||
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
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
|
||||
|
||||
-- To render imperatives (with their clitics etc).
|
||||
|
||||
oper mkImperative : Bool -> Person -> VP -> {s : Polarity => Agr => Str} ;
|
||||
oper mkImperative : Bool -> Person -> VP -> Polarity => Gender => Number => Str ;
|
||||
|
||||
--2 Constants that must derivatively depend on language
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ incomplete concrete QuestionRomance of Question =
|
||||
QuestVP qp vp = {
|
||||
s = \\t,a,b,_ =>
|
||||
let
|
||||
cl = mkClause (qp.s ! Nom) False (agrP3 qp.a.g qp.a.n) vp
|
||||
cl = mkClause (qp.s ! Nom) False False (agrP3 qp.a.g qp.a.n) vp
|
||||
in
|
||||
cl.s ! DDir ! t ! a ! b ! Indic
|
||||
} ;
|
||||
@@ -50,7 +50,7 @@ incomplete concrete QuestionRomance of Question =
|
||||
s = \\t,a,p,_ =>
|
||||
let
|
||||
vp = predV copula ;
|
||||
cls = (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s !
|
||||
cls = (mkClause (np.s ! Nom).comp np.hasClit np.isPol np.a vp).s !
|
||||
DInv ! t ! a ! p ! Indic ;
|
||||
why = icomp.s ! complAgr np.a ;
|
||||
in why ++ cls
|
||||
|
||||
@@ -15,12 +15,12 @@ incomplete concrete RelativeRomance of Relative =
|
||||
RelVP rp vp = case rp.hasAgr of {
|
||||
True => {s = \\ag =>
|
||||
(mkClause
|
||||
(rp.s ! False ! complAgr ag ! Nom) False
|
||||
(rp.s ! False ! complAgr ag ! Nom) False False
|
||||
(Ag rp.a.g rp.a.n P3)
|
||||
vp).s ! DDir ; c = Nom} ;
|
||||
False => {s = \\ag =>
|
||||
(mkClause
|
||||
(rp.s ! False ! complAgr ag ! Nom) False
|
||||
(rp.s ! False ! complAgr ag ! Nom) False False
|
||||
ag
|
||||
vp).s ! DDir ; c = Nom
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ oper
|
||||
NounPhrase : Type = {
|
||||
s : Case => {c1,c2,comp,ton : Str} ;
|
||||
a : Agr ;
|
||||
hasClit : Bool
|
||||
hasClit : Bool ;
|
||||
isPol : Bool --- only needed for French complement agr
|
||||
} ;
|
||||
Pronoun : Type = NounPhrase ** {
|
||||
poss : Number => Gender => Str ---- also: substantival
|
||||
@@ -24,7 +25,8 @@ oper
|
||||
heavyNP : {s : Case => Str ; a : Agr} -> NounPhrase = \np -> {
|
||||
s = \\c => {comp,ton = np.s ! c ; c1,c2 = []} ;
|
||||
a = np.a ;
|
||||
hasClit = False
|
||||
hasClit = False ;
|
||||
isPol = False
|
||||
} ;
|
||||
|
||||
Compl : Type = {s : Str ; c : Case ; isDir : Bool} ;
|
||||
@@ -188,19 +190,22 @@ oper
|
||||
ext : Polarity => Str ; -- que je dors / que je dorme
|
||||
} ;
|
||||
|
||||
mkClause : Str -> Bool -> Agr -> VP ->
|
||||
mkClause : Str -> Bool -> Bool -> Agr -> VP ->
|
||||
{s : Direct => RTense => Anteriority => Polarity => Mood => Str} =
|
||||
\subj, hasClit, ag, vp -> {
|
||||
\subj, hasClit, isPol, agr, vp -> {
|
||||
s = \\d,te,a,b,m =>
|
||||
let
|
||||
neg = vp.neg ! b ;
|
||||
compl = vp.comp ! ag ++ vp.ext ! b ;
|
||||
neg = vp.neg ! b ;
|
||||
|
||||
agr = verbAgr ag ;
|
||||
gen = agr.g ;
|
||||
num = agr.n ;
|
||||
per = agr.p ;
|
||||
|
||||
compl = case isPol of {
|
||||
True => vp.comp ! {g = gen ; n = Sg ; p = per} ;
|
||||
_ => vp.comp ! agr
|
||||
} ++ vp.ext ! b ;
|
||||
|
||||
vtyp = vp.s.vtyp ;
|
||||
refl = case vtyp of {
|
||||
VRefl => reflPron num per Acc ; ---- case ?
|
||||
|
||||
@@ -4,13 +4,13 @@ incomplete concrete SentenceRomance of Sentence =
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
PredVP np vp = mkClause (np.s ! Nom).comp np.hasClit np.a vp ;
|
||||
PredVP np vp = mkClause (np.s ! Nom).comp np.hasClit np.isPol np.a vp ;
|
||||
|
||||
PredSCVP sc vp = mkClause sc.s False (agrP3 Masc Sg) vp ;
|
||||
PredSCVP sc vp = mkClause sc.s False False (agrP3 Masc Sg) vp ;
|
||||
|
||||
ImpVP vp = {
|
||||
s = \\p,i,g => case i of {
|
||||
ImpF n b => (mkImperative b P2 vp).s ! p ! (Ag g n P2) ---- AgPol ?
|
||||
ImpF n b => mkImperative b P2 vp ! p ! g ! n ---- AgPol ?
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -23,7 +23,7 @@ incomplete concrete SentenceRomance of Sentence =
|
||||
---- <Acc,True> => insertAgr ag v2 ;
|
||||
---- _ => v2
|
||||
----e }
|
||||
in (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s ;
|
||||
in (mkClause (np.s ! Nom).comp np.hasClit np.isPol np.a vp).s ;
|
||||
c2 = v2.c2
|
||||
} ;
|
||||
|
||||
@@ -40,7 +40,7 @@ incomplete concrete SentenceRomance of Sentence =
|
||||
SlashVS np vs slash =
|
||||
{s = \\ag =>
|
||||
(mkClause
|
||||
(np.s ! Nom).comp np.hasClit np.a
|
||||
(np.s ! Nom).comp np.hasClit np.isPol np.a
|
||||
(insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b))
|
||||
(predV vs))
|
||||
).s ;
|
||||
|
||||
@@ -90,24 +90,21 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
|
||||
|
||||
infForm _ _ _ _ = True ;
|
||||
|
||||
mkImperative b p vp = {
|
||||
s = \\pol,agr =>
|
||||
mkImperative b p vp =
|
||||
\\pol,g,n =>
|
||||
let
|
||||
pe = case b of {True => P3 ; _ => p} ;
|
||||
---- agr = aag ** {p = pe} ;
|
||||
aag = verbAgr agr ; ----
|
||||
|
||||
agr = {g = g ; n = n ; p = pe} ;
|
||||
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||
----e verb = case <aag.n, pol,pe> of {
|
||||
----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
|
||||
----e _ => (vp.s ! VPImperat).fin ! agr
|
||||
----e } ;
|
||||
verb = vp.s.s ! vImperForm agr ;
|
||||
verb = vp.s.s ! vImper n pe ;
|
||||
neg = vp.neg ! pol ;
|
||||
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
|
||||
in
|
||||
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;
|
||||
} ;
|
||||
|
||||
negation : Polarity => (Str * Str) = table {
|
||||
Pos => <[],[]> ;
|
||||
|
||||
@@ -4,27 +4,27 @@ concrete IdiomSpa of Idiom = CatSpa **
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
|
||||
ImpersCl vp = mkClause [] True False (agrP3 Masc Sg) vp ;
|
||||
|
||||
GenericCl vp =
|
||||
mkClause [] True (agrP3 Masc Sg) (insertRefl vp) ; ---- just Italian ?
|
||||
mkClause [] True False (agrP3 Masc Sg) (insertRefl vp) ; ---- just Italian ?
|
||||
|
||||
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
|
||||
CleftNP np rs = mkClause [] True False (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => rs.s ! Indic ! np.a)
|
||||
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
|
||||
|
||||
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg)
|
||||
CleftAdv ad s = mkClause [] True False (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => conjThat ++ s.s ! Indic)
|
||||
(insertComplement (\\_ => ad.s) (predV copula))) ;
|
||||
|
||||
|
||||
ExistNP np =
|
||||
mkClause [] True (agrP3 Masc Sg)
|
||||
mkClause [] True False (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => (np.s ! Acc).ton) (predV (verboV (hay_3 "haber")))) ;
|
||||
ExistIP ip = {
|
||||
s = \\t,a,p,_ =>
|
||||
ip.s ! Nom ++
|
||||
(mkClause [] True (agrP3 Masc Sg) (predV (verboV (hay_3 "haber")))).s ! DDir ! t ! a ! p ! Indic
|
||||
(mkClause [] True False (agrP3 Masc Sg) (predV (verboV (hay_3 "haber")))).s ! DDir ! t ! a ! p ! Indic
|
||||
} ;
|
||||
|
||||
ProgrVP vp =
|
||||
@@ -39,7 +39,7 @@ concrete IdiomSpa of Idiom = CatSpa **
|
||||
(predV (verboV (estar_2 "estar"))) ;
|
||||
|
||||
ImpPl1 vp = {s =
|
||||
(mkImperative False P1 vp).s ! Pos ! Ag Masc Pl P1 ; --- fem
|
||||
mkImperative False P1 vp ! Pos ! Masc ! Pl ; --- fem
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ oper
|
||||
} ;
|
||||
|
||||
a = Ag g n p ;
|
||||
hasClit = True
|
||||
hasClit = True ; isPol = False
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ;
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False} ** {lock_NP = <>} ;
|
||||
|
||||
mk5A a b c d e =
|
||||
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;
|
||||
|
||||
Reference in New Issue
Block a user