(Extend) Add AdvIsNP + implement it in Eng,Fin,Pes,Romance,Swe

This commit is contained in:
Inari Listenmaa
2019-03-19 09:34:26 +01:00
parent e35abeac6b
commit 82937227bc
7 changed files with 108 additions and 95 deletions

View File

@@ -30,7 +30,7 @@ abstract Extend = Cat ** {
StrandQuestSlash : IP -> ClSlash -> QCl ; -- whom does John live with StrandQuestSlash : IP -> ClSlash -> QCl ; -- whom does John live with
StrandRelSlash : RP -> ClSlash -> RCl ; -- that he lives in StrandRelSlash : RP -> ClSlash -> RCl ; -- that he lives in
EmptyRelSlash : ClSlash -> RCl ; -- he lives in EmptyRelSlash : ClSlash -> RCl ; -- he lives in
-- $VP$ conjunction, separate categories for finite and infinitive forms (VPS and VPI, respectively) -- $VP$ conjunction, separate categories for finite and infinitive forms (VPS and VPI, respectively)
-- covering both in the same category leads to spurious VPI parses because VPS depends on many more tenses -- covering both in the same category leads to spurious VPI parses because VPS depends on many more tenses
@@ -45,7 +45,7 @@ abstract Extend = Cat ** {
MkVPS : Temp -> Pol -> VP -> VPS ; -- hasn't slept MkVPS : Temp -> Pol -> VP -> VPS ; -- hasn't slept
ConjVPS : Conj -> [VPS] -> VPS ; -- has walked and won't sleep ConjVPS : Conj -> [VPS] -> VPS ; -- has walked and won't sleep
PredVPS : NP -> VPS -> S ; -- she [has walked and won't sleep] PredVPS : NP -> VPS -> S ; -- she [has walked and won't sleep]
MkVPI : VP -> VPI ; -- to sleep (TODO: Ant and Pol) MkVPI : VP -> VPI ; -- to sleep (TODO: Ant and Pol)
ConjVPI : Conj -> [VPI] -> VPI ; -- to sleep and to walk ConjVPI : Conj -> [VPI] -> VPI ; -- to sleep and to walk
ComplVPIVV : VV -> VPI -> VP ; -- must sleep and walk ComplVPIVV : VV -> VPI -> VP ; -- must sleep and walk
@@ -59,17 +59,17 @@ abstract Extend = Cat ** {
[VPI2] {2} ; -- to love, to hate [VPI2] {2} ; -- to love, to hate
fun fun
MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved
ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates
ComplVPS2 : VPS2 -> NP -> VPS ; -- has loved and now hates that person ComplVPS2 : VPS2 -> NP -> VPS ; -- has loved and now hates that person
MkVPI2 : VPSlash -> VPI2 ; -- to love MkVPI2 : VPSlash -> VPI2 ; -- to love
ConjVPI2 : Conj -> [VPI2] -> VPI2 ; -- to love and hate ConjVPI2 : Conj -> [VPI2] -> VPI2 ; -- to love and hate
ComplVPI2 : VPI2 -> NP -> VPI ; -- to love and hate that person ComplVPI2 : VPI2 -> NP -> VPI ; -- to love and hate that person
fun fun
ProDrop : Pron -> Pron ; -- unstressed subject pronoun becomes empty: "am tired" ProDrop : Pron -> Pron ; -- unstressed subject pronoun becomes empty: "am tired"
ICompAP : AP -> IComp ; -- "how old" ICompAP : AP -> IComp ; -- "how old"
IAdvAdv : Adv -> IAdv ; -- "how often" IAdvAdv : Adv -> IAdv ; -- "how often"
@@ -88,15 +88,15 @@ abstract Extend = Cat ** {
-- participle constructions -- participle constructions
PresPartAP : VP -> AP ; -- (the man) looking at Mary PresPartAP : VP -> AP ; -- (the man) looking at Mary
EmbedPresPart : VP -> SC ; -- looking at Mary (is fun) EmbedPresPart : VP -> SC ; -- looking at Mary (is fun)
PastPartAP : VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space PastPartAP : VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space
PastPartAgentAP : VPSlash -> NP -> AP ; -- (opportunity) lost by the company PastPartAgentAP : VPSlash -> NP -> AP ; -- (opportunity) lost by the company
-- this is a generalization of Verb.PassV2 and should replace it in the future. -- this is a generalization of Verb.PassV2 and should replace it in the future.
PassVPSlash : VPSlash -> VP ; -- be forced to sleep PassVPSlash : VPSlash -> VP ; -- be forced to sleep
-- the form with an agent may result in a different linearization -- the form with an agent may result in a different linearization
-- from an adverbial modification by an agent phrase. -- from an adverbial modification by an agent phrase.
PassAgentVPSlash : VPSlash -> NP -> VP ; -- be begged by her to go PassAgentVPSlash : VPSlash -> NP -> VP ; -- be begged by her to go
@@ -115,6 +115,9 @@ abstract Extend = Cat ** {
ExistMassCN : CN -> Cl ; -- there is beer / there is no beer ExistMassCN : CN -> Cl ; -- there is beer / there is no beer
ExistPluralCN : CN -> Cl ; -- there are trees / there are no trees ExistPluralCN : CN -> Cl ; -- there are trees / there are no trees
-- generalisation of existential, with adverb as a parameter
AdvIsNP : Adv -> NP -> Cl ; -- here is the tree / here are the trees
-- infinitive for purpose AR 21/8/2013 -- infinitive for purpose AR 21/8/2013
PurposeVP : VP -> Adv ; -- to become happy PurposeVP : VP -> Adv ; -- to become happy
@@ -148,8 +151,8 @@ abstract Extend = Cat ** {
cat cat
RNP ; -- reflexive noun phrase, e.g. "my family and myself" RNP ; -- reflexive noun phrase, e.g. "my family and myself"
RNPList ; -- list of reflexives to be coordinated, e.g. "my family, myself, everyone" RNPList ; -- list of reflexives to be coordinated, e.g. "my family, myself, everyone"
-- Notice that it is enough for one NP in RNPList to be RNP. -- Notice that it is enough for one NP in RNPList to be RNP.
fun fun
ReflRNP : VPSlash -> RNP -> VP ; -- love my family and myself ReflRNP : VPSlash -> RNP -> VP ; -- love my family and myself
@@ -161,7 +164,7 @@ abstract Extend = Cat ** {
ConjRNP : Conj -> RNPList -> RNP ; -- my family, John and myself ConjRNP : Conj -> RNPList -> RNP ; -- my family, John and myself
Base_rr_RNP : RNP -> RNP -> RNPList ; -- my family, myself Base_rr_RNP : RNP -> RNP -> RNPList ; -- my family, myself
Base_nr_RNP : NP -> RNP -> RNPList ; -- John, myself Base_nr_RNP : NP -> RNP -> RNPList ; -- John, myself
Base_rn_RNP : RNP -> NP -> RNPList ; -- myself, John Base_rn_RNP : RNP -> NP -> RNPList ; -- myself, John
Cons_rr_RNP : RNP -> RNPList -> RNPList ; -- my family, myself, John Cons_rr_RNP : RNP -> RNPList -> RNPList ; -- my family, myself, John
@@ -181,8 +184,8 @@ abstract Extend = Cat ** {
GerundNP : VP -> NP ; -- publishing the document (by nature definite) GerundNP : VP -> NP ; -- publishing the document (by nature definite)
GerundAdv : VP -> Adv ; -- publishing the document (prepositionless adverb) GerundAdv : VP -> Adv ; -- publishing the document (prepositionless adverb)
WithoutVP : VP -> Adv ; -- without publishing the document WithoutVP : VP -> Adv ; -- without publishing the document
ByVP : VP -> Adv ; -- by publishing the document ByVP : VP -> Adv ; -- by publishing the document
InOrderToVP : VP -> Adv ; -- (in order) to publish the document InOrderToVP : VP -> Adv ; -- (in order) to publish the document
ApposNP : NP -> NP -> NP ; -- Mr Macron, the president of France, ApposNP : NP -> NP -> NP ; -- Mr Macron, the president of France,
@@ -207,7 +210,7 @@ abstract Extend = Cat ** {
DetNPFem : Det -> NP ; DetNPFem : Det -> NP ;
UseComp_estar : Comp -> VP ; -- (Cat, Spa, Por) "está cheio" instead of "é cheio" UseComp_estar : Comp -> VP ; -- (Cat, Spa, Por) "está cheio" instead of "é cheio"
iFem_Pron : Pron ; -- I (Fem) iFem_Pron : Pron ; -- I (Fem)
youFem_Pron : Pron ; -- you (Fem) youFem_Pron : Pron ; -- you (Fem)
weFem_Pron : Pron ; -- we (Fem) weFem_Pron : Pron ; -- we (Fem)

View File

@@ -29,10 +29,10 @@ lin
MkVPI vp = variants {} ; -- Temp -> Pol -> VP -> VPI ; -- to sleep / hasn't slept MkVPI vp = variants {} ; -- Temp -> Pol -> VP -> VPI ; -- to sleep / hasn't slept
ConjVPI = variants {} ; -- Conj -> [VPI] -> VPI ; -- has walked and won't sleep ConjVPI = variants {} ; -- Conj -> [VPI] -> VPI ; -- has walked and won't sleep
ComplVPIVV = variants {} ; -- VV -> VPI -> VP ; -- want to sleep and to walk ComplVPIVV = variants {} ; -- VV -> VPI -> VP ; -- want to sleep and to walk
MkVPS2 = variants {} ; -- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved MkVPS2 = variants {} ; -- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved
ConjVPS2 = variants {} ; -- : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates ConjVPS2 = variants {} ; -- : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates
ComplVPS2 = variants {} ; -- : VPS2 -> NP -> VPS ; -- has loved and now hates that person ComplVPS2 = variants {} ; -- : VPS2 -> NP -> VPS ; -- has loved and now hates that person
MkVPI2 = variants {} ; -- : Ant -> Pol -> VPSlash -> VPI2 ; -- to have loved MkVPI2 = variants {} ; -- : Ant -> Pol -> VPSlash -> VPI2 ; -- to have loved
ConjVPI2 = variants {} ; -- : Conj -> [VPI2] -> VPI2 ; -- to love and have hated ConjVPI2 = variants {} ; -- : Conj -> [VPI2] -> VPI2 ; -- to love and have hated
ComplVPI2 = variants {} ; -- : VPI2 -> NP -> VPI ; -- to love and hate that person ComplVPI2 = variants {} ; -- : VPI2 -> NP -> VPI ; -- to love and hate that person
ProDrop pro = pro ; -- am tired ; DEFAULT I am tired (no pro drop) ProDrop pro = pro ; -- am tired ; DEFAULT I am tired (no pro drop)
@@ -54,6 +54,7 @@ lin
ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ; ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ;
ExistMassCN cn = ExistNP (MassNP cn) ; ExistMassCN cn = ExistNP (MassNP cn) ;
ExistPluralCN cn = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ; ExistPluralCN cn = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ;
AdvIsNP adv np = PredVP np (UseComp (CompAdv adv)) ; -- here is the tree / here are the trees
PurposeVP = variants {} ; -- VP -> Adv ; -- to become happy PurposeVP = variants {} ; -- VP -> Adv ; -- to become happy
ComplBareVS = ComplVS ; -- VS -> S -> VP ; -- say she runs ; DEFAULT say that she runs ComplBareVS = ComplVS ; -- VS -> S -> VP ; -- say she runs ; DEFAULT say that she runs
SlashBareV2S = SlashV2S ; -- V2S -> S -> VPSlash ; -- answer (to him) it is good ; DEFAULT answer that it is good SlashBareV2S = SlashV2S ; -- V2S -> S -> VPSlash ; -- answer (to him) it is good ; DEFAULT answer that it is good

View File

@@ -3,8 +3,8 @@
concrete ExtendEng of Extend = concrete ExtendEng of Extend =
CatEng ** ExtendFunctor - CatEng ** ExtendFunctor -
[ [
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList, VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList,
AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP,
BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2, BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2,
MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV, MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV,
MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2, MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2,
@@ -33,23 +33,23 @@ concrete ExtendEng of Extend =
GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen ; isDef = True} ; GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen ; isDef = True} ;
GenIP ip = {s = \\_ => ip.s ! NCase Gen} ; GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
GenRP nu cn = { GenRP nu cn = {
s = \\c => "whose" ++ nu.s ! False ! Nom ++ s = \\c => "whose" ++ nu.s ! False ! Nom ++
case c of { case c of {
RC _ (NCase Gen) => cn.s ! nu.n ! Gen ; RC _ (NCase Gen) => cn.s ! nu.n ! Gen ;
_ => cn.s ! nu.n ! Nom _ => cn.s ! nu.n ! Nom
} ; } ;
a = RAg (agrP3 nu.n) a = RAg (agrP3 nu.n)
} ; } ;
GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ; GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ;
GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ; GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
StrandQuestSlash ip slash = StrandQuestSlash ip slash =
{s = \\t,a,b,q => {s = \\t,a,b,q =>
(mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2 (mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
}; };
StrandRelSlash rp slash = { StrandRelSlash rp slash = {
s = \\t,a,p,ag => s = \\t,a,p,ag =>
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ; rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
c = NPAcc c = NPAcc
} ; } ;
@@ -70,14 +70,14 @@ concrete ExtendEng of Extend =
lincat lincat
VPS = {s : Agr => Str} ; VPS = {s : Agr => Str} ;
[VPS] = {s1,s2 : Agr => Str} ; [VPS] = {s1,s2 : Agr => Str} ;
VPI = {s : VVType => Agr => Str} ; VPI = {s : VVType => Agr => Str} ;
[VPI] = {s1,s2 : VVType => Agr => Str} ; [VPI] = {s1,s2 : VVType => Agr => Str} ;
lin lin
BaseVPS = twoTable Agr ; BaseVPS = twoTable Agr ;
ConsVPS = consrTable Agr comma ; ConsVPS = consrTable Agr comma ;
BaseVPI = twoTable2 VVType Agr ; BaseVPI = twoTable2 VVType Agr ;
ConsVPI = consrTable2 VVType Agr comma ; ConsVPI = consrTable2 VVType Agr comma ;
@@ -85,7 +85,7 @@ concrete ExtendEng of Extend =
ConjVPS c xs = conjunctDistrTable Agr c xs ; ConjVPS c xs = conjunctDistrTable Agr c xs ;
PredVPS np vps = {s = np.s ! npNom ++ vps.s ! np.a} ; PredVPS np vps = {s = np.s ! npNom ++ vps.s ! np.a} ;
MkVPI vp = mkVPI (lin VP vp) ; MkVPI vp = mkVPI (lin VP vp) ;
ConjVPI c xs = conjunctDistrTable2 VVType Agr c xs ; ConjVPI c xs = conjunctDistrTable2 VVType Agr c xs ;
ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ; ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ;
@@ -94,8 +94,8 @@ concrete ExtendEng of Extend =
-------- two-place verb conjunction -------- two-place verb conjunction
lincat lincat
VPS2 = {s : Agr => Str ; c2 : Str} ; VPS2 = {s : Agr => Str ; c2 : Str} ;
[VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ; [VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ;
VPI2 = {s : VVType => Agr => Str ; c2 : Str} ; VPI2 = {s : VVType => Agr => Str ; c2 : Str} ;
[VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ; [VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ;
@@ -105,7 +105,7 @@ concrete ExtendEng of Extend =
BaseVPS2 x y = twoTable Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb BaseVPS2 x y = twoTable Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
ConsVPS2 x xs = consrTable Agr comma x xs ** {c2 = xs.c2} ; ConsVPS2 x xs = consrTable Agr comma x xs ** {c2 = xs.c2} ;
BaseVPI2 x y = twoTable2 VVType Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb BaseVPI2 x y = twoTable2 VVType Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ; ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ;
@@ -121,15 +121,15 @@ concrete ExtendEng of Extend =
s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2 ++ np.s ! NPAcc s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2 ++ np.s ! NPAcc
} ; } ;
oper oper
mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS { mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {
s = \\a => s = \\a =>
let let
verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ; verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ;
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ; verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
} ; } ;
mkVPI : VP -> VPI = \vp -> lin VPI { mkVPI : VP -> VPI = \vp -> lin VPI {
s = table { s = table {
VVAux => \\a => vp.ad ! a ++ vp.inf ++ vp.p ++ vp.s2 ! a ; VVAux => \\a => vp.ad ! a ++ vp.inf ++ vp.p ++ vp.s2 ! a ;
@@ -152,11 +152,11 @@ concrete ExtendEng of Extend =
EmbedPresPart vp = {s = \\a => infVP VVPresPart vp False Simul CPos a} ; EmbedPresPart vp = {s = \\a => infVP VVPresPart vp False Simul CPos a} ;
PastPartAP vp = { PastPartAP vp = {
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ vp.ext ; s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ vp.ext ;
isPre = vp.isSimple -- depends on whether there are complements isPre = vp.isSimple -- depends on whether there are complements
} ; } ;
PastPartAgentAP vp np = { PastPartAgentAP vp np = {
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ "by" ++ np.s ! NPAcc ++ vp.ext ; s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ "by" ++ np.s ! NPAcc ++ vp.ext ;
isPre = False isPre = False
} ; } ;
@@ -168,45 +168,45 @@ concrete ExtendEng of Extend =
<Sg,Gen> => Predef.BIND ++ "'s" ; <Sg,Gen> => Predef.BIND ++ "'s" ;
<Pl,Nom> => Predef.BIND ++ "s" ; <Pl,Nom> => Predef.BIND ++ "s" ;
<Pl,Gen> => Predef.BIND ++ "s'" <Pl,Gen> => Predef.BIND ++ "s'"
} ++ } ++
vp.p ++ vp.s2 ! AgP3Sg Neutr ++ vp.ext ; vp.p ++ vp.s2 ! AgP3Sg Neutr ++ vp.ext ;
g = Neutr g = Neutr
} ; } ;
GerundNP vp = GerundNP vp =
let a = AgP3Sg Neutr ---- agr let a = AgP3Sg Neutr ---- agr
in in
{s = \\_ => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext ; a = a} ; {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext ; a = a} ;
GerundAdv vp = GerundAdv vp =
let a = AgP3Sg Neutr let a = AgP3Sg Neutr
in in
{s = vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext} ; {s = vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext} ;
WithoutVP vp = {s = "without" ++ (GerundAdv (lin VP vp)).s} ; WithoutVP vp = {s = "without" ++ (GerundAdv (lin VP vp)).s} ;
InOrderToVP vp = {s = ("in order" | []) ++ infVP VVInf vp False Simul CPos (AgP3Sg Neutr)} ; InOrderToVP vp = {s = ("in order" | []) ++ infVP VVInf vp False Simul CPos (AgP3Sg Neutr)} ;
PurposeVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ; --- agr PurposeVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ; --- agr
ByVP vp = {s = "by" ++ (GerundAdv (lin VP vp)).s} ; ByVP vp = {s = "by" ++ (GerundAdv (lin VP vp)).s} ;
NominalizeVPSlashNP vpslash np = NominalizeVPSlashNP vpslash np =
let vp : ResEng.VP = insertObjPre (\\_ => vpslash.c2 ++ np.s ! NPAcc) vpslash ; let vp : ResEng.VP = insertObjPre (\\_ => vpslash.c2 ++ np.s ! NPAcc) vpslash ;
a = AgP3Sg Neutr a = AgP3Sg Neutr
in in
lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ; lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ;
oper passVPSlash : VPSlash -> Str -> ResEng.VP = oper passVPSlash : VPSlash -> Str -> ResEng.VP =
\vps,ag -> \vps,ag ->
let let
be = predAux auxBe ; be = predAux auxBe ;
ppt = vps.ptp ppt = vps.ptp
in { in {
s = be.s ; s = be.s ;
p = [] ; p = [] ;
prp = be.prp ; prp = be.prp ;
ptp = be.ptp ; ptp = be.ptp ;
inf = be.inf ; inf = be.inf ;
@@ -216,7 +216,7 @@ concrete ExtendEng of Extend =
ext = vps.ext ext = vps.ext
} ; } ;
lin lin
PassVPSlash vps = passVPSlash (lin VPS vps) [] ; PassVPSlash vps = passVPSlash (lin VPS vps) [] ;
PassAgentVPSlash vps np = passVPSlash (lin VPS vps) ("by" ++ np.s ! NPAcc) ; PassAgentVPSlash vps np = passVPSlash (lin VPS vps) ("by" ++ np.s ! NPAcc) ;
@@ -226,8 +226,8 @@ concrete ExtendEng of Extend =
} ; } ;
--- AR 22/5/2013 --- AR 22/5/2013
ExistsNP np = ExistsNP np =
mkClause "there" (agrP3 (fromAgr np.a).n) mkClause "there" (agrP3 (fromAgr np.a).n)
(insertObj (\\_ => np.s ! NPAcc) (predV (regV "exist"))) ; (insertObj (\\_ => np.s ! NPAcc) (predV (regV "exist"))) ;
ExistCN cn = ExistCN cn =
@@ -263,8 +263,8 @@ concrete ExtendEng of Extend =
} ; } ;
FrontExtPredVP np vp = { FrontExtPredVP np vp = {
s = \\t,a,b,o => s = \\t,a,b,o =>
let let
subj = np.s ! npNom ; subj = np.s ! npNom ;
agr = np.a ; agr = np.a ;
verb = vp.s ! t ! a ! b ! o ! agr ; verb = vp.s ! t ! a ! b ! o ! agr ;
@@ -277,8 +277,8 @@ concrete ExtendEng of Extend =
} ; } ;
InvFrontExtPredVP np vp = { InvFrontExtPredVP np vp = {
s = \\t,a,b,o => s = \\t,a,b,o =>
let let
subj = np.s ! npNom ; subj = np.s ! npNom ;
agr = np.a ; agr = np.a ;
verb = vp.s ! t ! a ! b ! o ! agr ; verb = vp.s ! t ! a ! b ! o ! agr ;
@@ -311,7 +311,7 @@ concrete ExtendEng of Extend =
RNP = {s : Agr => Str} ; RNP = {s : Agr => Str} ;
RNPList = {s1,s2 : Agr => Str} ; RNPList = {s1,s2 : Agr => Str} ;
lin lin
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ; ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
ReflPron = {s = reflPron} ; ReflPron = {s = reflPron} ;
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! True ! Nom ++ cn.s ! num.n ! Nom} ; ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! True ! Nom ++ cn.s ! num.n ! Nom} ;
@@ -328,21 +328,23 @@ concrete ExtendEng of Extend =
lin lin
ApposNP np1 np2 = {s = \\c => np1.s ! c ++ comma ++ np2.s ! c; a = np1.a} ; ApposNP np1 np2 = {s = \\c => np1.s ! c ++ comma ++ np2.s ! c; a = np1.a} ;
AdvIsNP adv np = PredVP {s = \\_ => adv.s ; a = np.a} (UseComp (CompNP np)) ;
---- TODO: RNPList construction ---- TODO: RNPList construction
lin lin
ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++ ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
infVP v.typ vp False a.a p.p agr) infVP v.typ vp False a.a p.p agr)
(predVV v) ; (predVV v) ;
CompS s = {s = \\_ => "that" ++ s.s} ; CompS s = {s = \\_ => "that" ++ s.s} ;
CompQS qs = {s = \\_ => qs.s ! QIndir} ; CompQS qs = {s = \\_ => qs.s ! QIndir} ;
CompVP ant p vp = {s = \\a => ant.s ++ p.s ++ CompVP ant p vp = {s = \\a => ant.s ++ p.s ++
infVP VVInf vp False ant.a p.p a} ; infVP VVInf vp False ant.a p.p a} ;
-- quite specific for English anyway -- quite specific for English anyway
UncontractedNeg = {s = [] ; p = CNeg False} ; UncontractedNeg = {s = [] ; p = CNeg False} ;
UttVPShort vp = {s = infVP VVAux vp False Simul CPos (agrP3 Sg)} ; UttVPShort vp = {s = infVP VVAux vp False Simul CPos (agrP3 Sg)} ;

View File

@@ -5,7 +5,7 @@ concrete ExtendFin of Extend =
VPI2,VPS2,MkVPS,MkVPS2,ConjVPS2,ComplVPS2, ConsVPS, BaseVPS, ListVPS, VPS, ConjVPS,PredVPS, VPI2,VPS2,MkVPS,MkVPS2,ConjVPS2,ComplVPS2, ConsVPS, BaseVPS, ListVPS, VPS, ConjVPS,PredVPS,
MkVPI2,ConjVPI2,ComplVPI2,ComplVPIVV MkVPI2,ConjVPI2,ComplVPI2,ComplVPIVV
,ExistCN, ExistMassCN, ICompAP, ByVP ,ExistCN, ExistMassCN, ICompAP, ByVP
,CompoundN, GenNP, GenIP ,CompoundN, GenNP, GenIP, AdvIsNP
] ]
with with
(Grammar = GrammarFin) ** (Grammar = GrammarFin) **
@@ -120,7 +120,7 @@ lin
---- copied from VerbFin.CompAP, should be shared ---- copied from VerbFin.CompAP, should be shared
ICompAP ap = { ICompAP ap = {
s = \\agr => s = \\agr =>
let let
n = complNumAgr agr ; n = complNumAgr agr ;
c = case n of { c = case n of {
@@ -133,19 +133,20 @@ lin
lin lin
GenNP np = { GenNP np = {
s1,sp = \\_,_ => np.s ! NPCase Gen ; s1,sp = \\_,_ => np.s ! NPCase Gen ;
s2 = case np.isPron of { -- "isän auto", "hänen autonsa" s2 = case np.isPron of { -- "isän auto", "hänen autonsa"
True => table {Front => BIND ++ possSuffixFront np.a ; True => table {Front => BIND ++ possSuffixFront np.a ;
Back => BIND ++ possSuffix np.a } ; Back => BIND ++ possSuffix np.a } ;
False => \\_ => [] False => \\_ => []
} ; } ;
isNum = False ; isNum = False ;
isPoss = np.isPron ; --- also gives "sen autonsa" isPoss = np.isPron ; --- also gives "sen autonsa"
isDef = True ; --- "Jussin kolme autoa ovat" ; thus "...on" is missing isDef = True ; --- "Jussin kolme autoa ovat" ; thus "...on" is missing
isNeg = False isNeg = False
} ; } ;
GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ; GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ;
ByVP vp = lin Adv {s = S.infVP vp.s.sc Pos (Ag Sg P3) vp Inf3Adess} ; ---- Agr ? ByVP vp = lin Adv {s = S.infVP vp.s.sc Pos (Ag Sg P3) vp Inf3Adess} ; ---- Agr ?
AdvIsNP adv np = S.mkClause (\_ -> adv.s) np.a (UseComp (CompNP np)) ;
} }

View File

@@ -2,7 +2,7 @@
concrete ExtendPes of Extend = concrete ExtendPes of Extend =
CatPes ** ExtendFunctor - [ CatPes ** ExtendFunctor - [
GenNP, ApposNP, ICompAP GenNP, ApposNP, ICompAP, AdvIsNP
,GerundNP,GerundCN,GerundAdv,EmbedPresPart ,GerundNP,GerundCN,GerundAdv,EmbedPresPart
] ]
with (Grammar=GrammarPes) with (Grammar=GrammarPes)
@@ -30,6 +30,9 @@ lin
-- : VP -> Adv ; -- publishing the document (prepositionless adverb) -- : VP -> Adv ; -- publishing the document (prepositionless adverb)
GerundAdv vp = lin Adv {s = showVPH Inf defaultAgr vp} ; GerundAdv vp = lin Adv {s = showVPH Inf defaultAgr vp} ;
-- : VP -> SC ; -- : VP -> SC ;
EmbedPresPart vp = lin SC {s = showVPH Inf defaultAgr vp} ; EmbedPresPart vp = lin SC {s = showVPH Inf defaultAgr vp} ;
-- : Adv -> NP -> Cl -- here is the car / here are the cars
AdvIsNP adv np = mkClause (indeclNP adv.s ** {a = np.a}) (UseComp (CompNP np)) ;
} }

View File

@@ -95,7 +95,7 @@ incomplete concrete ExtendRomanceFunctor of Extend =
FocusAdv = variants {} ; -- Adv -> S -> Utt ; -- today I will sleep FocusAdv = variants {} ; -- Adv -> S -> Utt ; -- today I will sleep
FocusAdV = variants {} ; -- AdV -> S -> Utt ; -- never will I sleep FocusAdV = variants {} ; -- AdV -> S -> Utt ; -- never will I sleep
FocusAP = variants {} ; -- AP -> NP -> Utt ; -- green was the tree FocusAP = variants {} ; -- AP -> NP -> Utt ; -- green was the tree
lin lin
EmbedPresPart = variants {} ; -- VP -> SC ; -- looking at Mary (is fun) EmbedPresPart = variants {} ; -- VP -> SC ; -- looking at Mary (is fun)
@@ -118,6 +118,7 @@ incomplete concrete ExtendRomanceFunctor of Extend =
ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ; ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ;
ExistMassCN cn = ExistNP (MassNP cn) ; ExistMassCN cn = ExistNP (MassNP cn) ;
ExistPluralCN cn = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ; ExistPluralCN cn = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ;
AdvIsNP adv np = mkClause adv.s False False np.a (UseComp_estar (CompNP np)) ;
lin lin
ComplBareVS = ComplVS ; -- VS -> S -> VP ; -- say she runs ; DEFAULT say that she runs ComplBareVS = ComplVS ; -- VS -> S -> VP ; -- say she runs ; DEFAULT say that she runs
@@ -176,7 +177,7 @@ incomplete concrete ExtendRomanceFunctor of Extend =
PurposeVP vp = { PurposeVP vp = {
s = infVP vp (Ag Masc Sg P3) s = infVP vp (Ag Masc Sg P3)
} ; } ;
WithoutVP = variants {} ; -- VP -> Adv ; -- without publishing the document WithoutVP = variants {} ; -- VP -> Adv ; -- without publishing the document
ByVP vp = { ByVP vp = {

View File

@@ -12,7 +12,7 @@ concrete ExtendSwe of Extend = CatSwe **
AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP, AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP,
RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP,
Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP,
CompoundN, CompoundAP CompoundN, CompoundAP, AdvIsNP
] ]
with (Grammar = GrammarSwe) with (Grammar = GrammarSwe)
** **
@@ -23,7 +23,7 @@ concrete ExtendSwe of Extend = CatSwe **
lin lin
GenNP np = { GenNP np = {
s,sp = \\n,_,_,g => np.s ! NPPoss (gennum (ngen2gen g) n) Nom ; s,sp = \\n,_,_,g => np.s ! NPPoss (gennum (ngen2gen g) n) Nom ;
det = DDef Indef det = DDef Indef
} ; } ;
@@ -31,26 +31,26 @@ concrete ExtendSwe of Extend = CatSwe **
ComplBareVS v s = insertObj (\\_ => s.s ! Sub) (predV v) ; ComplBareVS v s = insertObj (\\_ => s.s ! Sub) (predV v) ;
CompBareCN cn = {s = \\a => case a.n of { CompBareCN cn = {s = \\a => case a.n of {
Sg => cn.s ! Sg ! DIndef ! Nom ; Sg => cn.s ! Sg ! DIndef ! Nom ;
Pl => cn.s ! Pl ! DIndef ! Nom Pl => cn.s ! Pl ! DIndef ! Nom
} }
} ; } ;
StrandRelSlash rp slash = { StrandRelSlash rp slash = {
s = \\t,a,p,ag,_ => s = \\t,a,p,ag,_ =>
rp.s ! ag.g ! ag.n ! RNom ++ slash.s ! t ! a ! p ! Sub ++ slash.n3 ! ag ++ slash.c2.s ; rp.s ! ag.g ! ag.n ! RNom ++ slash.s ! t ! a ! p ! Sub ++ slash.n3 ! ag ++ slash.c2.s ;
c = NPAcc c = NPAcc
} ; } ;
EmptyRelSlash slash = { EmptyRelSlash slash = {
s = \\t,a,p,ag,_ => s = \\t,a,p,ag,_ =>
slash.s ! t ! a ! p ! Sub ++ slash.n3 ! ag ++ slash.c2.s ; slash.s ! t ! a ! p ! Sub ++ slash.n3 ! ag ++ slash.c2.s ;
c = NPAcc c = NPAcc
} ; } ;
StrandQuestSlash ip slash = { StrandQuestSlash ip slash = {
s = \\t,a,p => s = \\t,a,p =>
let let
cls = slash.s ! t ! a ! p ; cls = slash.s ! t ! a ! p ;
who = ip.s ! accusative ; who = ip.s ! accusative ;
agr = agrP3 ip.g ip.n ; agr = agrP3 ip.g ip.n ;
@@ -61,9 +61,9 @@ concrete ExtendSwe of Extend = CatSwe **
} ; } ;
lin lin
PassVPSlash vps = PassVPSlash vps =
insertObj (\\a => vps.c2.s ++ vps.n3 ! a) (passiveVP vps) ; insertObj (\\a => vps.c2.s ++ vps.n3 ! a) (passiveVP vps) ;
PassAgentVPSlash vps np = PassAgentVPSlash vps np =
insertObjPost (\\a => vps.c2.s ++ vps.n3 ! a) (insertObj (\\_ => (PrepNP by8agent_Prep np).s) (passiveVP vps)) ; insertObjPost (\\a => vps.c2.s ++ vps.n3 ! a) (insertObj (\\_ => (PrepNP by8agent_Prep np).s) (passiveVP vps)) ;
lin UttVPShort vp = {s = infVP vp (agrP3 Utr Sg)} ; lin UttVPShort vp = {s = infVP vp (agrP3 Utr Sg)} ;
@@ -90,23 +90,23 @@ concrete ExtendSwe of Extend = CatSwe **
BaseVPS = twoTable2 Order Agr ; BaseVPS = twoTable2 Order Agr ;
ConsVPS = consrTable2 Order Agr comma ; ConsVPS = consrTable2 Order Agr comma ;
PredVPS np vpi = PredVPS np vpi =
let let
subj = np.s ! nominative ; subj = np.s ! nominative ;
agr = np.a ; agr = np.a ;
in { in {
s = \\o => s = \\o =>
let verb = vpi.s ! o ! agr let verb = vpi.s ! o ! agr
in case o of { in case o of {
Main => subj ++ verb ; Main => subj ++ verb ;
Inv => verb ++ subj ; ---- älskar henne och sover jag Inv => verb ++ subj ; ---- älskar henne och sover jag
Sub => subj ++ verb Sub => subj ++ verb
} }
} ; } ;
MkVPS t p vp = { MkVPS t p vp = {
s = \\o,a => s = \\o,a =>
let let
verb = vp.s ! Act ! VPFinite t.t t.a ; verb = vp.s ! Act ! VPFinite t.t t.a ;
neg = verb.a1 ! p.p ! a ; neg = verb.a1 ! p.p ! a ;
compl = vp.n2 ! a ++ vp.a2 ++ vp.ext ; compl = vp.n2 ! a ++ vp.a2 ++ vp.ext ;
@@ -128,13 +128,13 @@ concrete ExtendSwe of Extend = CatSwe **
RNP = {s : Agr => Str ; isPron : Bool} ; ---- inherent Agr needed: han färgar sitt hår vitt. But also depends on subject RNP = {s : Agr => Str ; isPron : Bool} ; ---- inherent Agr needed: han färgar sitt hår vitt. But also depends on subject
RNPList = {s1,s2 : Agr => Str} ; RNPList = {s1,s2 : Agr => Str} ;
lin lin
ReflRNP vps rnp = ReflRNP vps rnp =
insertObjPron insertObjPron
(andB (notB vps.c2.hasPrep) rnp.isPron) (andB (notB vps.c2.hasPrep) rnp.isPron)
rnp.s rnp.s
(insertObj (\\a => vps.c2.s ++ vps.n3 ! a) vps) ; (insertObj (\\a => vps.c2.s ++ vps.n3 ! a) vps) ;
ReflPron = {s = \\a => reflPron a ; isPron = True} ; ---- agr ?? ReflPron = {s = \\a => reflPron a ; isPron = True} ; ---- agr ??
ReflPoss num cn = { ReflPoss num cn = {
s = \\a => possPron a.n a.p num.n (ngen2gen cn.g) ++ num.s ! cn.g ++ cn.s ! num.n ! DDef Indef ! Nom ; s = \\a => possPron a.n a.p num.n (ngen2gen cn.g) ++ num.s ! cn.g ++ cn.s ! num.n ! DDef Indef ! Nom ;
@@ -159,7 +159,7 @@ concrete ExtendSwe of Extend = CatSwe **
ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ; ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ;
DetNPMasc, DetNPFem = \det -> DetNPMasc, DetNPFem = \det ->
let let
g = utrum ; ---- g = utrum ; ----
m = True ; ---- is this needed for other than Art? m = True ; ---- is this needed for other than Art?
in { in {
@@ -173,7 +173,7 @@ concrete ExtendSwe of Extend = CatSwe **
co = n1.co ++ BIND ++ n2.co ; co = n1.co ++ BIND ++ n2.co ;
g = n2.g g = n2.g
} ; } ;
CompoundAP noun adj = { CompoundAP noun adj = {
s = \\ap => noun.co ++ BIND ++ adj.s ! AF (APosit ap) Nom ; s = \\ap => noun.co ++ BIND ++ adj.s ! AF (APosit ap) Nom ;
isPre = True isPre = True
@@ -183,7 +183,7 @@ concrete ExtendSwe of Extend = CatSwe **
AdAdV = cc2 ; AdAdV = cc2 ;
PositAdVAdj a = {s = a.s ! AAdv} ; PositAdVAdj a = {s = a.s ! AAdv} ;
PresPartAP vp = { PresPartAP vp = {
s = \\af => case vp.isSimple of { s = \\af => case vp.isSimple of {
True => partVPPlus vp (PartPres Sg Indef Nom) (aformpos2agr af) Pos ; True => partVPPlus vp (PartPres Sg Indef Nom) (aformpos2agr af) Pos ;
@@ -206,13 +206,13 @@ concrete ExtendSwe of Extend = CatSwe **
} ; } ;
GerundCN vp = { -- infinitive: att dricka öl, att vara glad GerundCN vp = { -- infinitive: att dricka öl, att vara glad
s = \\_,_,_ => "att" ++ infVP vp {g = Utr ; n = Sg ; p = P3} ; s = \\_,_,_ => "att" ++ infVP vp {g = Utr ; n = Sg ; p = P3} ;
g = Neutr ; g = Neutr ;
isMod = False isMod = False
} ; } ;
GerundNP vp = { -- infinitive: att dricka öl, att vara glad GerundNP vp = { -- infinitive: att dricka öl, att vara glad
s = \\_ => "att" ++ infVP vp {g = Utr ; n = Sg ; p = P3} ; s = \\_ => "att" ++ infVP vp {g = Utr ; n = Sg ; p = P3} ;
a = {g = Neutr ; n = Sg ; p = P3} ; a = {g = Neutr ; n = Sg ; p = P3} ;
isPron = False isPron = False
} ; } ;
@@ -220,12 +220,14 @@ concrete ExtendSwe of Extend = CatSwe **
GerundAdv vp = { GerundAdv vp = {
s = partVPPlusPost vp (PartPres Sg Indef (Nom|Gen)) {g = Utr ; n = Sg ; p = P3} Pos -- sovande(s) i sängen s = partVPPlusPost vp (PartPres Sg Indef (Nom|Gen)) {g = Utr ; n = Sg ; p = P3} Pos -- sovande(s) i sängen
} ; } ;
ByVP vp = { -- infinitive: att dricka öl, att vara glad ByVP vp = { -- infinitive: att dricka öl, att vara glad
s = "genom att" ++ infVP vp {g = Utr ; n = Sg ; p = P3} s = "genom att" ++ infVP vp {g = Utr ; n = Sg ; p = P3}
} ; } ;
InOrderToVP vp = { -- infinitive: att dricka öl, att vara glad InOrderToVP vp = { -- infinitive: att dricka öl, att vara glad
s = "för att" ++ infVP vp {g = Utr ; n = Sg ; p = P3} s = "för att" ++ infVP vp {g = Utr ; n = Sg ; p = P3}
} ; } ;
AdvIsNP adv np = PredVP {s = \\_ => adv.s ; a = np.a ; isPron = False} (UseComp (CompNP np)) ;
} }