(Dut) Fixes in ComplSlash, mkClause, ProgrVP + general cleanup

This commit is contained in:
Inari Listenmaa
2018-04-18 10:13:55 +02:00
parent 100bb34dcd
commit f2a02c438d
4 changed files with 59 additions and 86 deletions

View File

@@ -17,25 +17,6 @@ concrete ExtraDut of ExtraDutAbs = CatDut **
ComplVPIVV v vpi = ComplVPIVV v vpi =
insertInf (vpi.s ! v.isAux) ( insertInf (vpi.s ! v.isAux) (
predVGen v.isAux BeforeObjs v) ; ---- predVGen v.isAux BeforeObjs v) ; ----
--{-
-- insertExtrapos vpi.p3 (
-- insertInf vpi.p2 (
-- insertObj vpi.p1 (
-- predVGen v.isAux vpi.negPos v))) ;
---}
--
-- PPzuAdv cn = {s = case cn.g of {
-- Masc | Neutr => "zum" ;
-- Fem => "zur"
-- } ++ cn.s ! adjfCase Weak Dat ! Sg ! Dat
-- } ;
--
-- TImpfSubj = {s = [] ; t = Past ; m = MConjunct} ; --# notpresent
--
-- moegen_VV = auxVV mögen_V ;
--
--}
lin lin
ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ; ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ;

View File

