forked from GitHub/gf-rgl
modified Noun to accommodate for IDetCN in Question
This commit is contained in:
@@ -67,7 +67,9 @@ lincat
|
||||
Ord = {s :Res.Agreement=>Str; position1:Res.Position1} ;
|
||||
Card = {s :Res.Agreement=>Str; n : Res.Number} ;
|
||||
IP = {s :Str ; n : Res.Number; isVerbSuffix: Bool; requiresIPPrefix: Bool; aux:Str};
|
||||
IAdv = {s :Str ; requiresSubjPrefix: Bool};
|
||||
IAdv = {s : Str ; requiresSubjPrefix: Bool};
|
||||
IDet = {s : Str ; requiresSubjPrefix: Bool};
|
||||
IQuant = {s : Res.Number =>Str ; requiresSubjPrefix: Bool};
|
||||
--VV =
|
||||
|
||||
linref
|
||||
|
||||
@@ -16,7 +16,7 @@ lin
|
||||
};
|
||||
--UsePron pron = pron; -- the result of use pron is a NounPhrase
|
||||
--MassNP : CN -> NP ; -- (beer)
|
||||
MassNP cn = {s = \\_ =>cn.s ! Complete ! Pl; agr = AgP3 Pl cn.gender}; --: CN -> NP ; -- milk
|
||||
MassNP cn = {s = \\_ =>cn.s ! Pl ! Complete; agr = AgP3 Pl cn.gender}; --: CN -> NP ; -- milk
|
||||
--DetCN det cn = mkDeterminer det cn; --Should be nemed mkDetCN
|
||||
DetCN det cn = mkDetCN det cn; -- the man
|
||||
{-
|
||||
@@ -32,28 +32,28 @@ lin
|
||||
AdjCN ap cn =
|
||||
case <ap.position1, ap.isProper, > of {
|
||||
<Pre, True> => {
|
||||
s = \\ ns, num =>ap.s ++ cn.s ! ns ! num ;
|
||||
s = \\ num, ns =>ap.s ++ cn.s ! num ! ns ;
|
||||
gender = cn.gender
|
||||
};
|
||||
<Post, False> => case ap.isPrep of {
|
||||
False => {
|
||||
s = \\ ns, num => cn.s ! ns ! num ++ mkAdjPronIVClitic (AgP3 num cn.gender)
|
||||
s = \\ num, ns => cn.s ! num ! ns ++ mkAdjPronIVClitic (AgP3 num cn.gender)
|
||||
++ ap.s;
|
||||
gender = cn.gender
|
||||
};
|
||||
True => {
|
||||
s = \\ ns, num => (cn.s ! ns ! num) ++
|
||||
s = \\ num, ns => (cn.s ! num ! ns) ++
|
||||
mkGenPrepNoIVClitic (AgP3 num cn.gender) ++ ap.s ;
|
||||
gender = cn.gender
|
||||
}
|
||||
};
|
||||
<Pre, False> => {
|
||||
s = \\ ns, num => mkAdjPronIVClitic (AgP3 num cn.gender)
|
||||
++ ap.s ++ (cn.s ! ns ! num) ;
|
||||
s = \\ num, ns => mkAdjPronIVClitic (AgP3 num cn.gender)
|
||||
++ ap.s ++ (cn.s ! num ! ns) ;
|
||||
gender = cn.gender
|
||||
};
|
||||
<Post, True> => {
|
||||
s = \\ ns, num => (cn.s ! ns ! num) ++ ap.s ;
|
||||
s = \\ num, ns => (cn.s ! num ! ns) ++ ap.s ;
|
||||
gender = cn.gender
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,13 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
|
||||
--QuestSlash : IP -> ClSlash -> QCl ; -- whom does John love
|
||||
--QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk
|
||||
--QuestIComp : IComp -> NP -> QCl ; -- where is John
|
||||
|
||||
--IdetCN : IDet -> CN -> IP ; -- which five songs
|
||||
IdentCN idet cn = case idet.requiresSubjPrefix of {
|
||||
True => {s = \\n => cn!n!Complete ++ mkSubjPrefix mkAgreement(cn.gender P3 n) ++ idet.s};
|
||||
False => { s = \\n => cn!n!Complete ++ idet.s}
|
||||
};
|
||||
--IdetIP : IDet -> IP ; -- which five
|
||||
{-
|
||||
--1 Question: Questions and Interrogative Pronouns
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ param
|
||||
-}
|
||||
ConjArg = Nn_Nn | Nps_Nps | Pns_Pns | RelSubjCls | Other;
|
||||
AgrConj = AConj ConjArg;
|
||||
Agreement = AgP3 Number Gender | AgMUBAP1 Number |AgMUBAP2 Number; --Default is AgP3 Sg KI_BI
|
||||
Agreement = AgP3 Number Gender | AgMUBAP1 Number |AgMUBAP2 Number | NONE; --Default is AgP3 Sg KI_BI
|
||||
AgrExist = AgrNo | AgrYes Agreement;
|
||||
Position = PostDeterminer | PreDeterminer ;
|
||||
Position1 = Post | Pre;
|
||||
@@ -70,27 +70,25 @@ NounState = Complete | Incomplete ;
|
||||
|
||||
oper
|
||||
-- the is for Common Nouns only
|
||||
Noun : Type = {s : NounState => Number => Str ; gender : Gender} ;
|
||||
Noun : Type = {s : Number=> NounState=> Str ; gender : Gender} ;
|
||||
|
||||
ivs : pattern Str = #("a" | "e" | "o"); --pattern for initial vowels
|
||||
|
||||
human_relations: pattern Str = --expand this list
|
||||
#("Taata" | "Maama" | "Shwento" | "Shwenkuru" | "Nyinento" | "Nyinenkuru");
|
||||
|
||||
|
||||
mkNoun : Str -> Str ->Gender ->Noun = \sg,pl, g -> {
|
||||
s = table {
|
||||
Complete => table { Sg => sg ; Pl => pl};
|
||||
Incomplete => table {
|
||||
Sg => case sg of {
|
||||
(#ivs + _) => Predef.drop 1 sg;
|
||||
_ => sg };
|
||||
Pl => case pl of {
|
||||
(#ivs + _) => Predef.drop 1 pl;
|
||||
_ => pl }
|
||||
}
|
||||
};
|
||||
gender = g
|
||||
} ;
|
||||
s = table {
|
||||
Sg => table {Complete => sg; Incomplete => Predef.drop 1 sg};
|
||||
Pl => table {Complete => pl; Incomplete => Predef.drop 1 pl}
|
||||
};
|
||||
gender = g
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
mkVerb : Str ->Str ->Str ->Verb = \rad, end1,end2 ->{
|
||||
s = rad;
|
||||
@@ -231,6 +229,49 @@ oper
|
||||
Pl => mkClitic pl
|
||||
} ;
|
||||
|
||||
mkAgreement: Gender -> Person -> Number ->Agreement =\g,p,n ->
|
||||
case <g,p,n> of{
|
||||
<MU_BA, P1, n> => AgMUBAP1 n;
|
||||
<MU_BA, P2, n> => AgMUBAP2 n;
|
||||
<g,P3,n> => AgP3 n g;
|
||||
<_,_,_,> => NONE
|
||||
|
||||
};
|
||||
mkSubjPrefix : Agreement -> Str =\a ->case a of {
|
||||
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
|
||||
};
|
||||
mkSubjClitic : Agreement -> Str = \a ->
|
||||
case a of {
|
||||
AgMUBAP1 n => mkClitics "n" "tu" n;
|
||||
@@ -920,8 +961,8 @@ oper
|
||||
<PostDeterminer> => {s = \\_=>
|
||||
let
|
||||
subjClitic = mkSubjClitic (AgP3 det.num cn.gender)
|
||||
in cn.s!det.ntype!det.num ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender};
|
||||
<PreDeterminer> => { s =\\_ => det.s ++ cn.s ! det.ntype ! det.num; agr = AgP3 det.num cn.gender} --;
|
||||
in cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender};
|
||||
<PreDeterminer> => { s =\\_ => det.s ++ cn.s !det.num ! det.ntype; agr = AgP3 det.num cn.gender} --;
|
||||
--<PostDeterminer, PFalse> => {s = \\_=> cn.s!det.ntype!det.num; agr = AgP3 det.num cn.gender }
|
||||
};
|
||||
|
||||
|
||||
@@ -165,6 +165,14 @@ lin
|
||||
--You may need to use booleans to indicate that you need these tables rather than carrying them.
|
||||
how_IAdv = {s ="ta"; requiresSubjPrefix = True}; --: IAdv ;
|
||||
--how8much_IAdv = {s ="kwiga"; s2requireSubjPrefix = True};--: IAdv ;
|
||||
|
||||
when_IAdv = {s ="ryari"; requiresSubjPrefix = False}; --: IAdv ;
|
||||
where_IAdv = {s ="nkahe"; requiresSubjPrefix = False}; --: IAdv ;
|
||||
why_IAdv = {s ="ahabweki"; requiresSubjPrefix = False};--: IAdv ;
|
||||
|
||||
how8many_IDet ={s ="ngahe"; requiresSubjPrefix = False};--: IDet ;
|
||||
|
||||
which_IQuant ={s =\\_ =>"ha"; requiresSubjPrefix = False};--: IQuant ;
|
||||
{-
|
||||
--1 Structural: Structural Words
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user