simplified VP lincat in German and Romance

This commit is contained in:
aarne
2008-06-21 16:56:18 +00:00
parent 8c71cc884b
commit 2ee2d8d29e
20 changed files with 114 additions and 43 deletions

View File

@@ -10,7 +10,7 @@ concrete IdiomCat of Idiom = CatCat **
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
ProgrVP vp =
ProgrVP vpr = let vp = useVP vpr in
insertComplement
(\\agr =>
let

View File

@@ -355,7 +355,8 @@ lin
language_N = mk2N "sprog" "sproget" ;
rule_N = mkN "regel" "regeln" "regler" "reglerne" ;
---- question_N = regN "fråga" ;
question_N = mk2N "spørgsmål" "spørgsmålet" ;
---- ready_A = regA "färdig" ;
---- reason_N = regN "anledning" ;
today_Adv = mkAdv "idag" ;

View File

@@ -197,7 +197,7 @@ PredVP (UsePron i_Pron) (UseComp (CompAdv here_Adv))
-- Janna's and Krasimir's long examples
RelCN (UseN car_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (Us ePron they_Pron) (SlashV2VNP beg_V2V (UsePron i_Pron) (SlashVV want_VV (SlashV2A paint_V2A (PositA red_A)))))))
RelCN (UseN car_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron they_Pron) (SlashV2VNP beg_V2V (UsePron i_Pron) (SlashVV want_VV (SlashV2A paint_V2A (PositA red_A)))))))
PhrUtt NoPConj (UttImpSg PPos (ImpVP (AdVVP always_AdV (ComplSlash (SlashV2a listen_V2) (DetArtSg DefArt (UseN sea_N)))))) NoVoc
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (ExistNP (PredetNP only_Predet (DetCN (DetArtCard IndefArt (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) (AdvCN (SentCN (UseN woman_N) (EmbedQS (UseQCl TCond ASimul PPos (QuestSlash (IdetIP (IdetQuant which_IQuant NumPl)) (SlashPrep (PredVP (UsePron i_Pron) (ComplVV want_VV (PassV2 see_V2))) with_Prep))))) (PrepNP in_Prep (DetArtSg DefArt (UseN rain_N))))))))) NoVoc
PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2A paint_V2A (ConjAP both7and_DConj (BaseAP (ComparA small_A (DetArtSg DefArt (UseN sun_N))) (ComparA big_A (DetArtSg DefArt (UseN moon_N)))))) (DetArtSg DefArt (UseN earth_N))))) NoVoc

View File

@@ -62,7 +62,7 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
} ;
vpAgrClit : Agr -> VPAgr = \a ->
VPAgrClit (aagr a.g a.n) ; --- subty
VPAgrClit a.g a.n ;
---- pronArg = pronArgGen Neg ; --- takes more space and time

View File

@@ -33,7 +33,7 @@ concrete IdiomFre of Idiom = CatFre **
(\\a => "en" ++ "train" ++ elisDe ++ infVP vp a)
(predV copula) ;
ImpPl1 vp = {s =
ImpPl1 vpr = let vp = useVP vpr in {s =
(mkImperative False P1 vp).s ! Pos ! {n = Pl ; g = Masc} --- fem
} ;

View File

@@ -179,7 +179,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
} ;
RelNP np rs = {
s = \\c => np.s ! c ++ rs.s ! gennum np.a.g np.a.n ;
s = \\c => np.s ! c ++ "," ++ rs.s ! gennum np.a.g np.a.n ;
a = np.a ;
isPron = False
} ;

View File

