ported (most of) the new structures to PredFin

This commit is contained in:
aarne
2014-02-16 09:50:26 +00:00
parent 7831a3d8c3
commit cd58451c8e
4 changed files with 138 additions and 33 deletions

View File

@@ -29,6 +29,8 @@ oper
PrVerbPhrase = {
v : Agr => {fin,inf : Str} ;
inf : VVType => Str ;
imp : ImpType => Str ;
adj : Agr => Str ;
obj1 : Agr => Str ; -- Bool => Polarity => Agr => Str ; -- talo/talon/taloa
obj2 : Agr => Str ; -- Bool => Polarity => Agr => Str ; -- talo/talon/taloa
adv : Str ; -- Polarity => Str ; -- ainakin/ainakaan
@@ -47,6 +49,8 @@ oper
initPrVerbPhrase : PrVerbPhrase = {
v : Agr => {fin,inf : Str} = \\_ => {fin,inf = []} ;
inf : VVType => Str = \\vtt => [] ;
imp : ImpType => Str = \\_ => [] ;
adj : Agr => Str = \\_ => [] ;
obj1 : Agr => Str = \\_ => [] ;
obj2 : Agr => Str = \\_ => [] ;
adv : Str = [] ;
@@ -70,7 +74,9 @@ oper
SCNom => \\agr => finV (a.s ++ t.s ++ p.s) t.t a.a p.p Act agr (lin PrV verb) ;
_ => \\_ => finV (a.s ++ t.s ++ p.s) t.t a.a p.p Act defaultAgr (lin PrV verb)
} ;
inf : VVType => Str = \\vtt => infV (a.s ++ p.s) a.a p.p Act (lin PrV verb) vtt ;
inf : VVType => Str = \\vtt => tenseInfV (a.s ++ p.s) a.a p.p Act (lin PrV verb) vtt ;
imp : ImpType => Str = \\it => imperativeV p.s p.p it (lin PrV verb) ;
adj : Agr => Str = \\_ => [] ;
obj1 : Agr => Str = \\_ => [] ;
obj2 : Agr => Str = \\_ => [] ;
adv : Str = [] ;
@@ -93,6 +99,7 @@ oper
PrClause = {
subj : Str ;
verb : {fin,inf : Str} ;
adj : Str ;
obj1 : Str ;
obj2 : Str ;
adv : Str ;
@@ -104,6 +111,7 @@ oper
initPrClause : PrClause = {
subj : Str = [] ;
verb : {fin,inf : Str} = {fin,inf = []} ;
adj : Str = [] ;
obj1 : Str = [] ;
obj2 : Str = [] ;
adv : Str = [] ;
@@ -149,8 +157,13 @@ oper
noObj : Agr => Str = \\_ => [] ;
RPCase = NPCase ;
subjRPCase : Agr -> RPCase = \a -> subjCase ;
NAgr = Number ;
IPAgr = Number ; --- two separate fields in RGL
RPAgr = ResFin.RAgr ;
ICAgr = Agr ;
defaultAgr : Agr = Ag Sg P3 ;
@@ -161,11 +174,18 @@ oper
agr2nagr : Agr -> NAgr = \a -> case a of {Ag n _ => n ; AgPol => Sg} ; -- minä olen pomo / te olette pomoja / te olette pomo
agr2icagr : Agr -> ICAgr = \a -> a ;
-- restoring full Agr
ipagr2agr : IPAgr -> Agr = \a -> Ag a P3 ;
ipagr2vagr : IPAgr -> VAgr = \n -> Ag n P3 ;
rpagr2agr : RPAgr -> Agr -> Agr = \ra,a -> case ra of {
RAg ag => ag ;
RNoAg => a
} ;
--- this is only needed in VPC formation
vagr2agr : VAgr -> Agr = \a -> a ;
@@ -199,17 +219,38 @@ oper
in
sa ++ ovps.fin ++ ovps.inf ;
tenseInfV : Str -> Anteriority -> Polarity -> SVoice -> PrVerb -> VVType -> Str = infV ;
{-
\sa,a,pol,o,v,vt ->
let vt = Inf1 ; ----
ovps = (S.vp2old_vp (S.predV v)).s ! VIInf vt ! a ! pol ! defaultAgr ; -- VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
in
sa ++ ovps.fin ++ ovps.inf ;
-}
infVP : VVType -> Agr -> PrVerbPhrase -> Str = \vvt,agr,vp ->
vp.inf ! vvt ++ vp.adV ++ vp.obj1 ! agr ++ vp.obj2 ! agr ++ vp.adv ++ vp.ext ;
vp.inf ! vvt ++ vp.adV ++ vp.adj ! agr ++ vp.obj1 ! agr ++ vp.obj2 ! agr ++ vp.adv ++ vp.ext ;
impVP : Number -> PrVerbPhrase -> Str = \n,vp ->
let agr = Ag n P2 in
vp.imp ! n ++ vp.adV ++ vp.adj ! agr ++ vp.obj1 ! agr ++ vp.obj2 ! agr ++ vp.adv ++ vp.ext ;
declCl : PrClause -> Str = \cl ->
cl.subj ++ cl.verb.fin ++ cl.adV ++ cl.verb.inf ++ cl.obj1 ++ cl.obj2 ++ cl.adv ++ cl.ext ;
cl.subj ++ cl.verb.fin ++ cl.adV ++ cl.verb.inf ++ cl.adj ++ cl.obj1 ++ cl.obj2 ++ cl.adv ++ cl.ext ;
declSubordCl : PrClause -> Str = declCl ;
declInvCl : PrClause -> Str = declCl ; ---
questCl : PrQuestionClause -> Str = \cl ->
cl.verb.fin ++ Predef.BIND ++ "ko" ++ cl.subj ++ cl.adV ++ cl.verb.inf ++ cl.obj1 ++ cl.obj2 ++ cl.adv ++ cl.ext ;
questCl : PrQuestionClause -> Str = \cl ->
let
ko = case cl.h of {Back => "ko" ; Front => "kö"}
in
case cl.focType of {
NoFoc => cl.verb.fin ++ Predef.BIND ++ ko ++
cl.subj ++ cl.adV ++ cl.verb.inf ++ cl.adj ++ cl.obj1 ++ cl.obj2 ++ cl.adv ++ cl.ext ;
_ => cl.foc ++ cl.verb.fin ++
cl.subj ++ cl.adV ++ cl.verb.inf ++ cl.adj ++ cl.obj1 ++ cl.obj2 ++ cl.adv ++ cl.ext
} ;
questSubordCl : PrQuestionClause -> Str = questCl ;
@@ -228,17 +269,18 @@ oper
in
<sta ++ ovps.fin, ovps.inf, []> ;
tenseInfV : Str -> Anteriority -> Polarity -> SVoice -> PrVerb -> VVType -> Str =
\sa,a,pol,o,v,vt ->
let vt = Inf1 ; ----
ovps = (S.vp2old_vp (S.predV v)).s ! VIInf vt ! a ! pol ! defaultAgr ; -- VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
in
sa ++ ovps.fin ++ ovps.inf ;
imperativeV : Str -> Polarity -> ImpType -> PrVerb -> Str = \s,p,it,v ->
let
ovps = (S.vp2old_vp (S.predV v)).s ! VIImper ! Simul ! p ! Ag it P2 ;
in
s ++ ovps.fin ++ ovps.inf ;
tenseCopula : Str -> STense -> Anteriority -> Polarity -> VAgr -> Str * Str * Str =
\s,t,a,p,agr -> tenseV s t a p Act agr (liftV P.olla_V) ;
tenseInfCopula : Str -> Anteriority -> Polarity -> VVType -> Str =
\s,a,p,vt -> tenseInfV s a p Act (liftV P.olla_V) vt ;
tenseImpCopula : Str -> Polarity -> ImpType -> Str =
\s,p,it -> imperativeV s p it (liftV P.olla_V) ;
noObj : Agr => Str = \\_ => [] ;