1
0
forked from GitHub/gf-rgl

(Est) New linearisations in ExtendEst

This commit is contained in:
Inari Listenmaa
2022-04-12 19:03:22 +08:00
parent 0aaa38e051
commit 983274d239

View File

@@ -3,19 +3,29 @@
concrete ExtendEst of Extend = concrete ExtendEst of Extend =
CatEst ** ExtendFunctor - CatEst ** ExtendFunctor -
[ [
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList, -- Extensions of VP
AdAdV, AdjAsCN, AdjAsNP, ApposNP, VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2,
BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, QuestVPS, SQuestVPS, RelVPS,
MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2, MkVPS2, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, ReflVPS2,
Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN, MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2,
CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP,
CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPFem, EmbedPresPart, -- Reflexives
ExistsNP, FocusAP, FocusAdV, FocusAdv, FocusObj, FrontExtPredVP, GenIP, GenModIP, GenModNP, GenNP, GenRP, RNP, RNPList, Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ConjRNP, Cons_nr_RNP, Cons_rr_RNP, PredetRNP, ReflRNP, ReflPoss, ReflPron,
GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, InvFrontExtPredVP, MkVPS, NominalizeVPSlashNP,
PassAgentVPSlash, PassVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN, -- Rest in alphabetical order
PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP, A2VPSlash, ByVP,
UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2 CardCNCard, CompBareCN, CompIQuant, CompQS, CompS, CompVP,
ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP, CompoundN,
EmbedPresPart, EmbedSSlash, EmptyRelSlash, ExistsNP, ExistCN, ExistMassCN, ExistPluralCN,
FocusAP, FocusAdV, FocusAdv, FocusObj, FrontComplDirectVQ, FrontComplDirectVS,
GenIP, GenModIP, GenModNP, GenNP, GenRP, GerundAdv, GerundCN, GerundNP,
IAdvAdv, ICompAP, InOrderToVP, N2VPSlash, NominalizeVPSlashNP,
PassAgentVPSlash, PassVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj,
PredAPVP, PredIAdvVP, PredVPSVV, PresPartAP, PrepCN, ProDrop, ProgrVPSlash, PurposeVP,
SlashBareV2S, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP
] ]
with with
(Grammar = GrammarEst) ** (Grammar = GrammarEst) **
@@ -24,264 +34,395 @@ concrete ExtendEst of Extend =
GrammarEst, GrammarEst,
ResEst, ResEst,
(R=ResEst), (R=ResEst),
(X=ExtraEst),
IdiomEst, IdiomEst,
Coordination, Coordination,
Prelude, Prelude,
MorphoEst, MorphoEst,
LexiconEst, LexiconEst,
ParadigmsEst in { ParadigmsEst in {
---------------------------------
-- VPS, VPI, VPS2 + list versions
lincat
VPS = X.VPS ;
[VPS] = X.ListVPS ;
VPI = X.VPI ;
[VPI] = X.ListVPI ;
VPS2 = X.VPS ** {c2 : Compl} ;
[VPS2] = X.ListVPS ** {c2 : Compl} ;
VPI2 = X.VPI ** {c2 : Compl} ;
[VPI2] = X.ListVPI ** {c2 : Compl} ;
lin lin
-- : NP -> Quant ; -- this man's MkVPS = X.MkVPS ;
GenNP np = { BaseVPS = X.BaseVPS ;
s,sp = \\_,_ => np.s ! NPCase Gen ; ConsVPS = X.ConsVPS ;
isNum = False ; ConjVPS = X.ConjVPS ;
isDef = True ;
isNeg = False
} ;
-- : IP -> IQuant ; -- whose PredVPS = X.PredVPS ;
GenIP ip = { s = \\_,_ => ip.s ! NPCase Gen } ; -- QuestVPS
-- SQuestVPS
-- RelVPS
-- : Num -> CN -> RP ; -- whose car MkVPI = X.MkVPI ;
GenRP num cn = { BaseVPI = X.BaseVPI ;
s = \\n,c => let k = npform2case num.n c in relPron ! NCase n Gen ++ cn.s ! NCase num.n k ; ConsVPI = X.ConsVPI ;
a = RNoAg ConjVPI = X.ConjVPI ;
} ; ComplVPIVV = X.ComplVPIVV ;
-- In case the first two are not available, the following applications should in any case be. MkVPS2 t p vps = MkVPS t p vps ** {c2 = vps.c2} ;
-- BaseVPS2, ConsVPS2, ConjVPS2,
-- : Num -> NP -> CN -> NP ; -- this man's car(s) ComplVPS2 v np = lin VPS (v ** {
GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ; -- TODO: param to record whether it's pos or neg, so we get right form of np
s = \\agr => v.s ! agr ++ appCompl True Pos v.c2 np ;
-- : Num -> IP -> CN -> IP ; -- whose car(s) }) ;
GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
{-
-- ReflVPS2 v rnp =
-- MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2,
---------------------------------
-- RNP + all related funs
lincat lincat
VPS = {s : Agr => Str} ; RNP = {s : Agr => NPForm => Str} ;
[VPS] = {s1,s2 : Agr => Str} ; RNPList = {s1,s2 : Agr => NPForm => Str} ;
VPI = {s : VVType => Agr => Str} ;
[VPI] = {s1,s2 : VVType => Agr => Str} ;
lin
BaseVPS = twoTable Agr ;
ConsVPS = consrTable Agr comma ;
BaseVPI = twoTable2 VVType Agr ;
ConsVPI = consrTable2 VVType Agr comma ;
MkVPS t p vp = mkVPS (lin Temp t) (lin Pol p) (lin VP vp) ;
ConjVPS c xs = conjunctDistrTable Agr c xs ;
PredVPS np vps = {s = np.s ! npNom ++ vps.s ! np.a} ;
MkVPI vp = mkVPI (lin VP vp) ;
ConjVPI c xs = conjunctDistrTable2 VVType Agr c xs ;
ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ;
-------- two-place verb conjunction
lincat
VPS2 = {s : Agr => Str ; c2 : Str} ;
[VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ;
VPI2 = {s : VVType => Agr => Str ; c2 : Str} ;
[VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ;
lin
MkVPS2 t p vpsl = mkVPS (lin Temp t) (lin Pol p) (lin VP vpsl) ** {c2 = vpsl.c2} ;
MkVPI2 vpsl = mkVPI (lin VP vpsl) ** {c2 = vpsl.c2} ;
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} ;
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} ;
ConjVPS2 c xs = conjunctDistrTable Agr c xs ** {c2 = xs.c2} ;
ConjVPI2 c xs = conjunctDistrTable2 VVType Agr c xs ** {c2 = xs.c2} ;
ComplVPS2 vps2 np = {} ;
ComplVPI2 vpi2 np = {} ;
oper oper
mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {} ; rnp2np : Agr -> RNP -> NP = \agr,rnp -> lin NP {
a = agr ;
s = rnp.s ! agr ;
isPron = False ; -- ??
} ;
mkVPI : VP -> VPI = \vp -> lin VPI {} ; lin
-- : VPSlash -> RNP -> VP ; -- support my family and myself
ReflRNP vps rnp = insertObj (\\b,p,a => appCompl True Pos vps.c2 (rnp2np a rnp)) vps ;
----- -- : RNP
-} ReflPron = {s = \\agr,npf => (reflPron agr).s ! npf} ;
lin -- : Num -> CN -> RNP ; -- my car(s)
-- : AP -> IComp ; -- "how old" ReflPoss num cn = {
ICompAP ap = icompAP "kui" ap ; s = \\a,npf => possPron ! a ++ num.s ! Sg ! Nom ++
case npf of {
NPCase c => cn.s ! NCase num.n c ;
NPAcc => cn.s ! NCase num.n Gen } ;
} ;
-- : Adv -> IAdv ; -- "how often" PredetRNP predet rnp = {
IAdvAdv adv = { s = "kui" ++ adv.s } ; s = \\a,c => case a of {
Ag n p => predet.s ! n ! c ++ rnp.s ! a ! c ;
AgPol => predet.s ! Pl ! c ++ rnp.s ! a ! c }
} ;
-- : VP -> AP ; -- (the man) looking at Mary / filme vaatav (mees) ConjRNP conj rpns = conjunctDistrTable2 Agr NPForm conj rpns ;
PresPartAP vp = {
s = \\_,_ => vp2adv vp True VIPresPart ;
infl = Invariable
} ;
{- TODO: need to change VP to get the following 3 functions to work properly: Base_rr_RNP x y = twoTable2 Agr NPForm x y ;
Base_nr_RNP x y = twoTable2 Agr NPForm {s = \\a => x.s} y ;
Base_rn_RNP x y = twoTable2 Agr NPForm x {s = \\a => y.s} ;
Cons_rr_RNP x xs = consrTable2 Agr NPForm comma x xs ;
Cons_nr_RNP x xs = consrTable2 Agr NPForm comma {s = \\a => x.s} xs ;
{-
-- : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children
PossPronRNP pron num cn rnp =
-- : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife
AdvRAP adv rp =
-- : VP -> Prep -> RNP -> VP ; -- lectured about her travels
AdvRNP adv rp =
-- : AP -> Prep -> RNP -> AP ; -- adamant in his refusal
AdvRVP adv rp =
-}
oper
possPron : Agr => Str = table {
Ag Sg P1 => "minu" ;
Ag Sg P2 => "sinu" ;
Ag Sg P3 => "tema" ;
Ag Pl P1 => "meie" ;
Ag Pl P2 => "teie" ;
Ag Pl P3 => "nende" ;
AgPol => "teie"
} ;
---------------------------------
-- A - B
lin
AdAdV ad adv = AdAdv ad adv ;
-- : AP -> CN ; -- a green one ; en grön (Swe)
AdjAsCN ap = {s = ap.s ! True} ; -- True = attributive ; False = predicative
-- : AP -> NP
AdjAsNP ap = MassNP (AdjAsCN ap) ;
-- : NP -> NP -> NP
ApposNP np1 np2 = np2 ** {
s = \\nf => np1.s ! nf ++ np2.s ! nf ; -- comma or not?
} ;
-- : Adv -> NP -> Cl ; -- here is the tree / here are the trees
AdvIsNP adv np = mkClause (\_ -> adv.s) (agrP3 Sg) (UseComp (CompNP np)) ;
-- : A2 -> VPSlash
A2VPSlash a2 = UseComp (CompAP (UseA2 a2)) ** {c2 = a2.c2} ;
-- : VP -> Adv ;
ByVP vp = {s = vp2adv vp True (VIInf InfDes)} ;
---------------------------------
-- C
lin
-- : VS -> S -> VP ;
ComplBareVS v s = insertExtrapos s.s (predV v) ;
-- : N -> N -> N ; -- control system / controls system / control-system
CompoundN noun cn = cn ** {
s = \\nf => noun.s ! NCase Sg Gen ++ BIND ++ cn.s ! nf
} ;
-- : N -> A -> AP ; -- language independent / language-independent
CompoundAP n a = PositA (a ** {s = \\d,af => n.s ! NCase Sg Nom ++ BIND ++ a.s ! d ! af}) ;
-- : VS -> Utt -> VP ; -- say: "today"
ComplDirectVS vs utt = insertExtrapos (BIND ++ ":" ++ utt.s) (predV vs) ;
-- : VQ -> Utt -> VP ; -- ask: "when"
ComplDirectVQ vq utt = insertExtrapos (BIND ++ ":" ++ utt.s) (predV vq) ;
-- : S -> Comp ; -- (the fact is) that she sleeps
CompS s = {s = \\_ => "et" ++ s.s} ;
-- : QS -> Comp ; -- (the question is) who sleeps
CompQS qs = {s = \\_ => qs.s } ;
-- : Ant -> Pol -> VP -> Comp ; -- (she is) to go
CompVP ant pol vp = {s = \\a => infVPAnt ant.a (NPCase Nom) pol.p a vp InfDa } ;
-- ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++ infVP v.typ vp a.a p.p agr)
-- (predVV v) ;
-- ComplSlashPartLast vps np = {} ; --- AR 7/3/2013
---------------------------------
-- E - F
lin
{- TODO: need to change VP to get EmbedPresPart and various Gerunds to work:
1) Add "mine" form into VP (or switch to a BIND solution and just add a stem) 1) Add "mine" form into VP (or switch to a BIND solution and just add a stem)
2) Change s2 in VP so that we can manipulate the complement to be in genitive! 2) Change s2 in VP so that we can manipulate the complement to be in genitive!
-- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore) -- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore)
EmbedPresPart vp = EmbedPresPart vp =
let vpGen = vp ; --** { s2 = \\_,_,_ => vp.s2 ! True ! Pos ! } let vpGen = vp ; --** { s2 = \\_,_,_ => vp.s2 ! True ! Pos ! }
{s = vp2adv vp True VI } ; {s = vp2adv vp True VI } ;
-}
-- : VP -> CN -- publishing of the document (can get a determiner) EmbedSSlash s = {s = s.s ++ s.c2.s} ;
GerundCN vp = {} ;
-- : VP -> NP -- publishing the document (by nature definite) -- : ClSlash -> RCl ; -- he lives in
GerundNP vp = {} ; EmptyRelSlash cls = {
-} s = \\t,a,p,_ => cls.s ! t ! a ! p ++ cls.c2.s ;
c = NPCase Nom
} ;
-- : VPSlash -> AP ; -- täna leitud -- : CN -> Cl ; -- there is a car / there is no car ; there is beer / there is no beer ; there are
PastPartAP vp = { -- TODO: these all use the literal "exist" verb. Does Estonian have a construction for "there is"?
s = \\_,_ => vp2adv vp True (VIPass Past) ; ExistCN, ExistMassCN = \cn -> ExistsNP (MassNP cn) ;
infl = Invariable } ; ExistPluralCN cn = ExistsNP (DetCN (DetQuant IndefArt NumPl) cn) ;
-- : VPSlash -> NP -> AP -- hobisukeldujate poolt leitud (süvaveepomm) -- : NP -> Cl ; -- there exists a number / there exist numbers
PastPartAgentAP vp np = { ExistsNP = IdiomEst.ExistNP ;
s = \\_,_ => np.s ! NPCase Gen ++ "poolt"
++ vp2adv vp True (VIPass Past) ;
infl = Invariable } ;
-- : VP -> Adv -- : AP -> NP -> Utt ; -- green was the tree
GerundAdv vp = FocusAP ap np =
{ s = vp2adv vp True (VIInf InfDes) } ; let pred : VP = UseComp (CompNP np) ;
subj : NP = AdjAsNP ap ;
cl : Cl = PredVP subj pred ;
in UttS (UseCl (TTAnt TPres ASimul) PPos cl) ; -- use AdvIsNP for similar construction but that returns a Cl instead
WithoutVP vp = -- ilma raamatut nägemata -- : Ad[vV] -> S -> Utt -- today I will sleep
{ s = "ilma" ++ vp2adv vp False (VIInf InfMata) } ; FocusAdV, FocusAdv = \adv,s -> cc2 adv s ;
InOrderToVP vp = -- et raamatut paremini näha -- : NP -> SSlash -> Utt ; -- her I love
{ s = "et" ++ vp2adv vp True (VIInf InfDa) } ; FocusObj np sslash = {s = appCompl True Pos sslash.c2 np ++ sslash.s} ;
ByVP vp =
{ s = vp2adv vp True (VIInf InfDes) } ;
oper -- : NP -> VS -> Utt -> Cl ; -- "I am here", she said
vp2adv : R.VP -> Bool -> VIForm -> Str = \vp,sentIsPos,vif -> FrontComplDirectVS np vs utt =
vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut let cl : Cl = PredVP np (UseV vs) ;
++ vp.adv -- paremini in cl ** {s = \\t,a,p,o => utt.s ++ bindComma ++ cl.s ! t ! a ! p ! o} ;
++ vp.p -- ära
++ (vp.s ! vif ! Simul ! Pos ! agrP3 Sg).fin -- tunda/tundes/tundmata/...
++ vp.ext ;
lin -- : NP -> VQ -> Utt -> Cl ; -- "where", she asked
{- FrontComplDirectVQ np vq utt =
let cl : Cl = PredVP np (UseV vq) ;
in cl ** {s = \\t,a,p,o => utt.s ++ bindComma ++ cl.s ! t ! a ! p ! o} ;
NominalizeVPSlashNP vpslash np = {} ;
PassVPSlash vps = passVPSlash (lin VPS vps) [] ;
PassAgentVPSlash vps np = passVPSlash (lin VPS vps) ("by" ++ np.s ! NPAcc) ;
--- AR 7/3/2013 ---------------------------------
ComplSlashPartLast vps np = {} ; -- G
-}
-- : NP -> Cl ; -- there exists a number / there exist numbers
ExistsNP = IdiomEst.ExistNP ;
{- lin
ComplBareVS v s = insertExtra s.s (predV v) ; -- : NP -> Quant ; -- this man's
SlashBareV2S v s = insertExtrac s.s (predVc v) ; GenNP np = {
-} s,sp = \\_,_ => np.s ! NPCase Gen ;
isNum = False ;
isDef = True ;
isNeg = False
} ;
-- : N -> N -> N ; -- control system / controls system / control-system -- : IP -> IQuant ; -- whose
CompoundN noun cn = lin N { GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ;
s = \\nf => noun.s ! NCase Sg Gen ++ BIND ++ cn.s ! nf
} ;
{-
-- : N -> A -> AP ; -- language independent / language-independent
CompoundAP noun adj = {} ;
-- : VS -> Utt -> VP ; -- say: "today" -- : Num -> CN -> RP ; -- whose car
ComplDirectVS vs utt = {} ; GenRP num cn = {
-- : VQ -> Utt -> VP ; -- ask: "when" s = \\n,c => let k = npform2case num.n c
ComplDirectVQ vq utt = {} ; in relPron ! NCase n Gen ++ cn.s ! NCase num.n k ;
a = RNoAg
} ;
-- : NP -> VS -> Utt -> Cl ; -- "I am here", she said -- In case the first two are not available, the following applications should in any case be.
FrontComplDirectVS np vs utt = {} ;
-- : NP -> VQ -> Utt -> Cl ; -- "where", she asked
FrontComplDirectVQ np vq utt = {} ;
-}
-- : AP -> VP -> Cl ; -- it is good to walk / on hea kõndida -- : Num -> NP -> CN -> NP ; -- this man's car(s)
PredAPVP ap vp = GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ;
let heaOllaVP : VP = insertObj (\\_,_ => ap.s) vp ; -- puts AP into the s2 field
heaOllaComp : Comp = CompVP ASimul PPos heaOlla ; -- chooses InfDa, fixes word order
heaOlla : VP = UseComp heaOllaComp -- looks silly, but I want to reuse the abstract syntax funs :-P
in existClause noSubj (agrP3 Sg) heaOlla ;
oper -- : Num -> IP -> CN -> IP ; -- whose car(s)
testCl = PredAPVP (PositA good_A) (UseV walk_V) ; GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
-- : VP -> Adv
GerundAdv vp = {s = vp2adv vp True (VIInf InfDes)} ;
-- : VP -> CN -- publishing of the document (can get a determiner)
-- GerundCN vp = {} ;
-- : VP -> NP -- publishing the document (by nature definite)
-- GerundNP vp = {} ;
---------------------------------
-- I - N
lin lin
-- : AP -> CN ; -- a green one ; en grön (Swe) -- : AP -> IComp ; -- "how old"
AdjAsCN ap = { s = ap.s ! True } ; -- True = it's a modifier, not a predicate ICompAP ap = icompAP "kui" ap ;
AdjAsNP ap = { -- : Adv -> IAdv ; -- "how often"
s = table { NPCase c => ap.s ! True ! NCase Sg c ; IAdvAdv adv = { s = "kui" ++ adv.s } ;
NPAcc => ap.s ! True ! NCase Sg Gen } ;
a = agrP3 Sg ; -- : VP -> Adv
isPron = False InOrderToVP vp = -- et raamatut paremini näha
} ; { s = "et" ++ vp2adv vp True (VIInf InfDa) } ;
{-
lincat -- : N2 -> VPSlash
RNP = {s : Agr => Str} ; N2VPSlash n2 = UseComp (CompCN (UseN2 n2)) ** {c2 = n2.c2} ;
RNPList = {s1,s2 : Agr => Str} ;
-- : VPSlash -> NP -> NP ; publishing of the document
-- NominalizeVPSlashNP vpslash np = {} ;
---------------------------------
-- P
lin lin
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
-- : RNP -- : VPSlash -> NP -> VP ; -- be begged by her to go
ReflPron = {s = reflPron} ; PassAgentVPSlash vps np = let vp : VP = PassVPSlash vps in vp ** {
adv = vp.adv ++ np.s ! NPCase Gen ++ "poolt" ;
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! Nom ++ cn.s ! num.n ! Nom} ; } ;
PredetRNP predet rnp = {s = \\a => predet.s ++ rnp.s ! a} ;
ConjRNP conj rpns = conjunctDistrTable Agr conj rpns ;
Base_rr_RNP x y = twoTable Agr x y ;
Base_nr_RNP x y = twoTable Agr {s = \\a => x.s ! NPAcc} y ;
Base_rn_RNP x y = twoTable Agr x {s = \\a => y.s ! NPAcc} ;
Cons_rr_RNP x xs = consrTable Agr comma x xs ;
Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
---- TODO: RNPList construction -- : VPSlash -> VP ; -- be forced to sleep
PassVPSlash vps = vps ** {
s = \\vf => case vf of {
VIFin t => vps.s ! VIPass t ;
x => vps.s ! x } ;
sc = compl2subjcase vps.c2
} ;
ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++ -- : VPSlash -> AP ; -- täna leitud
infVP v.typ vp a.a p.p agr) PastPartAP vp = {
(predVV v) ; s = \\_,_ => vp2adv vp True (VIPass Past) ;
-} infl = Invariable
-- : S -> Comp ; -- (the fact is) that she sleeps } ;
CompS s = {s = \\_ => "et" ++ s.s} ;
-- : QS -> Comp ; -- (the question is) who sleeps -- : VP -> AP ; -- (the man) looking at Mary / filme vaatav (mees)
CompQS qs = {s = \\_ => qs.s } ; PresPartAP vp = {
s = \\_,_ => vp2adv vp True VIPresPart ;
infl = Invariable
} ;
-- : Ant -> Pol -> VP -> Comp ; -- (she is) to go -- : VPSlash -> NP -> AP -- hobisukeldujate poolt leitud (süvaveepomm)
CompVP ant pol vp = {s = \\a => infVPAnt ant.a (NPCase Nom) pol.p a vp InfDa } ; PastPartAgentAP vp np = {
s = \\_,_ => np.s ! NPCase Gen ++ "poolt" ++ vp2adv vp True (VIPass Past) ;
infl = Invariable
} ;
-- English-specific PositAdVAdj = PositAdvAdj ;
-- : Pol
UncontractedNeg = { s = [] ; p = Neg } ;
-- : VP -> Utt ; -- There's no "short form", so just using InfMa instead of InfDa -- : AP -> VP -> Cl ; -- it is good to walk / on hea kõndida
UttVPShort vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfMa} ; PredAPVP ap vp =
--TODO: maybe InfMa should be default in PhraseEst and InfDa here? let heaOllaVP : VP = insertObj (\\_,_,_ => ap.s ! True ! NCase Sg Nom) vp ; -- puts AP into the s2 field
heaOllaComp : Comp = CompVP ASimul PPos heaOllaVP ; -- chooses InfDa, fixes word order
heaOlla : VP = UseComp heaOllaComp -- looks silly, but I want to reuse the abstract syntax funs :-P
in existClause noSubj (agrP3 Sg) heaOlla ;
-- : IAdv -> VP -> QCl ; -- how to walk?
PredIAdvVP iadv vp = {s = \\t,a,p => iadv.s ++ vp2adv vp True (VIInf InfMa)} ;
PrepCN prep cn = PrepNP prep (MassNP cn) ;
ProDrop pron = pron ** {s = \\_ => []} ;
ProgrVPSlash vps = ProgrVP vps ** vps ;
PurposeVP = InOrderToVP ; --- is there a difference?
oper
vp2adv : R.VP -> Bool -> VIForm -> Str = \vp,sentIsPos,vif ->
vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut
++ vp.adv -- paremini
++ vp.p -- ära
++ (vp.s ! vif ! Simul ! Pos ! agrP3 Sg).fin -- tunda/tundes/tundmata/...
++ vp.ext ;
---------------------------------
-- S - W
lin
-- SlashBareV2S v s = insertExtrapos s.s (predV v) ** v ;
UseDAP,
UseDAPFem,
UseDAPMasc = DetNP ;
UttAccIP ip = {s = ip.s ! NPAcc} ;
UttAccNP np = {s = np.s ! NPAcc} ;
UttAdV adv = adv ;
UttDatIP ip = {s = ip.s ! NPCase Part} ; -- is partitive a reasonable translation?
UttDatNP np = {s = np.s ! NPCase Part} ;
-- : VP -> Utt ; -- There's no "short form", so just using InfMa instead of InfDa
UttVPShort vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfMa} ;
--TODO: maybe InfMa should be default in PhraseEst and InfDa here?
WithoutVP vp = -- ilma raamatut nägemata
{ s = "ilma" ++ vp2adv vp False (VIInf InfMata) } ;
} }