@@ -367,11 +367,15 @@ resource ResGer = ParamX ** open Prelude in {
-- For $Verb$.
VP : Type = {
VPC : Type = {
s : Bool => Agr => VPForm => { -- True = prefix glued to verb
fin : Str ; -- hat
inf : Str -- wollen
} ;
}
} ;
VP : Type = {
s : Verb ;
a1 : Polarity => Str ; -- nicht
n2 : Agr => Str ; -- dich
a2 : Str ; -- heute
@@ -382,8 +386,10 @@ resource ResGer = ParamX ** open Prelude in {
predV : Verb -> VP = predVGen False ;
predVGen : Bool -> Verb -> VP = \isAux, verb ->
useVP : VP -> VPC = \vp ->
let
isAux = vp.isAux ;
verb = vp.s ;
vfin : Bool -> Mood -> Tense -> Agr -> Str = \b,m,t,a ->
verb.s ! vFin b m t a ;
vinf = verb.s ! VInf False ;
@@ -426,7 +432,18 @@ resource ResGer = ParamX ** open Prelude in {
VPImperat True => vf False (verb.s ! VFin False (VPresSubj Pl P3)) [] ;
VPInfinit Anter => vf True [] (vpart ++ haben) ; --# notpresent
VPInfinit Simul => vf True [] (verb.s ! VInf b)
} ;
}
} ;
predVGen : Bool -> Verb -> VP = \isAux, verb -> {
s = {
s = verb.s ;
prefix = verb.prefix ;
aux = verb.aux ;
vtype = verb.vtype
} ;
a1 : Polarity => Str = negation ;
n2 : Agr => Str = case verb.vtype of {
VAct => \\_ => [] ;
@@ -498,7 +515,7 @@ resource ResGer = ParamX ** open Prelude in {
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
s = vp.s ;
a1 = vp.a1 ;
n2 = \\a => vp.n2 ! a ++ obj ! a ;
n2 = \\a => obj ! a ++ vp.n2 ! a ;
a2 = vp.a2 ;
isAux = vp.isAux ;
inf = vp.inf ;
@@ -551,14 +568,14 @@ resource ResGer = ParamX ** open Prelude in {
s : Mood => Tense => Anteriority => Polarity => Order => Str
} ;
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> {
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> let vps = useVP vp in {
s = \\m,t,a,b,o =>
let
ord = case o of {
Sub => True ; -- glue prefix to verb
_ => False
} ;
verb = vp.s ! ord ! agr ! VPFinite m t a ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
neg = vp.a1 ! b ;
obj = vp.n2 ! agr ;
compl = obj ++ neg ++ vp.a2 ;
@@ -578,10 +595,10 @@ resource ResGer = ParamX ** open Prelude in {
}
} ;
infVP : Bool -> VP -> ((Agr => Str) * Str * Str) = \isAux, vp ->
infVP : Bool -> VP -> ((Agr => Str) * Str * Str) = \isAux, vp -> let vps = useVP vp in
<
\\agr => vp.n2 ! agr ++ vp.a2,
vp.a1 ! Pos ++ (vp.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf,
vp.a1 ! Pos ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf,
vp.inf ++ vp.ext
> ;

View File

@@ -8,7 +8,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
ImpVP vp = {
ImpVP vp = let vps = useVP vp in {
s = \\pol,n =>
let
ps = case n of {
@@ -16,7 +16,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
_ => <P2,[],False>
} ;
agr = {g = Fem ; n = numImp n ; p = ps.p1} ; --- g does not matter
verb = vp.s ! False ! agr ! VPImperat ps.p3 ;
verb = vps.s ! False ! agr ! VPImperat ps.p3 ;
inf = vp.inf ++ verb.inf ;
in
verb.fin ++ ps.p2 ++

View File

@@ -45,7 +45,7 @@ concrete StructuralGer of Structural = CatGer **
how8many_IDet = detLikeAdj Pl "wieviel" ;
if_Subj = ss "wenn" ;
in8front_Prep = mkPrep "vor" Dat ;
i_Pron = mkPronPers "ich" "mich" "mir" "meiner" "mein" Fem Sg P1 ;
i_Pron = mkPronPers "ich" "mich" "mir" "meiner" "mein" Masc Sg P1 ;
in_Prep = mkPrep "in" Dat ;
it_Pron = mkPronPers "es" "es" "ihm" "seiner" "sein" Neutr Sg P3 ;
less_CAdv = ss "weniger" ;

View File

@@ -78,7 +78,7 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
} ;
vpAgrClit : Agr -> VPAgr = \a ->
VPAgrClit (aagr a.g a.n) ; --- subty
VPAgrClit a.g a.n ; --- subty
pronArg = \n,p,acc,dat ->
let

View File

@@ -5,7 +5,9 @@ concrete IdiomIta of Idiom = CatIta **
lin
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
GenericCl vp = mkClause "si" True (agrP3 Masc Sg) vp ; ---- non se ci fanno cose
GenericCl vp =
mkClause [] True (agrP3 Masc Sg) (insertRefl vp) ;
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a)
@@ -29,7 +31,8 @@ concrete IdiomIta of Idiom = CatIta **
(predV copula))).s ! DDir ! t ! a ! p ! Indic
} ;
ProgrVP vp =
ProgrVP vpr =
let vp = useVP vpr in
insertComplement
(\\agr =>
let
@@ -40,7 +43,7 @@ concrete IdiomIta of Idiom = CatIta **
)
(predV (essereV (verboV (stare_16 "stare")))) ;
ImpPl1 vp = {s =
ImpPl1 vpr = let vp = useVP vpr in {s =
(mkImperative False P1 vp).s ! Pos ! {n = Pl ; g = Masc} --- fem
} ;

View File

@@ -355,6 +355,7 @@ lin
language_N = regN "lingua" ;
rule_N = regN "regola" ;
question_N = regN "domanda" ;
today_Adv = mkAdv "oggi" ;
} ;

View File

@@ -354,7 +354,7 @@ lin
language_N = mk2N "språk" "språket" ;
rule_N = mkN "regel" "regelen" "regler" "reglene" ;
---- question_N = regN "fråga" ;
question_N = mk2N "spørsmål" "spørsmålet" ;
---- ready_A = regA "färdig" ;
---- reason_N = regN "anledning" ;
today_Adv = mkAdv "idag" ;

View File

@@ -44,8 +44,8 @@ incomplete concrete CatRomance of Cat =
-- Verb
VP = CommonRomance.VP ;
VPSlash = CommonRomance.VP ** {c2 : Compl} ;
VP = ResRomance.VP ;
VPSlash = ResRomance.VP ** {c2 : Compl} ;
Comp = {s : Agr => Str} ;
-- Adjective

View File

@@ -176,11 +176,11 @@ oper
appVPAgr : VPAgr -> AAgr -> AAgr = \vp,agr ->
case vp of {
VPAgrSubj => agr ;
VPAgrClit a => a
VPAgrSubj => agr ;
VPAgrClit g n => {g = g ; n = n}
} ;
vpAgrNone : VPAgr = VPAgrClit (aagr Masc Sg) ;
vpAgrNone : VPAgr = VPAgrClit Masc Sg ;
oper
mkOrd : {s : Degree => AForm => Str} -> {s : AAgr => Str} ;
@@ -193,11 +193,10 @@ oper
param
VPAgr =
VPAgrSubj -- elle est partie, elle s'est vue
| VPAgrClit -- elle a dormi; elle les a vues
{g : Gender ; n : Number} ;
| VPAgrClit Gender Number ; -- elle a dormi; elle les a vues
oper
VP : Type = {
VPC : Type = {
s : VPForm => {
fin : Agr => Str ; -- ai
inf : AAgr => Str -- dit

View File

@@ -49,8 +49,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
-- To render imperatives (with their clitics etc).
oper mkImperative : Bool -> Person -> CommonRomance.VP -> {s : Polarity => AAgr => Str} ;
oper mkImperative : Bool -> Person -> VPC -> {s : Polarity => AAgr => Str} ;
--2 Constants that must derivatively depend on language
@@ -104,5 +103,6 @@ param
oper
Verb = {s : VF => Str ; vtyp : VType} ;
}

View File

@@ -48,8 +48,23 @@ oper
appCompl : Compl -> (NPForm => Str) -> Str = \comp,np ->
comp.s ++ np ! Ton comp.c ;
predV : Verb -> VP = \verb ->
oper
VP : Type = {
s : Verb ;
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
} ;
useVP : VP -> VPC = \vp ->
let
verb = vp.s ;
vfin : TMood -> Agr -> Str = \tm,a -> verb.s ! VFin tm a.n a.p ;
vpart : AAgr -> Str = \a -> verb.s ! VPart a.g a.n ;
vinf : Bool -> Str = \b -> verb.s ! VInfin b ;
@@ -86,6 +101,23 @@ oper
VPGerund => vf (\_ -> []) (\_ -> vger) ;
VPInfinit Simul b=> vf (\_ -> []) (\_ -> vinf b)
} ;
agr = vp.agr ; -- partAgr typ ;
neg = vp.neg ; -- negation ;
clAcc = vp.clAcc ; -- case isVRefl typ of {
-- True => CRefl ;
-- _ => CNone
-- } ;
clDat = vp.clDat ; -- CNone ; --- no dative refls
clit2 = vp.clit2 ; -- [] ;
comp = vp.comp ; -- \\a => [] ;
ext = vp.ext -- \\p => []
} ;
predV : Verb -> VP = \verb ->
let
typ = verb.vtyp ;
in {
s = {s = verb.s ; vtyp = typ} ;
agr = partAgr typ ;
neg = negation ;
clAcc = case isVRefl typ of {
@@ -137,6 +169,7 @@ oper
ext = vp.ext ;
} ;
-- Agreement with preceding relative or interrogative:
-- "les femmes que j'ai aimées"
@@ -151,6 +184,17 @@ oper
ext = vp.ext ;
} ;
insertRefl : VP -> VP = \vp -> {
s = {s = vp.s.s ; vtyp = vRefl} ;
agr = vp.agr ;
clAcc = CRefl ;
clDat = vp.clDat ;
clit2 = vp.clit2 ;
neg = vp.neg ;
comp = vp.comp ;
ext = vp.ext ;
} ;
insertAdv : Str -> VP -> VP = \co,vp -> {
s = vp.s ;
agr = vp.agr ;
@@ -199,7 +243,7 @@ oper
mkClause : Str -> Bool -> Agr -> VP ->
{s : Direct => RTense => Anteriority => Polarity => Mood => Str} =
\subj,hasClit,agr,vp -> {
\subj,hasClit,agr,vpr -> {
s = \\d,t,a,b,m =>
let
tm = case t of {
@@ -209,6 +253,7 @@ oper
RPasse => VPasse ; --# notpresent
RPres => VPres m
} ;
vp = useVP vpr ;
vps = vp.s ! VPFinite tm a ;
verb = vps.fin ! agr ;
inf = vps.inf ! (appVPAgr vp.agr (aagr agr.g agr.n)) ; --- subtype bug
@@ -229,8 +274,9 @@ oper
--- have a "-" with possibly a special verb form with "t":
--- "comment fera-t-il" vs. "comment fera Pierre"
infVP : VP -> Agr -> Str = \vp,agr ->
infVP : VP -> Agr -> Str = \vpr,agr ->
let
vp = useVP vpr ;
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
inf = (vp.s ! VPInfinit Simul clpr.p3).inf ! (aagr agr.g agr.n) ;
neg = vp.neg ! Pos ; --- Neg not in API

View File

@@ -8,7 +8,7 @@ incomplete concrete SentenceRomance of Sentence =
PredSCVP sc vp = mkClause sc.s False (agrP3 Masc Sg) vp ;
ImpVP vp = {
ImpVP vpr = let vp = useVP vpr in {
s = \\p,i,g => case i of {
ImpF n b => (mkImperative b P2 vp).s ! p ! (aagr g n)
}

View File

@@ -36,15 +36,17 @@ incomplete concrete VerbRomance of Verb =
(\\_ => q.s ! QIndir)
(predV v)) ;
{- ---- lincat should be fixed
SlashV2A v ap =
let af = AF Masc Sg
{- ---- lincat should be fixed
let af = case v.c3.isDir of {
True => AF np.a.g np.a.n ; -- ... bleues
_ => AF Masc Sg -- il les peint en bleu
}
-}
SlashV2A v ap =
let af = AF Masc Sg
in
mkVPSlash v.c2
(insertComplement
@@ -54,7 +56,7 @@ incomplete concrete VerbRomance of Verb =
ComplSlash vp np = insertObject vp.c2 np vp ;
ReflVP v = case v.c2.isDir of {
True => v ** {vtyp = vRefl} ;
True => insertRefl v ;
False => insertComplement
(\\a => v.c2.s ++ reflPron a.n a.p v.c2.c) v
} ;

View File

@@ -5,7 +5,9 @@ concrete IdiomSpa of Idiom = CatSpa **
lin
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
GenericCl vp = mkClause "se" True (agrP3 Masc Sg) vp ; ---- just Italian ?
GenericCl vp =
mkClause [] True (agrP3 Masc Sg) (insertRefl vp) ; ---- just Italian ?
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a)
@@ -25,7 +27,7 @@ concrete IdiomSpa of Idiom = CatSpa **
(mkClause [] True (agrP3 Masc Sg) (predV (verboV (hay_3 "haber")))).s ! DDir ! t ! a ! p ! Indic
} ;
ProgrVP vp =
ProgrVP vpr = let vp = useVP vpr in
insertComplement
(\\agr =>
let
@@ -36,7 +38,7 @@ concrete IdiomSpa of Idiom = CatSpa **
)
(predV (verboV (estar_2 "estar"))) ;
ImpPl1 vp = {s =
ImpPl1 vpr = let vp = useVP vpr in {s =
(mkImperative False P1 vp).s ! Pos ! {n = Pl ; g = Masc} --- fem
} ;