1
0
forked from GitHub/gf-rgl

=corrected the error and added two more Functions in Verb.Cgg. The cause of error was repeated record lable in the same record in ResCgg.gf for VerbPhrase

This commit is contained in:
David Bamutura
2019-05-17 00:19:09 +02:00
parent cdc9fe3072
commit cc165875f5
3 changed files with 49 additions and 45 deletions

View File

@@ -5,16 +5,10 @@ concrete CatCgg of Cat = CommonX -[Adv,IAdv]**
lincat
--Pol = {s : Str ; isTrue: Bool}; -- TRUE= Positive, FALSE=Negative, s filed is left empty for parsing
{-
Temp is a parameter for temporal features such as Simul and Anteriority:
TRUE = Simultainity
FALSE = Anteriority
-}
--Temp = {s : Str ; isPres : Bool} ;
--cat
Imp = {s : Bool => Str} ;
Imp = {s : Bool => Str} ;
QS = {s : Str} ;
-- Note: SS is a shorthand for {s:Str}, defined in Prelude.gf
-- You must change some of the lincats (e.g., for NP, Det and Pron) so that everything works
@@ -25,8 +19,9 @@ lincat
V,VS, VQ, VA = Res.Verb ; --change to {verb : Str ; comp = []} -- one-place verb e.g. "sleep"
V2,V2Q, V2S = Res.Verb2;
V2A,V3 = Res.Verb3; -- three-place verb e.g. "show"
VP = Res.VerbPhrase ; -- verb phrase e.g. "is very warm"
N = Res.Noun ; -- common noun e.g. "house"
CN = Res.Noun ; -- common noun (without determiner) e.g. "red house"
NP = Res.NounPhrase; -- noun phrase (subject or object) e.g. "the red house"
@@ -83,7 +78,7 @@ linref
VP =\vp -> vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2;
VPSlash =\vpslash -> vpslash.s ++ BIND ++ vpslash.pres;
{-
--1 Cat: the Category System
-- The category system is central to the library in the sense
@@ -103,7 +98,7 @@ linref
-- Moreover, the list categories $ListAdv, ListAP, ListNP, ListS$
-- are defined on $Conjunction$ and only used locally there.
{-
abstract Cat = Common ** {
cat

View File

@@ -1123,7 +1123,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
adv:Str;
containsAdv: Bool;
adV:Str;
containsAdv:Bool
containsAdV:Bool
};
-- in VP formation, all verbs are lifted to GVerb, but morphology doesn't need to know this
verb2gverb : Verb ->Str -> GVerb = \v, ba -> {
@@ -1384,4 +1384,11 @@ oper
(AgMUBAP2 n) => MU_BA;
NONE => Null
};
getNumber : Agreement -> Number =\agr ->
case agr of {
(AgP3 n g) => n;
(AgMUBAP1 n) => n;
(AgMUBAP2 n) => n;
NONE => Sg --default -- a hack
};
}

View File

@@ -18,7 +18,7 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
}; --: V -> VP; -- sleep --ignoring object agreement
-- UseComp : Comp -> VP ; -- be warm means complement of a copula especially adjectival Phrase
@@ -37,7 +37,7 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
}; --its not generating any sentence
-- CompAP : AP -> Comp; -- (be) small
@@ -48,9 +48,11 @@ lin
-- CompAdv : Adv -> Comp ; -- (be) here
CompAdv adv =adv;
{-
This has been a hack to simply pick the sigular and complete noun.
-}
--CompCN : CN -> Comp ; -- (be) a man/men
CompCN cn = ; -- (be) a man/men
CompCN cn = {s =cn.s ! Sg ! Complete} ; -- (be) a man/men
-- SlashV2a : V2 -> VPSlash ; -- love (it)
SlashV2a v2 ={
s =v2.s;
@@ -64,7 +66,7 @@ lin
adv=[];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
};
--Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her)
Slash2V3 v3 np ={
@@ -79,7 +81,7 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
};
--Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her
@@ -95,7 +97,7 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
};
--SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy
SlashVV vv vpslash ={
@@ -110,7 +112,7 @@ lin
adv = [];
containsAdv = False;
adV =[];
containsAdV = False;
containsAdV = False
};
--SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go
@@ -132,7 +134,7 @@ lin
adv = [];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
};
-- AdvVP : VP -> Adv -> VP ; -- sleep here
-- VerbPhrase: Type = {s:Str; morphs: VMorphs ; comp:Str ; isCompApStem : Bool; agr : AgrExist};
@@ -151,25 +153,25 @@ lin
adv = [];
containsAdv =True;
adV =[];
containsAdV = False;
containsAdV = False
};
-- AdVVP : AdV -> VP -> VP ; -- always sleep
AdVVP adv vp = {
AdVVP adV vp = {
s=vp.s;
pres =vp.pres;
perf = vp.perf;
morphs = vp.morphs;
comp = [];
comp2 =[];
comp = vp.comp;
comp2 =vp.comp;
ap = [];
isCompApStem = False;
agr = AgrNo;
isRegular = vp.isRegular;
adv = adv.s;
containsAdv =True;
adV =[];
containsAdV = False;
adv = [];
containsAdv =False;
adV =adV.s;
containsAdV = True
};
--AdvVPSlash : VPSlash -> Adv -> VPSlash ; -- use (it) here
@@ -183,14 +185,14 @@ lin
pres =vpslash.pres;
perf = vpslash.perf;
morphs = vpslash.morphs;
comp = [];
comp2 = np.s ! Acc;
comp = vpslash.comp;
comp2 = vpslash.comp2;
ap = [];
isRegular = v3.isRegular;
isRegular = vpslash.isRegular;
adv = adv.s;
containsAdv =True;
adV =[];
containsAdV = False;
containsAdV = False
};
-- Adverb directly attached to verb
--AdVVPSlash : AdV -> VPSlash -> VPSlash ; -- always use (it)
@@ -203,14 +205,14 @@ lin
pres =vpslash.pres;
perf = vpslash.perf;
morphs = vpslash.morphs;
comp = adV.s;
comp2 = np.s ! Acc;
comp = vpslash.comp;
comp2 = vpslash.comp2;
ap = [];
isRegular = v3.isRegular;
isRegular = vpslash.isRegular;
adv = [];
containsAdv =False;
adV =[];
containsAdV = False;
adV =adV.s;
containsAdV = True
};
-- Verb phrases are constructed from verbs by providing their
-- complements. There is one rule for each verb category.
@@ -234,7 +236,7 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
};
_ => {
s= vv.s ++ BIND ++ vv.pres ++ vpPres;
@@ -250,7 +252,7 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
}
};
@@ -269,7 +271,7 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
};
{-
@@ -290,7 +292,7 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
};
{-
@@ -316,7 +318,7 @@ lin
adv =[];
containsAdv =False;
adV =[];
containsAdV = False;
containsAdV = False
};
-- Copula alone
@@ -330,7 +332,7 @@ lin
adv = [];
containsAdv = False;
adV =[];
containsAdV = False;
containsAdV = False
};
{-
--1 The construction of verb phrases