@@ -32,16 +32,14 @@ concrete IdiomDut of Idiom = CatDut **
} }
} ; } ;
ProgrVP vp = insertObj (\\agr => "aan" ++ "het" ++ useInfVP True vp ! agr) (predV zijn_V) ; ProgrVP vp = let vpi = infVP True vp in
insertAdv ("aan het" ++ vpi.inf ++ vpi.ext)
(insertObj vpi.obj (compV zijn_V)) ;
ImpPl1 vp = ImpPl1 vp =
let let
v = laten_V ; v = laten_V ;
vpi = infVP True vp ; vvp = insertInfVP True vp (predVGen True vp.negPos v) ;
vvp = insertExtrapos vpi.p3 (
insertInf vpi.p2 (
insertObj vpi.p1 (
predVGen True vp.negPos v))) ;
in in
{s = (mkClause "we" {g = Utr ; n = Pl ; p = P1} vvp).s ! {s = (mkClause "we" {g = Utr ; n = Pl ; p = P1} vvp).s !
Pres ! Simul ! Pos ! Inv Pres ! Simul ! Pos ! Inv

View File

@@ -575,10 +575,6 @@ param
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> { mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> {
s = \\t,a,b,o => s = \\t,a,b,o =>
let let
ord = case o of {
Sub => True ; -- glue prefix to verb
_ => False
} ;
vform = vForm t agr.g agr.n agr.p o ; vform = vForm t agr.g agr.n agr.p o ;
auxv = (auxVerb vp.s.aux).s ; auxv = (auxVerb vp.s.aux).s ;
vperf = vp.s.s ! VPerf ; vperf = vp.s.s ! VPerf ;
@@ -593,12 +589,16 @@ param
obj0 = vp.n0 ! agr ; obj0 = vp.n0 ! agr ;
obj = vp.n2 ! agr ; obj = vp.n2 ! agr ;
part = vp.s.particle ; part = vp.s.particle ;
pref = case a of {
Anter => [] ; -- prefix is part of participle: toegevoegd
_ => vp.s.prefix -- prefix not present in verb form
} ;
compl = case vp.negPos of { compl = case vp.negPos of {
BeforeObjs => neg ++ obj0 ++ obj ++ part ++ vp.a2 ++ vp.s.prefix ; BeforeObjs => neg ++ obj0 ++ obj ++ part ++ vp.a2 ++ pref ;
AfterObjs => obj0 ++ obj ++ neg ++ part ++ vp.a2 ++ vp.s.prefix ; AfterObjs => obj0 ++ obj ++ neg ++ part ++ vp.a2 ++ pref ;
BetweenObjs => obj0 ++ neg ++ obj ++ part ++ vp.a2 ++ vp.s.prefix BetweenObjs => obj0 ++ neg ++ obj ++ part ++ vp.a2 ++ pref
} ; } ;
inf : Str = inf : Str =
case <vp.isAux, vp.inf.p2, a> of { case <vp.isAux, vp.inf.p2, a> of {
<True,True,Anter> => vp.s.s ! VInf ++ vp.inf.p1 ; --# notpresent <True,True,Anter> => vp.s.s ! VInf ++ vp.inf.p1 ; --# notpresent
_ => verb.p2 ++ vp.inf.p1 } ; -- cunger: changed from vp.inf.p1 ++ verb.p2 _ => verb.p2 ++ vp.inf.p1 } ; -- cunger: changed from vp.inf.p1 ++ verb.p2
@@ -608,15 +608,12 @@ param
inffin : Str = inffin : Str =
case <t,a,vp.isAux> of { case <t,a,vp.isAux> of {
-- gezien zou/zal hebben -- gezien zou/zal hebben
<Cond,Anter,False> => vperf ++ fin ++ auxv ! VInf ; --# notpresent <Fut|Cond,Anter,False> => vperf ++ fin ++ auxv ! VInf ++ vp.inf.p1 ; --# notpresent
<Fut,Anter,False> => vperf ++ fin ++ auxv ! VInf ; --# notpresent
-- zou/zal zien -- zou/zal zien
<Cond,Simul,False> => fin ++ verb.p2 ; <Fut|Cond,Simul,False> => fin ++ verb.p2 ++ vp.inf.p1 ;
<Fut,Simul,False> => fin ++ verb.p2 ;
-- wil kunnen zien (first line in inf) -- wil kunnen zien (first line in inf)
<_,Anter,True> => fin ++ inf ; -- double inf --# notpresent _ => fin ++ inf -- double inf --# notpresent
_ => fin ++ inf
-- no inf ++ fin, this is not German :-P
} }
in in
case o of { case o of {
@@ -631,20 +628,27 @@ param
VZijn => zijn_V VZijn => zijn_V
} ; } ;
infVP : Bool -> VP -> ((Agr => Str) * Str * Str) = \isAux, vp -> infVP : Bool -> VP -> {obj : (Agr => Str) ; inf : Str ; ext : Str} = \isAux,vp ->
< let vverb = vp.s in {
\\agr => vp.n0 ! agr ++ vp.n2 ! agr ++ vp.a2, obj = \\agr => vp.n0 ! agr ++ vp.n2 ! agr ++ vp.a2 ;
let vverb = vp.s inf = vp.a1 ! Pos ++ -- altijd
in vverb.particle ++ -- leuk
vp.a1 ! Pos ++ if_then_Str isAux
vverb.particle ++ (vverb.s ! VInfFull) -- toevoegen
if_then_Str isAux (vverb.s ! VInfFull) (vverb.prefix ++ "te" ++ vverb.s ! VInf), (vverb.prefix ++ "te" ++ vverb.s ! VInf) ; -- te vinden
vp.inf.p1 ++ vp.ext ext = vp.inf.p1 ++ vp.ext } ;
> ;
insertInfVP : Bool -> VP -> (VP -> VP) = \isAux,vp ->
let
vpi = infVP isAux vp
in
\vps -> insertExtrapos vpi.ext
(insertInf vpi.inf
(insertObj vpi.obj vps)) ;
useInfVP : Bool -> VP -> Agr => Str = \isAux,vp -> useInfVP : Bool -> VP -> Agr => Str = \isAux,vp ->
let vpi = infVP isAux vp in let vpi = infVP isAux vp in
\\agr => vpi.p1 ! agr ++ vpi.p2 ++ vpi.p3 ; \\agr => vpi.obj ! agr ++ vpi.inf ++ vpi.ext ;
reflPron : Agr => Str = table { reflPron : Agr => Str = table {
{n = Sg ; p = P1} => "mijzelf" ; {n = Sg ; p = P1} => "mijzelf" ;

View File

@@ -10,15 +10,8 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
vpv = predVGen v.isAux vp.negPos (v2v v) ; vpv = predVGen v.isAux vp.negPos (v2v v) ;
vpi = infVP v.isAux vp ; vpi = infVP v.isAux vp ;
in in
vpv ** {n2 = vpi.p1 ; inf = <vpi.p2, True> ; ext = vpi.p3} ; ---- vpv ** {n2 = vpi.obj ; inf = <vpi.inf, True> ; ext = vpi.ext} ; ---- Why replace and not use insertInfVP? TODO find out
{-
in
insertInf vpi.p3 (
insertInf vpi.p2 (
insertObj vpi.p1 (
predVGen v.isAux vp.negPos (v2v v)))) ; ---- subtyp
-}
ComplVS v s = ComplVS v s =
insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ; insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ;
ComplVQ v q = ComplVQ v q =
@@ -32,43 +25,40 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
insertObj (\\_ => appPrep v.c2.p1 np) (predVv v) ** {c2 = v.c3} ; insertObj (\\_ => appPrep v.c2.p1 np) (predVv v) ** {c2 = v.c3} ;
Slash3V3 v np = Slash3V3 v np =
insertObj (\\_ => appPrep v.c3.p1 np) (predVv v) ** {c2 = v.c2} ; insertObj (\\_ => appPrep v.c3.p1 np) (predVv v) ** {c2 = v.c2} ;
SlashV2S v s = SlashV2S v s =
insertExtrapos (conjThat ++ s.s ! Sub) (predVv v) ** {c2 = v.c2} ; insertExtrapos (conjThat ++ s.s ! Sub) (predVv v) ** {c2 = v.c2} ;
SlashV2Q v q = SlashV2Q v q =
insertExtrapos (q.s ! QIndir) (predVv v) ** {c2 = v.c2} ; insertExtrapos (q.s ! QIndir) (predVv v) ** {c2 = v.c2} ;
SlashV2V v vp = SlashV2V v vp =
let insertInfVP v.isAux vp (predVGen v.isAux vp.negPos v) ** {c2 = v.c2} ;
vpi = infVP v.isAux vp
in
insertExtrapos vpi.p3 (
insertInf vpi.p2 (
insertObj vpi.p1 ((predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ;
SlashV2A v ap = SlashV2A v ap =
insertObj (\\agr => ap.s ! agr ! APred) insertObj (\\agr => ap.s ! agr ! APred)
(predVGen False BetweenObjs (v2v v)) ** {c2 = v.c2} ; (predVGen False BetweenObjs (v2v v)) ** {c2 = v.c2} ;
--vp.c2.p2: if the verb has a preposition or not ComplSlash vp np =
ComplSlash vp np = insertObjNP np.isPron (case vp.c2.p2 of {True => BeforeObjs; False => vp.negPos}) (\\_ => appPrep vp.c2.p1 np) vp ; let obj : Agr => Str = \\_ => appPrep vp.c2.p1 np ;
SlashVV v vp = -- If there is an infinitive, put the old object before it.
let -- If not, just keep the old vp.
vpi = infVP v.isAux vp vp': VP = case vp.inf.p2 of {
in True => let emptyObjVP : VP = vp ** {n0, n2 = \\_ => [] } ;
insertExtrapos vpi.p3 ( infCompl = vp.n0 ! np.a ++ vp.n2 ! np.a ;
insertInf vpi.p2 ( in insertInf infCompl emptyObjVP ;
insertObj vpi.p1 ( False => vp } ;
predVGen v.isAux vp.negPos (v2v v)))) ** {c2 = vp.c2} ;
SlashV2VNP v np vp = negPos = case vp.c2.p2 of { -- if the verb has a preposition or not
let True => BeforeObjs ;
vpi = infVP v.isAux vp False => vp.negPos } ;
in in insertObjNP np.isPron negPos obj vp' ;
insertExtrapos vpi.p3 (
insertInf vpi.p2 ( SlashVV v vp =
insertObj vpi.p1 ( insertInfVP v.isAux vp (predVGen v.isAux vp.negPos v) ** {c2 = vp.c2} ;
insertObj (\\_ => appPrep v.c2.p1 np) (
predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ; SlashV2VNP v np vp =
insertInfVP v.isAux vp (
insertObj (\\_ => appPrep v.c2.p1 np)
(predVGen v.isAux vp.negPos v))
** {c2 = v.c2} ;
UseComp comp = insertObj comp.s (compV zijn_V) ; UseComp comp = insertObj comp.s (compV zijn_V) ;