=made changes to Verb Phrase and VPSlash that check if the complements actually exists

This commit is contained in:
David Bamutura
2020-10-26 16:00:34 +03:00
parent b776f47c6b
commit aad7b002aa
4 changed files with 164 additions and 41 deletions

View File

@@ -108,7 +108,7 @@ oper
mkV2S : V -> Prep -> V2S ; -- e.g. tell (NP) (that S)
mkV2S v p = lin V2S (prepV2 v p) ;
--mkPrep : Str -> Str ->Bool -> Preposition ; -- e.g. "in front of"
mkPrep : Str -> Str ->Bool -> Preposition;
mkPrep : Str -> Str ->Bool -> Prep;
mkPrep first other bool = lin Prep {
s = first ;
other = other;
@@ -213,11 +213,11 @@ mkInterj : Str -> Interj
A2V : Type = A2 ;
mkV0 : V -> V;
mkV0 v = v ;
mkA2 : Str -> Position -> Bool -> Bool ->Bool-> A2 = \a2, pos, isProper, isPrep,isNeg ->
lin A2 ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True});
mkA2 : Str -> Position -> Bool -> Bool ->Bool-> A2V = \a2, pos, isProper, isPrep,isNeg ->
lin A2V ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True});
--mkA2V : A -> A2V;
--mkA2V a = lin A2V (a * {c2 = ""; isPre = True});
mkA2V : Str -> Position -> Bool -> Bool ->Bool-> A2V =\a2, pos, isProper, isPrep,isNeg -> lin A2V ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True});
mkA2V : Str -> Position -> Bool -> Bool ->Bool-> A2 =\a2, pos, isProper, isPrep,isNeg -> lin A2 ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True});
-- Adverbs modifying numerals

View File

@@ -1379,7 +1379,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
adv:Str;
containsAdv: Bool;
adV:Str;
containsAdV:Bool
containsAdV:Bool;
containsComp : Bool;
containsComp2 : Bool
};
-- in VP formation, all verbs are lifted to GVerb, but morphology doesn't need to know this
verb2gverb : Verb ->Str -> GVerb = \v, ba -> {
@@ -1587,7 +1589,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
adv:Str;
containsAdv:Bool;
adV:Str;
containsAdV:Bool
containsAdV:Bool;
containsComp : Bool;
containsComp2 : Bool
}; --comp is empty

View File

