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 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} ; QS = {s : Str} ;
-- Note: SS is a shorthand for {s:Str}, defined in Prelude.gf -- 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 -- You must change some of the lincats (e.g., for NP, Det and Pron) so that everything works
@@ -25,6 +19,7 @@ lincat
V,VS, VQ, VA = Res.Verb ; --change to {verb : Str ; comp = []} -- one-place verb e.g. "sleep" V,VS, VQ, VA = Res.Verb ; --change to {verb : Str ; comp = []} -- one-place verb e.g. "sleep"
V2,V2Q, V2S = Res.Verb2; V2,V2Q, V2S = Res.Verb2;
V2A,V3 = Res.Verb3; -- three-place verb e.g. "show" V2A,V3 = Res.Verb3; -- three-place verb e.g. "show"
VP = Res.VerbPhrase ; -- verb phrase e.g. "is very warm" VP = Res.VerbPhrase ; -- verb phrase e.g. "is very warm"
N = Res.Noun ; -- common noun e.g. "house" N = Res.Noun ; -- common noun e.g. "house"
@@ -83,7 +78,7 @@ linref
VP =\vp -> vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2; VP =\vp -> vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2;
VPSlash =\vpslash -> vpslash.s ++ BIND ++ vpslash.pres; VPSlash =\vpslash -> vpslash.s ++ BIND ++ vpslash.pres;
{-
--1 Cat: the Category System --1 Cat: the Category System
-- The category system is central to the library in the sense -- The category system is central to the library in the sense
@@ -103,7 +98,7 @@ linref
-- Moreover, the list categories $ListAdv, ListAP, ListNP, ListS$ -- Moreover, the list categories $ListAdv, ListAP, ListNP, ListS$
-- are defined on $Conjunction$ and only used locally there. -- are defined on $Conjunction$ and only used locally there.
{-
abstract Cat = Common ** { abstract Cat = Common ** {
cat cat

View File

@@ -1123,7 +1123,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
adv:Str; adv:Str;
containsAdv: Bool; containsAdv: Bool;
adV:Str; adV:Str;
containsAdv:Bool containsAdV:Bool
}; };
-- in VP formation, all verbs are lifted to GVerb, but morphology doesn't need to know this -- in VP formation, all verbs are lifted to GVerb, but morphology doesn't need to know this
verb2gverb : Verb ->Str -> GVerb = \v, ba -> { verb2gverb : Verb ->Str -> GVerb = \v, ba -> {
@@ -1384,4 +1384,11 @@ oper
(AgMUBAP2 n) => MU_BA; (AgMUBAP2 n) => MU_BA;
NONE => Null 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 =[]; adv =[];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; --: V -> VP; -- sleep --ignoring object agreement }; --: V -> VP; -- sleep --ignoring object agreement
-- UseComp : Comp -> VP ; -- be warm means complement of a copula especially adjectival Phrase -- UseComp : Comp -> VP ; -- be warm means complement of a copula especially adjectival Phrase
@@ -37,7 +37,7 @@ lin
adv = []; adv = [];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; --its not generating any sentence }; --its not generating any sentence
-- CompAP : AP -> Comp; -- (be) small -- CompAP : AP -> Comp; -- (be) small
@@ -48,9 +48,11 @@ lin
-- CompAdv : Adv -> Comp ; -- (be) here -- CompAdv : Adv -> Comp ; -- (be) here
CompAdv adv =adv; 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 -> 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 -> VPSlash ; -- love (it)
SlashV2a v2 ={ SlashV2a v2 ={
s =v2.s; s =v2.s;
@@ -64,7 +66,7 @@ lin
adv=[]; adv=[];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
--Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her) --Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her)
Slash2V3 v3 np ={ Slash2V3 v3 np ={
@@ -79,7 +81,7 @@ lin
adv = []; adv = [];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
--Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her --Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her
@@ -95,7 +97,7 @@ lin
adv = []; adv = [];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
--SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy --SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy
SlashVV vv vpslash ={ SlashVV vv vpslash ={
@@ -110,7 +112,7 @@ lin
adv = []; adv = [];
containsAdv = False; containsAdv = False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
--SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go --SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go
@@ -132,7 +134,7 @@ lin
adv = []; adv = [];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
-- AdvVP : VP -> Adv -> VP ; -- sleep here -- AdvVP : VP -> Adv -> VP ; -- sleep here
-- VerbPhrase: Type = {s:Str; morphs: VMorphs ; comp:Str ; isCompApStem : Bool; agr : AgrExist}; -- VerbPhrase: Type = {s:Str; morphs: VMorphs ; comp:Str ; isCompApStem : Bool; agr : AgrExist};
@@ -151,25 +153,25 @@ lin
adv = []; adv = [];
containsAdv =True; containsAdv =True;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
-- AdVVP : AdV -> VP -> VP ; -- always sleep -- AdVVP : AdV -> VP -> VP ; -- always sleep
AdVVP adv vp = { AdVVP adV vp = {
s=vp.s; s=vp.s;
pres =vp.pres; pres =vp.pres;
perf = vp.perf; perf = vp.perf;
morphs = vp.morphs; morphs = vp.morphs;
comp = []; comp = vp.comp;
comp2 =[]; comp2 =vp.comp;
ap = []; ap = [];
isCompApStem = False; isCompApStem = False;
agr = AgrNo; agr = AgrNo;
isRegular = vp.isRegular; isRegular = vp.isRegular;
adv = adv.s; adv = [];
containsAdv =True; containsAdv =False;
adV =[]; adV =adV.s;
containsAdV = False; containsAdV = True
}; };
--AdvVPSlash : VPSlash -> Adv -> VPSlash ; -- use (it) here --AdvVPSlash : VPSlash -> Adv -> VPSlash ; -- use (it) here
@@ -183,14 +185,14 @@ lin
pres =vpslash.pres; pres =vpslash.pres;
perf = vpslash.perf; perf = vpslash.perf;
morphs = vpslash.morphs; morphs = vpslash.morphs;
comp = []; comp = vpslash.comp;
comp2 = np.s ! Acc; comp2 = vpslash.comp2;
ap = []; ap = [];
isRegular = v3.isRegular; isRegular = vpslash.isRegular;
adv = adv.s; adv = adv.s;
containsAdv =True; containsAdv =True;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
-- Adverb directly attached to verb -- Adverb directly attached to verb
--AdVVPSlash : AdV -> VPSlash -> VPSlash ; -- always use (it) --AdVVPSlash : AdV -> VPSlash -> VPSlash ; -- always use (it)
@@ -203,14 +205,14 @@ lin
pres =vpslash.pres; pres =vpslash.pres;
perf = vpslash.perf; perf = vpslash.perf;
morphs = vpslash.morphs; morphs = vpslash.morphs;
comp = adV.s; comp = vpslash.comp;
comp2 = np.s ! Acc; comp2 = vpslash.comp2;
ap = []; ap = [];
isRegular = v3.isRegular; isRegular = vpslash.isRegular;
adv = []; adv = [];
containsAdv =False; containsAdv =False;
adV =[]; adV =adV.s;
containsAdV = False; containsAdV = True
}; };
-- Verb phrases are constructed from verbs by providing their -- Verb phrases are constructed from verbs by providing their
-- complements. There is one rule for each verb category. -- complements. There is one rule for each verb category.
@@ -234,7 +236,7 @@ lin
adv =[]; adv =[];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
_ => { _ => {
s= vv.s ++ BIND ++ vv.pres ++ vpPres; s= vv.s ++ BIND ++ vv.pres ++ vpPres;
@@ -250,7 +252,7 @@ lin
adv =[]; adv =[];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
} }
}; };
@@ -269,7 +271,7 @@ lin
adv =[]; adv =[];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
{- {-
@@ -290,7 +292,7 @@ lin
adv =[]; adv =[];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
{- {-
@@ -316,7 +318,7 @@ lin
adv =[]; adv =[];
containsAdv =False; containsAdv =False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
-- Copula alone -- Copula alone
@@ -330,7 +332,7 @@ lin
adv = []; adv = [];
containsAdv = False; containsAdv = False;
adV =[]; adV =[];
containsAdV = False; containsAdV = False
}; };
{- {-
--1 The construction of verb phrases --1 The construction of verb phrases