1
0
forked from GitHub/gf-rgl

Prepared the NounPhrase and its children for the ListNP with a field describing whether the first work in NPP is a Proper Noun or a common Noun. Are NPs always common Nouns? RR treats these things differently. Phonological conditioning is also required. This is my next step

This commit is contained in:
David Bamutura
2019-05-30 17:56:04 +02:00
parent 0ee7f24982
commit 22c6d5aae4
7 changed files with 76 additions and 53 deletions

View File

@@ -1,7 +1,7 @@
--# -path=.:../prelude:../abstract:../common
concrete AdjectiveCgg of Adjective = CatCgg **
open (Res = ResCgg), Prelude, ParamX in {
open ResCgg, Prelude, ParamX in {
lin
@@ -19,11 +19,11 @@ lin
--AdAP : AdA -> AP -> AP ; -- very warm
AdAP ada ap = case ada.position1 of {
Post => {s = \\agr => ap.s ! agr ++ ada.s; position1= ap.position1; isProper = ap.isProper; isPrep = ap.isPrep};
Pre => {s = \\agr => ada.s ++ ap.s!agr ; position1= ap.position1; isProper = ap.isProper; isPrep = ap.isPrep}
Pre => {s = \\agr => ada.s ++ ap.s!agr ; position1= ap.position1; isProper = ap.isProper; isPrep = ap.isPrep};
Post => {s = \\agr => ap.s ! agr ++ ada.s; position1= ap.position1; isProper = ap.isProper; isPrep = ap.isPrep}
};
{-
{-
abstract Adjective = Cat ** {
fun
@@ -62,4 +62,4 @@ abstract Adjective = Cat ** {
-}
}
}

View File

@@ -2,14 +2,20 @@
concrete ConjunctionCgg of Conjunction = CatCgg **
open ResCgg, Coordination, Prelude in {
{-
lincat
[NP] = {s1,s2 :Case => Str ; agr : Agreement};
[CN] = {s1,s2 : Number => NounState => Str; gender:Gender};
[AP] = {s1,s2 : Agreement=> Str ; position1 : Position1; isProper : Bool; isPrep: Bool};
[RS] = {s1,s2 : RForm => Str};
--[IAdv] = {s1,s2 : Str} ;
{-
[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};

View File

@@ -6,18 +6,18 @@ concrete NounCgg of Noun = CatCgg **
lin
--UsePN : PN -> NP ; -- John
UsePN pn = {s = \\ _ => pn.s; agr = pn.a}; -- John
UsePN pn = {s = \\ _ => pn.s; agr = pn.a; nounCat = PropNoun}; -- John
{- need use of a pre -}
UsePron pron =
let default3PAgr = (AgP3 Sg KI_BI)
in case <pron.agr> of {
<(AgrYes a)> => {s = pron.s; agr = a}; --: Pron -> NP ; -- he
<_> => {s = pron.third !default3PAgr; agr = default3PAgr}
<(AgrYes a)> => {s = pron.s; agr = a; nounCat = ComNoun}; --: Pron -> NP ; -- he
<_> => {s = pron.third !default3PAgr; agr = default3PAgr; nounCat = ComNoun}
};
--UsePron pron = pron; -- the result of use pron is a NounPhrase
--MassNP : CN -> NP ; -- (beer)
MassNP cn = {s = \\_ =>cn.s ! Sg ! Complete; agr = AgP3 Sg cn.gender}; --: CN -> NP ; -- milk
MassNP cn = {s = \\_ =>cn.s ! Sg ! Complete; agr = AgP3 Sg cn.gender; nounCat = ComNoun}; --: CN -> NP ; -- milk
--DetCN det cn = mkDeterminer det cn; --Should be nemed mkDetCN
DetCN det cn = mkDetCN det cn; -- the man
{-
@@ -30,38 +30,39 @@ lin
--Noun = {s : NounType=>Number => Str ; nc : NClass} ;
--AdjCN ap cn = {s=\\ntype, num=>cn.s!ntype!num ++ ap.s!AgP3 num cn.nc; nc=cn.nc};
--AdjCN : AP -> CN -> CN ; -- big house
AdjCN ap cn =
case <ap.position1, ap.isProper, > of {
<Pre, True> => {
s = \\ num, ns =>ap.s ! AgP3 Sg KI_BI ++ cn.s ! num ! ns ;
gender = cn.gender
gender = cn.gender; nounCat = cn.nounCat
};
<Post, False> => case ap.isPrep of {
False => {
s = \\ num, ns => cn.s ! num ! ns ++ mkAdjPronIVClitic (AgP3 num cn.gender)
++ ap.s ! AgP3 Sg KI_BI;
gender = cn.gender
gender = cn.gender; nounCat = cn.nounCat
};
True => {
s = \\ num, ns => (cn.s ! num ! ns) ++
mkGenPrepNoIVClitic (AgP3 num cn.gender) ++ ap.s ! AgP3 Sg KI_BI;
gender = cn.gender
gender = cn.gender; nounCat = cn.nounCat
}
};
<Pre, False> => {
s = \\ num, ns => mkAdjPronIVClitic (AgP3 num cn.gender)
++ ap.s ! AgP3 Sg KI_BI ++ (cn.s ! num ! ns) ;
gender = cn.gender
gender = cn.gender; nounCat = cn.nounCat
};
<Post, True> => {
s = \\ num, ns => (cn.s ! num ! ns) ++ ap.s ! AgP3 Sg KI_BI;
gender = cn.gender
gender = cn.gender; nounCat = cn.nounCat
}
}; -- big house
--RelCN : CN -> RS -> CN ; -- house that John bought
RelCN cn rs = {s=\\n,ns => cn.s !n ! ns ++ rs.s! (RF RObj); gender = cn.gender };
RelCN cn rs = {s=\\n,ns => cn.s !n ! ns ++ rs.s! (RF RObj); gender = cn.gender; nounCat = cn.nounCat};
{-
A predeterminer is any word that modifies a noun Phrase.
@@ -73,23 +74,23 @@ lin
accS = np.s ! Acc;
in
case <predet.isMWE, predet.isInflected> of {
<False, True> => {s = \\_ =>nomS ++ mkPredetPref a ++ predet.s ; agr = a};
<False, True> => {s = \\_ =>nomS ++ mkPredetPref a ++ predet.s ; agr = a; nounCat = np.nounCat};
<True, True > => {s = \\_ =>nomS ++ mkPredetPref a ++ predet.s ++
mkPredetPref a ++ predet.s2; agr = a};
<False,False> => {s = \\_ =>nomS ++ predet.s ; agr = a};
<True,False> => {s = \\_ =>nomS ++ predet.s ++ predet.s2; agr = a} -- never seen this case
mkPredetPref a ++ predet.s2; agr = a; nounCat = np.nounCat};
<False,False> => {s = \\_ =>nomS ++ predet.s ; agr = a; nounCat = np.nounCat};
<True,False> => {s = \\_ =>nomS ++ predet.s ++ predet.s2; agr = a; nounCat = np.nounCat} -- never seen this case
};
--AdvNP : NP -> Adv -> NP ; -- Paris today
AdvNP np adv = {s= \\c => np.s ! c ++ adv.s; agr = np.agr };
AdvNP np adv = {s= \\c => np.s ! c ++ adv.s; agr = np.agr; nounCat = np.nounCat };
--PPartNP : NP -> V2 -> NP ; -- the man seen use the Passive form of the verb see. abantu abarebirwe
PPartNP np v2 =
{s= \\c => np.s!c ++ mkSubjClitic np.agr ++ v2.s ++ BIND ++ v2.morphs!VFPastPart!RestOfVerb; agr = np.agr};
{s= \\c => np.s!c ++ mkSubjClitic np.agr ++ v2.s ++ BIND ++ v2.morphs!VFPastPart!RestOfVerb; agr = np.agr; nounCat = np.nounCat};
{-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; nounCat = np.nounCat}; -- how do I do the adverbial clause?
-- 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! (RF RSubj); agr =np.agr};
RelNP np rs ={s = \\c => np.s ! c ++ rs.s! (RF RSubj); agr =np.agr; nounCat = np.nounCat};
-- The determiner has a fine-grained structure, in which a 'nucleus'
-- quantifier and an optional numeral can be discerned.
--DetQuant : Quant -> Num -> Det ; -- these five
@@ -132,7 +133,7 @@ lin
--OrdNumeralSuperl : Numeral -> A -> Ord ; -- third largest
OrdNumeralSuperl numeral a = {s= \\c => numeral.s !NOrd !c ++ "omu" ++ "kukirayo" ++ "obu" ++ BIND ++ a.s; position1 = a.position1};
-- AdvCN : CN -> Adv -> CN ; -- house on the hill
AdvCN cn adv ={s=\\ntype,num =>cn.s!ntype!num ++ adv.s; gender=cn.gender};
AdvCN cn adv ={s=\\ntype,num =>cn.s!ntype!num ++ adv.s; gender=cn.gender; nounCat = cn.nounCat};
-- Pronouns have possessive forms. Genitives of other kinds
-- of noun phrases are not given here, since they are not possible
-- in e.g. Romance languages. They can be found in $Extra$ modules.
@@ -162,57 +163,57 @@ lin
ComplN2 n2 np =
{ s = \\n, ns => n2.s ! n ! ns ++ n2.c2 ! mkAgreement n2.gender P1 n ++ np.s !Acc;
gender=n2.gender};
gender=n2.gender; nounCat = n2.nounCat};
--ComplN3 : N3 -> NP -> N2 ; -- distance from this city (to Paris)
ComplN3 n3 np =
{s = \\n, ns => n3.s ! n ! ns ++ n3.c2 ! mkAgreement n3.gender P1 n ++ np.s !Acc;
c2 = n3.c3;
gender=n3.gender};
gender=n3.gender; nounCat = n3.nounCat}; -- we choose n3 because it is important when using the na conjunction
--2 Apposition
-- This is certainly overgenerating.
--ApposCN : CN -> NP -> CN ; -- city Paris (, numbers x and y)
ApposCN cn np ={s = \\n, ns => cn.s! n!ns ++ np.s !Nom; gender = cn.gender};
ApposCN cn np ={s = \\n, ns => cn.s! n!ns ++ np.s !Nom; gender = cn.gender; nounCat = cn.nounCat};
-- This is different from the partitive, as shown by many languages.
--CountNP : Det -> NP -> NP ; -- three of them, some of the boys
CountNP det np = case det.doesAgree of {
True => {s=\\c=> np.s!c ++ "emye ahari" ++ det.s2 ! np.agr; agr = np.agr};
False => {s=\\c=> np.s!c ++ det.s; agr = np.agr}
True => {s=\\c=> np.s!c ++ "emye ahari" ++ det.s2 ! np.agr; agr = np.agr; nounCat = np.nounCat};
False => {s=\\c=> np.s!c ++ det.s; agr = np.agr; nounCat = np.nounCat}
};
--Determiners can form noun phrases directly.
--DetNP : Det -> NP ; -- these five
DetNP det = case det.doesAgree of {
True => {s=\\_=> det.s2 ! AgP3 Sg KI_BI; agr = AgP3 Sg KI_BI};
False => {s=\\c=> det.s; agr = AgP3 Sg KI_BI}
True => {s=\\_=> det.s2 ! AgP3 Sg KI_BI; agr = AgP3 Sg KI_BI; nounCat = ComNoun};
False => {s=\\c=> det.s; agr = AgP3 Sg KI_BI; nounCat = ComNoun}
};
-- Nouns can also be modified by embedded sentences and questions.
-- For some nouns this makes little sense, but we leave this for applications
-- to decide. Sentential complements are defined in [Verb Verb.html].
--SentCN : CN -> SC -> CN
SentCN cn sc = {s = \\ n, ns => cn.s!n!ns ++ sc.s; gender = cn.gender};
SentCN cn sc = {s = \\ n, ns => cn.s!n!ns ++ sc.s; gender = cn.gender; nounCat = cn.nounCat};
-- Relational nouns can also be used without their arguments.
-- The semantics is typically derivative of the relational meaning.
--UseN2 : N2 -> CN ; -- mother
UseN2 n2 = {s = n2.s; gender = n2.gender};
UseN2 n2 = {s = n2.s; gender = n2.gender; nounCat = n2.nounCat};
--Use2N3 : N3 -> N2 ; -- distance (from this city)
Use2N3 n3 = {s = n3.s; gender = n3.gender; c2 = n3.c2};
Use2N3 n3 = {s = n3.s; gender = n3.gender; nounCat = n3.nounCat; c2 = n3.c2};
--Use3N3 : N3 -> N2 ; -- distance (to Paris)
Use3N3 n3 = {s = n3.s; gender = n3.gender; c2 = n3.c3};
Use3N3 n3 = {s = n3.s; gender = n3.gender; nounCat = n3.nounCat; c2 = n3.c3};
-- (New 13/3/2013 AR; Structural.possess_Prep and part_Prep should be deprecated in favour of these.)
--PossNP : CN -> NP -> CN ; -- house of Paris, house of mine
PossNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIVClitic np.agr ++ np.s ! Nom; gender = cn.gender};
PossNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIVClitic np.agr ++ np.s ! Nom; gender = cn.gender; nounCat = cn.nounCat};
--PartNP : CN -> NP -> CN ; -- glass of wine
PartNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIVClitic np.agr ++ np.s ! Nom; gender = cn.gender};
PartNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIVClitic np.agr ++ np.s ! Nom; gender = cn.gender; nounCat = cn.nounCat};
{-
--1 Noun: Nouns, noun phrases, and determiners

View File

@@ -6,9 +6,9 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
-- with an interrogative.
lin
--QuestCl : Cl -> QCl ; -- does John walk
QuestCl cl = cl ** {posibleSubAgr = mkSubjCliticTable;};
--QuestVP : IP -> VP -> QCl ; -- who walks
--QuestCl : Cl -> QCl ; -- does John walk
QuestCl cl = cl ** {posibleSubAgr = mkSubjCliticTable};
--QuestVP : IP -> VP -> QCl ; -- who walks
QuestVP ip vp = {
s = ip.s;

View File

@@ -62,7 +62,7 @@ lin
let comp = case clSlash.complType of{
Ap => clSlash.ap;
Adverbial => clSlash.adv;
AdverbVerbial => clSlash.adV;
AdverbialVerb => clSlash.adV;
_ => []
};
isCompApStem = case clSlash.complType of{

View File

@@ -75,7 +75,7 @@ VVMood = VVImp | VVPerf | VVBoth;
oper
-- the is for Common Nouns only
Noun : Type = {s : Number=> NounState=> Str ; gender : Gender} ;
Noun : Type = {s : Number=> NounState=> Str ; gender : Gender; nounCat:NounCat} ;
ivs : pattern Str = #("a" | "e" | "o"); --pattern for initial vowels
@@ -88,7 +88,8 @@ oper
Sg => table {Complete => sg; Incomplete => Predef.drop 1 sg};
Pl => table {Complete => pl; Incomplete => Predef.drop 1 pl}
};
gender = g
gender = g;
nounCat = ComNoun;
};
@@ -213,12 +214,13 @@ oper
that label because is helps us disambiguate which
preposition to use for in, on and at i.e LOCATIVES omuri, ahari, etc
-}
ProperNoun : Type = {s: Str ; a:Agreement ; isPlace : Bool};
ProperNoun : Type = {s: Str ; a:Agreement ; isPlace : Bool; nounCat:NounCat};
mkPN : Str -> Agreement -> Bool -> ProperNoun = \ pn, a, b->
{
s = pn ;
a = a;
isPlace = b;
nounCat = PropNoun;
} ;
-- concatenates the string left to right
@@ -1076,9 +1078,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
let subjClitic = mkSubjClitic (AgP3 det.num cn.gender)
in
case <det.pos, det.num> of {
<PostDeterminer, Pl> => {s = \\_=> subjClitic ++ cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender};
<PostDeterminer, Sg> => {s = \\_=>cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender};
<PreDeterminer, n> => { s =\\_ => det.s ++ cn.s !n ! det.ntype; agr = AgP3 det.num cn.gender} --;
<PostDeterminer, Pl> => {s = \\_=> subjClitic ++ cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat};
<PostDeterminer, Sg> => {s = \\_=>cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat};
<PreDeterminer, n> => { s =\\_ => det.s ++ cn.s !n ! det.ntype; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat} --;
--<PostDeterminer, PFalse> => {s = \\_=> cn.s!det.ntype!det.num; agr = AgP3 det.num cn.gender }
};

View File

@@ -61,7 +61,7 @@ lin
and_Conj = {
s = table {
AConj Other => "kandi";
_ => "na"
_ => "na" -- used to link nouns, pronouns, relative subject clauses, relative object clauses and adjectival nouns or infinitives (okuzana na okwikruka
};
s2 =[];
@@ -224,6 +224,20 @@ lin
but_PConj = ss "báìtu"; --: PConj ; -- variants béìtu
otherwise_PConj = ss "okûndi"; --: PConj ;
therefore_PConj = ss "n'ahabwe'êkyo"; --: PConj ;
{-
and_Conj : Conj ;
both7and_DConj : Conj ; -- both...and
both7and_DConj : DConj ;
but_PConj : PConj ;
either7or_DConj : Conj ; -- either...or
either7or_DConj : DConj ;
or_Conj : Conj ;
otherwise_PConj : PConj ;
therefore_PConj : PConj ;
if_then_Conj : Conj ;
-}
{-
--1 Structural: Structural Words
--