@@ -281,8 +281,8 @@ lin
PredVP np vp = case <vp.isCompApStem, vp.containsAdV> of {
<False,True> => {
PredVP np vp = case <vp.isCompApStem, vp.containsAdV,vp.containsComp, vp.containsComp2> of {
<False,True,False,False> => {
s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk
subjAgr = np.agr;
pres = vp.pres;
@@ -302,7 +302,7 @@ lin
compl = vp.adV
};
<_, _> => {
<_, _,True,False> => {
s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk
subjAgr = np.agr;
pres = vp.pres;
@@ -320,6 +320,44 @@ lin
-}
--root = vp.root ;
compl = mkSubjClitic np.agr ++ vp.comp --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp
};
<_, _,True, True> => {
s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk
subjAgr = np.agr;
pres = vp.pres;
perf = vp.perf;
root = vp.s;
--morphs = vp.morphs;
isPresBlank = vp.isPresBlank;
isPerfBlank = vp.isPerfBlank;
{-
inf = mkVerbInrf vp.root;
pres = mkVerbPres vp.root;
past = mkVerbPast vp.root;
presPart = mkVerbPresPart vp.root;
pastPart = mkVerbPastPart vp.root; -- subject
-}
--root = vp.root ;
compl = mkSubjClitic np.agr ++ vp.comp ++ vp.comp2--mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp
};
<_, _,_, _> => {
s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk
subjAgr = np.agr;
pres = vp.pres;
perf = vp.perf;
root = vp.s;
--morphs = vp.morphs;
isPresBlank = vp.isPresBlank;
isPerfBlank = vp.isPerfBlank;
{-
inf = mkVerbInrf vp.root;
pres = mkVerbPres vp.root;
past = mkVerbPast vp.root;
presPart = mkVerbPresPart vp.root;
pastPart = mkVerbPastPart vp.root; -- subject
-}
--root = vp.root ;
compl = [] --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp
}
};--: NP -> VP -> Cl ; -- John walks / John does not walk

View File

@@ -20,7 +20,9 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = False;
containsComp2 = False
}; --: V -> VP; -- sleep --ignoring object agreement
-- UseComp : Comp -> VP ; -- be warm means complement of a copula especially adjectival Phrase
@@ -45,7 +47,9 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = False
};
_ => {
s = mkBecome.s ++ BIND ++mkBecome.pres++ comp.s; --Assuming there is no AP which is prepositional
@@ -63,7 +67,9 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = False
}
}; --its not generating any sentence
@@ -97,7 +103,9 @@ lin
adv=[];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = False;
containsComp2 =False
};
--Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her)
Slash2V3 v3 np ={
@@ -114,7 +122,9 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 =False
};
--Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her
@@ -132,7 +142,9 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = True
};
--SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy
SlashVV vv vpslash ={
@@ -152,7 +164,9 @@ lin
adv = [];
containsAdv = False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = False;
containsComp2 = False
};
--SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go
@@ -176,7 +190,9 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = vpslash.containsComp2
};
-- AdvVP : VP -> Adv -> VP ; -- sleep here
-- VerbPhrase: Type = {s:Str; morphs: VMorphs ; comp:Str ; isCompApStem : Bool; agr : AgrExist};
@@ -189,7 +205,7 @@ lin
isPresBlank = vp.isPresBlank;
isPerfBlank = vp.isPerfBlank;
comp = adv.s;
comp2 = [];
comp2 = vp.comp2;
ap =[];
isCompApStem = False;
agr = AgrNo;
@@ -197,7 +213,9 @@ lin
adv = adv.s;
containsAdv =True;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = vp.containsComp2
};
-- AdVVP : AdV -> VP -> VP ; -- always sleep
@@ -217,7 +235,9 @@ lin
adv = [];
containsAdv =False;
adV =adV.s;
containsAdV = True
containsAdV = True;
containsComp = vp.containsComp;
containsComp2 = vp.containsComp2
};
--AdvVPSlash : VPSlash -> Adv -> VPSlash ; -- use (it) here
@@ -240,7 +260,9 @@ lin
adv = adv.s;
containsAdv =True;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = vpslash.containsComp;
containsComp2 = vpslash.containsComp2
};
-- Adverb directly attached to verb
--AdVVPSlash : AdV -> VPSlash -> VPSlash ; -- always use (it)
@@ -262,7 +284,9 @@ lin
adv = [];
containsAdv =False;
adV =adV.s;
containsAdV = True
containsAdV = True;
containsComp = vpslash.containsComp;
containsComp2 = vpslash.containsComp2
};
-- Verb phrases are constructed from verbs by providing their
-- complements. There is one rule for each verb category.
@@ -272,9 +296,14 @@ lin
--This function requires the remodelling of VP to accomodate two Verbs.
--
-}
ComplVV vv vp = let vpPres = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres;
in case vv.whenUsed of {
VVPerf => {
ComplVV vv vp = let
-- restofVerbPres = case vp.isPresBlank of {
-- True => "a";
-- False => vp.pres;
-- };
vpPres = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres;
in case <vv.whenUsed, vp.containsComp,vp.containsComp2> of {
<VVPerf,True,True> => {
s= vv.s ++ BIND ++ vv.perf ++ vpPres;
pres = [];--vv.pres;
perf= []; -- vv.perf;
@@ -289,9 +318,11 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = True
};
_ => {
<_,True,True> => {
s= vv.s ++ BIND ++ vv.pres ++ vpPres;
pres = [];--vv.pres;
perf= [];--vv.perf;
@@ -307,7 +338,49 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = True
};
<_,True,_> => {
s= vv.s ++ BIND ++ vv.pres ++ vpPres;
pres = [];--vv.pres;
perf= [];--vv.perf;
--morphs = vv.morphs;
isPresBlank = True;
isPerfBlank = True;
comp=vp.comp ;
comp2 = [];
ap = [];
isCompApStem = False;
agr = AgrNo;
isRegular = vv.isRegular;
adv =[];
containsAdv =False;
adV =[];
containsAdV = False;
containsComp = True;
containsComp2 = False
};
<_,_,_> => {
s= vv.s ++ BIND ++ vv.pres ++ vpPres;
pres = [];--vv.pres;
perf= [];--vv.perf;
--morphs = vv.morphs;
isPresBlank = True;
isPerfBlank = True;
comp=[] ;
comp2 = [];
ap = [];
isCompApStem = False;
agr = AgrNo;
isRegular = vv.isRegular;
adv =[];
containsAdv =False;
adV =[];
containsAdV = False;
containsComp = False;
containsComp2 = False
}
};
@@ -328,7 +401,9 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = False
};
{-
@@ -351,7 +426,9 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = True;
containsComp2 = False
};
{-
@@ -379,7 +456,9 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = False;
containsComp2 = False
};
-- Copula alone
@@ -393,7 +472,9 @@ lin
adv = [];
containsAdv = False;
adV =[];
containsAdV = False
containsAdV = False;
containsComp = False;
containsComp2 = False
};
{-
--1 The construction of verb phrases