mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
Some corrections made and functions added
This commit is contained in:
@@ -19,8 +19,9 @@ lincat
|
|||||||
-- 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
|
||||||
|
|
||||||
S = SS ; -- declarative sentence e.g. "she lived here"
|
S = SS ; -- declarative sentence e.g. "she lived here"
|
||||||
Cl, QCl = Res.Clause ; -- declarative clause, with all tenses e.g. "she looks at this"
|
Cl = Res.Clause ; -- declarative clause, with all tenses e.g. "she looks at this"
|
||||||
|
QCl = Res.Clause ** {posibleSubAgr: Res.Agreement =>Str} ;
|
||||||
|
RS = {s : Str} ; -- relative e.g. "in which she lived"
|
||||||
V = Res.Verb ; --change to {verb : Str ; comp = []} -- one-place verb e.g. "sleep"
|
V = 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"
|
||||||
@@ -70,10 +71,13 @@ lincat
|
|||||||
IAdv = {s : Str ; requiresSubjPrefix: Bool};
|
IAdv = {s : Str ; requiresSubjPrefix: Bool};
|
||||||
IDet = {s : Str ; n : Res.Number; requiresSubjPrefix: Bool};
|
IDet = {s : Str ; n : Res.Number; requiresSubjPrefix: Bool};
|
||||||
IQuant = {s : Res.Number =>Str ; requiresSubjPrefix: Bool};
|
IQuant = {s : Res.Number =>Str ; requiresSubjPrefix: Bool};
|
||||||
|
DAP = Res.Determiner ;;
|
||||||
|
|
||||||
--VV =
|
--VV =
|
||||||
|
|
||||||
linref
|
linref
|
||||||
Cl, QCl =\cl -> cl.s ++ Res.mkSubjClitic cl.subjAgr ++ cl.root ++ BIND ++ cl.pres;
|
Cl =\cl -> cl.s ++ Res.mkSubjClitic cl.subjAgr ++ cl.root ++ BIND ++ cl.pres;
|
||||||
|
QCl =\qcl -> qcl.s ++ qcl.posibleSubAgr ! (Res.mkAgreement Res.MU_BA Res.P3 Res.Sg) ++ qcl.root ++ BIND ++ qcl.pres;
|
||||||
VP =\vp -> vp.s ++ BIND ++ vp.pres;
|
VP =\vp -> vp.s ++ BIND ++ vp.pres;
|
||||||
{-
|
{-
|
||||||
--1 Cat: the Category System
|
--1 Cat: the Category System
|
||||||
|
|||||||
@@ -2,8 +2,18 @@
|
|||||||
|
|
||||||
concrete ConjunctionCgg of Conjunction = CatCgg **
|
concrete ConjunctionCgg of Conjunction = CatCgg **
|
||||||
open ResCgg, Coordination, Prelude in {
|
open ResCgg, Coordination, Prelude in {
|
||||||
|
{-
|
||||||
|
lincat
|
||||||
|
[S] = {s1,s2 : Str} ;
|
||||||
|
[Adv] = {s1,s2 : Str} ;
|
||||||
|
[AdV] = {s1,s2 : Str} ;
|
||||||
|
[IAdv] = {s1,s2 : Str} ;
|
||||||
|
[NP] = {s1,s2 : NPCase => Str ; a : Agr} ;
|
||||||
|
[AP] = {s1,s2 : Agr => Str ; isPre : Bool};
|
||||||
|
[RS] = {s1,s2 : Agr => Str ; c : NPCase};
|
||||||
|
[CN] = {s1,s2 : Number => Case => Str};
|
||||||
|
[DAP] = {s1,s2 : Str ; n : Number};
|
||||||
|
-}
|
||||||
{-
|
{-
|
||||||
--1 Conjunction: Coordination
|
--1 Conjunction: Coordination
|
||||||
|
|
||||||
|
|||||||
@@ -84,16 +84,16 @@ lin
|
|||||||
green_A =mkAdjective "kijubwe" Post False True;
|
green_A =mkAdjective "kijubwe" Post False True;
|
||||||
|
|
||||||
--ditransitive verbs
|
--ditransitive verbs
|
||||||
--bite_V2 = mkV2 "rum";
|
bite_V2 = mkV2 "rum";
|
||||||
break_V2 = mkV2 "hend"; --: V2 ;
|
break_V2 = mkV2 "hend"; --: V2 ;
|
||||||
buy_V2 = mkV2 "gur" ; --: V2 ;
|
buy_V2 = mkV2 "gur" ; --: V2 ;
|
||||||
--close_V2 = mkV2 "king";
|
close_V2 = mkV2 "king";
|
||||||
--count_V2 = mkV2 "bar";
|
count_V2 = mkV2 "ba" "ra" "zire";
|
||||||
--cut_V2 = mkV2 "shar";
|
cut_V2 = mkV2 "sha" "ra" "zire";
|
||||||
--do_V2 = mkV2 "kor";
|
do_V2 = mkV2 "ko" "ra" "zire";
|
||||||
drink_V2 = mkV2 "nyw";
|
drink_V2 = mkV2 "nyw";
|
||||||
eat_V2 = mkV2 "ry";
|
eat_V2 = mkV2 "ry";
|
||||||
--fear_V2 = mkV2 "tiin";
|
fear_V2 = mkV2 "tiin";
|
||||||
find_V2 = mkV2 "bon" ; --: V2 ; -- many words; kureeba, kubóna,kushanga, kumamya,kujumbura
|
find_V2 = mkV2 "bon" ; --: V2 ; -- many words; kureeba, kubóna,kushanga, kumamya,kujumbura
|
||||||
kill_V2 = mkV2 "it"; --: V2 ;
|
kill_V2 = mkV2 "it"; --: V2 ;
|
||||||
love_V2 = mkV2 "kûnd"; --: V2 ;
|
love_V2 = mkV2 "kûnd"; --: V2 ;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ lin
|
|||||||
{-What the hell does this mean?-}
|
{-What the hell does this mean?-}
|
||||||
ExtAdvNP np adv = {s= \\c => np.s ! c ++ embedInCommas adv.s; agr = np.agr}; -- how do I do the adverbial clause?
|
ExtAdvNP np adv = {s= \\c => np.s ! c ++ embedInCommas adv.s; agr = np.agr}; -- how do I do the adverbial clause?
|
||||||
-- Determiner: Type = {s:Str; ntype:NounType; num:Number; pos:Position}; -- type for Determier necessary for catCgg.gf
|
-- Determiner: Type = {s:Str; ntype:NounType; num:Number; pos:Position}; -- type for Determier necessary for catCgg.gf
|
||||||
|
RelNP np rs ={s = \\c => np.s ! c ++ rs.s; agr =np.agr};
|
||||||
-- The determiner has a fine-grained structure, in which a 'nucleus'
|
-- The determiner has a fine-grained structure, in which a 'nucleus'
|
||||||
-- quantifier and an optional numeral can be discerned.
|
-- quantifier and an optional numeral can be discerned.
|
||||||
--DetQuant : Quant -> Num -> Det ; -- these five
|
--DetQuant : Quant -> Num -> Det ; -- these five
|
||||||
@@ -95,8 +95,8 @@ lin
|
|||||||
--DetQuantOrd : Quant -> Num -> Ord -> Det ; -- these five best
|
--DetQuantOrd : Quant -> Num -> Ord -> Det ; -- these five best
|
||||||
--DetQuantOrd quant num ord = {};
|
--DetQuantOrd quant num ord = {};
|
||||||
|
|
||||||
NumSg = {s=[]; n=Sg};
|
NumSg = {s=[]; n=Sg}; --Num
|
||||||
NumPl = {s=[]; n=Pl};
|
NumPl = {s=[]; n=Pl}; --Num
|
||||||
-- NumCard card = {...};
|
-- NumCard card = {...};
|
||||||
--Quant = {s : Res.Pronoun; s2 :Res.Agreement => Str; doesAgree : Bool; isPron: Bool} ;
|
--Quant = {s : Res.Pronoun; s2 :Res.Agreement => Str; doesAgree : Bool; isPron: Bool} ;
|
||||||
IndefArt = {s={s=\\_=>[]; third = \\_,_=>[];agr = AgrNo }; s2 = \\_=>[]; doesAgree = False; isPron=False};
|
IndefArt = {s={s=\\_=>[]; third = \\_,_=>[];agr = AgrNo }; s2 = \\_=>[]; doesAgree = False; isPron=False};
|
||||||
@@ -123,6 +123,22 @@ lin
|
|||||||
--PossPron : Pron -> Quant ; -- my (house)
|
--PossPron : Pron -> Quant ; -- my (house)
|
||||||
PossPron pron = {s =pron; s2 =\\_=> []; doesAgree = True; isPron = True};
|
PossPron pron = {s =pron; s2 =\\_=> []; doesAgree = True; isPron = True};
|
||||||
|
|
||||||
|
--3 Conjoinable determiners and ones with adjectives
|
||||||
|
|
||||||
|
--AdjDAP : DAP -> AP -> DAP ; -- the large (one)
|
||||||
|
{-
|
||||||
|
AdjDAP dap ap ={
|
||||||
|
s = dap.s ++ ap.s ;
|
||||||
|
s2: Res.Agreement;
|
||||||
|
ntype : NounState ;
|
||||||
|
num : Number ;
|
||||||
|
pos : Position;
|
||||||
|
doesAgree: Bool };
|
||||||
|
-}
|
||||||
|
--DetDAP : Det -> DAP ; -- this (or that)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{-
|
{-
|
||||||
--1 Noun: Nouns, noun phrases, and determiners
|
--1 Noun: Nouns, noun phrases, and determiners
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,28 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
--QuestCl : Cl -> QCl ; -- does John walk
|
--QuestCl : Cl -> QCl ; -- does John walk
|
||||||
QuestCl cl = cl;
|
QuestCl cl = cl ** {posibleSubAgr = mkSubjCliticTable;};
|
||||||
--QuestVP : IP -> VP -> QCl ; -- who walks
|
--QuestVP : IP -> VP -> QCl ; -- who walks
|
||||||
|
|
||||||
|
QuestVP ip vp = {
|
||||||
|
s = ip.s;
|
||||||
|
subjAgr = NONE; -- no option but to just pick one
|
||||||
|
posibleSubAgr = mkSubjCliticTable;
|
||||||
|
root = vp.s;
|
||||||
|
pres = vp.pres;
|
||||||
|
perf = vp.perf;
|
||||||
|
morphs = vp.morphs;
|
||||||
|
{-
|
||||||
|
inf : Str;
|
||||||
|
pres : Str;
|
||||||
|
past : Str;
|
||||||
|
presPart : Str;
|
||||||
|
pastPart : Str; -- subject
|
||||||
|
--root : Str ; -- dep. on Pol,Temp, e.g. "does","sleep"
|
||||||
|
-}
|
||||||
|
compl = vp.comp -- after verb: complement, adverbs
|
||||||
|
} ;
|
||||||
|
|
||||||
--QuestSlash : IP -> ClSlash -> QCl ; -- whom does John love
|
--QuestSlash : IP -> ClSlash -> QCl ; -- whom does John love
|
||||||
--QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk
|
--QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk
|
||||||
--QuestIComp : IComp -> NP -> QCl ; -- where is John
|
--QuestIComp : IComp -> NP -> QCl ; -- where is John
|
||||||
|
|||||||
@@ -309,6 +309,44 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
|
|||||||
_ => mkClitic "SubjNotKnown" --for checking if there is some class unaccounted for
|
_ => mkClitic "SubjNotKnown" --for checking if there is some class unaccounted for
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
mkSubjCliticTable : Agreement => Str = table {
|
||||||
|
AgMUBAP1 n => mkClitics "n" "tu" n;
|
||||||
|
--AgMUBAP1 Pl => "tu" ;
|
||||||
|
AgMUBAP2 n => mkClitics "o" "mu" n;
|
||||||
|
--AgMUBAP2 Pl => "mu" ;
|
||||||
|
AgP3 n MU_BA => mkClitics "a" "ba" n;
|
||||||
|
--AgP3 Pl MU_BA => "ba" ;
|
||||||
|
AgP3 Sg KI_BI => mkClitic "ki" ;
|
||||||
|
AgP3 Pl (KI_BI | ZERO_BI) => mkClitic "bi" ;
|
||||||
|
AgP3 Sg (RU_N | RU_MA | RU_ZERO | RU_BU) => mkClitic "ru" ;
|
||||||
|
AgP3 Pl RU_N => mkClitic "zi"; --| "i";
|
||||||
|
AgP3 Sg N_N => mkClitic "e";
|
||||||
|
AgP3 Pl N_N => mkClitic "zi"; --| "i";
|
||||||
|
AgP3 Sg (MU_MI | MU_ZERO) => mkClitic "gu" ;
|
||||||
|
AgP3 Pl MU_MI => "e" ;
|
||||||
|
AgP3 Sg (RI_MA | RI_ZERO | I_ZERO) =>mkClitic "ri";
|
||||||
|
AgP3 Pl (RI_MA | BU_MA | KU_MA | ZERO_MA | I_MA |RU_MA) => mkClitic "ga" ;
|
||||||
|
AgP3 Sg (KA_BU | KA_ZERO | KA_TU) => mkClitic "ka" ;
|
||||||
|
AgP3 Pl (KA_BU | RU_BU) => mkClitic "bu" ;
|
||||||
|
AgP3 Sg ZERO_BU => mkClitic "bu" ;
|
||||||
|
AgP3 Pl ZERO_BU => mkClitic "bu" ;
|
||||||
|
AgP3 Sg ZERO_BI => mkClitic "bi" ;
|
||||||
|
AgP3 Sg ZERO_MA => mkClitic "ga" ;
|
||||||
|
AgP3 Pl RI_ZERO => mkClitic "ga" ;
|
||||||
|
AgP3 Sg KU_ZERO => mkClitic "ku" ;
|
||||||
|
AgP3 Pl KU_ZERO => mkClitic "ku" ;
|
||||||
|
AgP3 Pl MU_ZERO => mkClitic "gu" ;
|
||||||
|
AgP3 Pl RU_ZERO => mkClitic "ru" ;
|
||||||
|
AgP3 Sg ZERO_TU => mkClitic "tu" ;
|
||||||
|
AgP3 Pl ZERO_TU => mkClitic "tu" ;
|
||||||
|
AgP3 Sg (ZERO_MI | ZERO_ZERO) => mkClitic "" ;
|
||||||
|
AgP3 Pl ZERO_MI => mkClitic "e" ;
|
||||||
|
AgP3 Pl KA_ZERO => mkClitic "" ;
|
||||||
|
_ => mkClitic "SubjNotKnown" --for checking if there is some class unaccounted for
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
{-Object particle may be used as
|
{-Object particle may be used as
|
||||||
1. a prefix: e.g mu-kwate = catch him,
|
1. a prefix: e.g mu-kwate = catch him,
|
||||||
2. an infix: o-mu-kwate = you catch him
|
2. an infix: o-mu-kwate = you catch him
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ lin
|
|||||||
UseCl temp pol cl = let
|
UseCl temp pol cl = let
|
||||||
subj = cl.s;
|
subj = cl.s;
|
||||||
clitic = mkSubjClitic cl.subjAgr;
|
clitic = mkSubjClitic cl.subjAgr;
|
||||||
simul = cl.morphs ! VFPres; --this is not delivering the string
|
simul = cl.pres; --morphs ! VFPres; --this is not delivering the string
|
||||||
ant = cl.morphs ! VFPastPart; --this is not delivering the string
|
ant = cl.morphs ! VFPastPart; --this is not delivering the string
|
||||||
root = cl.root;
|
root = cl.root;
|
||||||
presRestOfVerb = cl.morphs ! VFPres ! RestOfVerb;
|
presRestOfVerb = cl.morphs ! VFPres ! RestOfVerb;
|
||||||
pastRestOfVerb = cl.morphs ! VFPastPart ! RestOfVerb;
|
pastRestOfVerb = cl.perf; --morphs ! VFPastPart ! RestOfVerb;
|
||||||
|
|
||||||
compl = cl.compl
|
compl = cl.compl
|
||||||
in
|
in
|
||||||
@@ -34,7 +34,7 @@ lin
|
|||||||
}; --: Temp -> Pol -> QCl -> QS ; -- has John walked
|
}; --: Temp -> Pol -> QCl -> QS ; -- has John walked
|
||||||
|
|
||||||
UseQCl = UseCl; -- : Temp -> Pol -> Cl -> S ; -- John has not walked
|
UseQCl = UseCl; -- : Temp -> Pol -> Cl -> S ; -- John has not walked
|
||||||
QuestCl cl = cl; --: Cl -> QCl ; -- does John (not) walk
|
QuestCl qcl = qcl; --: Cl -> QCl ; -- does John (not) walk
|
||||||
|
|
||||||
PredVP np vp = case vp.isCompApStem of{
|
PredVP np vp = case vp.isCompApStem of{
|
||||||
False => {
|
False => {
|
||||||
@@ -93,6 +93,10 @@ lin
|
|||||||
}
|
}
|
||||||
}; --: VP -> Imp ; -- walk / do not walk
|
}; --: VP -> Imp ; -- walk / do not walk
|
||||||
|
|
||||||
|
-- A sentence can be modified by a relative clause referring to its contents.
|
||||||
|
|
||||||
|
RelS : S -> RS -> S ; -- she sleeps, which is good
|
||||||
|
|
||||||
--2 Clauses missing object noun phrases
|
--2 Clauses missing object noun phrases
|
||||||
|
|
||||||
-- This category is a variant of the 'slash category' $S/NP$ of
|
-- This category is a variant of the 'slash category' $S/NP$ of
|
||||||
|
|||||||
Reference in New Issue
Block a user