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:
+33
-32
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user