mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-30 10:28:53 -06:00
(Dut) fix bug in infVP; add comments & clean up
This commit is contained in:
@@ -504,17 +504,19 @@ param
|
|||||||
|
|
||||||
oper VP : Type = {
|
oper VP : Type = {
|
||||||
s : VVerb ;
|
s : VVerb ;
|
||||||
a1 : Polarity => Str ; -- niet
|
a1 : Polarity => Str ; -- niet: negation or AdV
|
||||||
n0 : Agr => Str ; -- je
|
n0 : Agr => Str ; -- je: pronoun complement (agr for reflexive)
|
||||||
n2 : Agr => Str ; -- je vrouw
|
n2 : Agr => Str ; -- je vrouw: non-pronoun complement (agr for CompCN)
|
||||||
a2 : Str ; -- vandaag
|
a2 : Str ; -- vandaag: adverb
|
||||||
isAux : Bool ; -- is a double infinitive
|
isAux : Bool ; -- is a double infinitive
|
||||||
negPos : NegPosition ; -- ik schoop X niet ; ik houd niet van X ; dat is niet leuk
|
negPos : NegPosition ; -- ik schoop X niet ; ik houd niet van X ; dat is niet leuk
|
||||||
inf : Str * Bool ; -- zeggen (True = non-empty)
|
inf : Str * Bool ; -- zeggen (True = non-empty)
|
||||||
ext : Str -- dat je komt
|
ext : Str -- dat je komt
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
predV : VVerb -> VP = predVGen False AfterObjs;
|
predV : VVerb -> VP = predVGen False AfterObjs ;
|
||||||
|
|
||||||
|
compV : VVerb -> VP = predVGen False BeforeObjs ;
|
||||||
|
|
||||||
predVGen : Bool -> NegPosition -> VVerb -> VP = \isAux, negPos, verb -> {
|
predVGen : Bool -> NegPosition -> VVerb -> VP = \isAux, negPos, verb -> {
|
||||||
s = verb ;
|
s = verb ;
|
||||||
@@ -542,64 +544,26 @@ param
|
|||||||
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> insertObjNP False vp.negPos obj vp;
|
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> insertObjNP False vp.negPos obj vp;
|
||||||
|
|
||||||
--this is needed when we call insertObjNP in ComplSlash: VPSlash is a subtype of VP so it works
|
--this is needed when we call insertObjNP in ComplSlash: VPSlash is a subtype of VP so it works
|
||||||
insertObjNP : Bool -> NegPosition -> (Agr => Str) -> VP -> VP = \isPron,negPos,obj,vp -> {
|
insertObjNP : Bool -> NegPosition -> (Agr => Str) -> VP -> VP = \isPron,negPos,obj,vp -> vp ** {
|
||||||
s = vp.s ;
|
|
||||||
a1 = vp.a1 ;
|
|
||||||
n0 = \\a => case isPron of {True => obj ! a ; _ => []} ++ vp.n0 ! a ;
|
n0 = \\a => case isPron of {True => obj ! a ; _ => []} ++ vp.n0 ! a ;
|
||||||
n2 = \\a => case isPron of {False => obj ! a ; _ => []} ++ vp.n2 ! a ;
|
n2 = \\a => case isPron of {False => obj ! a ; _ => []} ++ vp.n2 ! a ;
|
||||||
a2 = vp.a2 ;
|
|
||||||
isAux = vp.isAux ;
|
|
||||||
negPos = negPos ;
|
negPos = negPos ;
|
||||||
inf = vp.inf ;
|
|
||||||
ext = vp.ext
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdV : Str -> VP -> VP = \adv,vp -> {
|
insertAdV : Str -> VP -> VP = \adv,vp -> vp ** {
|
||||||
s = vp.s ;
|
|
||||||
a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht
|
a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht
|
||||||
n0 = vp.n0 ;
|
|
||||||
n2 = vp.n2 ;
|
|
||||||
a2 = vp.a2 ;
|
|
||||||
isAux = vp.isAux ;
|
|
||||||
negPos = vp.negPos ;
|
|
||||||
inf = vp.inf ;
|
|
||||||
ext = vp.ext
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdv : Str -> VP -> VP = \adv,vp -> {
|
insertAdv : Str -> VP -> VP = \adv,vp -> vp ** {
|
||||||
s = vp.s ;
|
|
||||||
a1 = vp.a1 ;
|
|
||||||
n0 = vp.n0 ;
|
|
||||||
n2 = vp.n2 ;
|
|
||||||
a2 = vp.a2 ++ adv ;
|
a2 = vp.a2 ++ adv ;
|
||||||
isAux = vp.isAux ;
|
|
||||||
negPos = vp.negPos ;
|
|
||||||
inf = vp.inf ;
|
|
||||||
ext = vp.ext
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertExtrapos : Str -> VP -> VP = \ext,vp -> {
|
insertExtrapos : Str -> VP -> VP = \ext,vp -> vp ** {
|
||||||
s = vp.s ;
|
|
||||||
a1 = vp.a1 ;
|
|
||||||
n0 = vp.n0 ;
|
|
||||||
n2 = vp.n2 ;
|
|
||||||
a2 = vp.a2 ;
|
|
||||||
isAux = vp.isAux ;
|
|
||||||
negPos = vp.negPos ;
|
|
||||||
inf = vp.inf ;
|
|
||||||
ext = vp.ext ++ ext
|
ext = vp.ext ++ ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertInf : Str -> VP -> VP = \inf,vp -> {
|
insertInf : Str -> VP -> VP = \inf,vp -> vp ** {
|
||||||
s = vp.s ;
|
|
||||||
a1 = vp.a1 ;
|
|
||||||
n0 = vp.n0 ;
|
|
||||||
n2 = vp.n2 ;
|
|
||||||
a2 = vp.a2 ;
|
|
||||||
isAux = vp.isAux ; ----
|
|
||||||
negPos = vp.negPos ;
|
|
||||||
inf = <inf ++ vp.inf.p1, True> ;
|
inf = <inf ++ vp.inf.p1, True> ;
|
||||||
ext = vp.ext
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- For $Sentence$.
|
-- For $Sentence$.
|
||||||
@@ -673,6 +637,7 @@ param
|
|||||||
let vverb = vp.s
|
let vverb = vp.s
|
||||||
in
|
in
|
||||||
vp.a1 ! Pos ++
|
vp.a1 ! Pos ++
|
||||||
|
vverb.particle ++
|
||||||
if_then_Str isAux (vverb.s ! VInfFull) (vverb.prefix ++ "te" ++ vverb.s ! VInf),
|
if_then_Str isAux (vverb.s ! VInfFull) (vverb.prefix ++ "te" ++ vverb.s ! VInf),
|
||||||
vp.inf.p1 ++ vp.ext
|
vp.inf.p1 ++ vp.ext
|
||||||
> ;
|
> ;
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
|
|
||||||
--vp.c2.p2: if the verb has a preposition or not
|
--vp.c2.p2: if the verb has a preposition or not
|
||||||
ComplSlash vp np = insertObjNP np.isPron (case vp.c2.p2 of {True => BeforeObjs; False => vp.negPos}) (\\_ => appPrep vp.c2.p1 np) vp ;
|
ComplSlash vp np = insertObjNP np.isPron (case vp.c2.p2 of {True => BeforeObjs; False => vp.negPos}) (\\_ => appPrep vp.c2.p1 np) vp ;
|
||||||
|
|
||||||
SlashVV v vp =
|
SlashVV v vp =
|
||||||
let
|
let
|
||||||
vpi = infVP v.isAux vp
|
vpi = infVP v.isAux vp
|
||||||
@@ -69,9 +70,7 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
insertObj (\\_ => appPrep v.c2.p1 np) (
|
insertObj (\\_ => appPrep v.c2.p1 np) (
|
||||||
predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ;
|
predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
-- BeforeObjs, because negation comes before copula complement
|
UseComp comp = insertObj comp.s (compV zijn_V) ;
|
||||||
-- "ik ben niet groot" but "ik begrijp hem niet"
|
|
||||||
UseComp comp = insertObjNP False BeforeObjs comp.s (predV zijn_V) ; -- agr not used
|
|
||||||
|
|
||||||
UseCopula = predV zijn_V;
|
UseCopula = predV zijn_V;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user