1
0
forked from GitHub/gf-rgl

Covered PredetNP & PrepNP in NounCgg.gf & AdverbCgg.gf alongside Predet & Adv Lexicon in StructuralCgg.gf. Errors in SentenceCgg.gf because the verb system is still a mess.

This commit is contained in:
David Bamutura
2019-05-03 03:57:11 +02:00
parent 373a261558
commit 66474465e3
11 changed files with 2001 additions and 1200 deletions

View File

@@ -4,16 +4,21 @@ concrete AdverbCgg of Adverb = CatCgg **
open ResCgg, Prelude in { open ResCgg, Prelude in {
lin lin
--PrepNP : Prep -> NP -> Adv --adverb of place pg 118 part (c) --PrepNP : Prep -> NP -> Adv -- Verb Phrase modifyingadverb such as everywhere
--adverb of place pg 118 part (c)
-- some prepositions can only operate with CN but not PN -- some prepositions can only operate with CN but not PN
-- how can we distinguish NPs i.e if they are CN or PN? -- how can we distinguish NPs i.e if they are CN or PN?
-- because aha is used for CN while aha-ri is used for PN Omubazi -- because aha is used for CN while aha-ri is used for PN Omubazi
-- nigukora ahari John -- nigukora ahari John
-- The nounPhrase must carry information about its derivation -- The nounPhrase must carry information about its derivation
PrepNP prep np = {s = \\ agr => prep.s ++ np . s}; -- aha meza
{-Assumed that a PrepNP is always Acc-}
PrepNP prep np = {s = prep.s ++ np.s ! Acc; agr = AgrNo}; -- aha meza
--PositAdvAdj : A -> Adv ; -- warmly --PositAdvAdj : A -> Adv ; -- warmly
PositAdvAdj a = a; --"Impossible to implement because each is lexically different word."
--PositAdvAdj a = a;
{- {-
abstract Adverb = Cat ** { abstract Adverb = Cat ** {

View File

@@ -4,7 +4,18 @@ concrete CatCgg of Cat = CommonX -[Adv]**
open (Res=ResCgg), Prelude in { open (Res=ResCgg), Prelude in {
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} ;
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
@@ -21,12 +32,16 @@ lincat
Det = Res.Determiner ; -- determiner phrase e.g. "those seven" Det = Res.Determiner ; -- determiner phrase e.g. "those seven"
Quant = SS ; -- quantifier ('nucleus' of Det) e.g. "this/these" Quant = SS ; -- quantifier ('nucleus' of Det) e.g. "this/these"
Num = Res.Numer ; -- number determining element e.g. "seven" Num = Res.Numer ; -- number determining element e.g. "seven"
AP = Res.AdjectivalPhrase; AP = {s : Str ; post : Str; isPre : Bool; isProper : Bool; isPrep: Bool} ;--Res.AdjectivalPhrase;
A = Res.Adjective; A = Res.Adjective;
Comp = Res.AdjectivalPhrase; -- complement of copula, such as AP e.g. "very warm" Comp = Res.Comp; -- complement of copula, such as AP e.g. "very warm"
V2 = Res.Verb2; V2 = Res.Verb2;
Adv = Res.Adv; Adv = Res.Adverb;
VPSlash = Res.VPSlash; VPSlash = Res.VPSlash;
PN = Res.ProperNoun; -- ProperNoun : Type = {s: Str ; a:Agreement ; isPlace : Bool};
Conj = Res.Conjunction; -- Conjunction: Type = {s : AgrConj =>Str ;s2 : Str ; n : Number} ; -- conjunction e.g. "and"
-- see Structural for explanation of this structure
Predet = {s : Str ; s2 : Str; isMWE : Bool; isInflected : Bool}; -- predeterminer (prefixed Quant) e.g. "all"
{- {-
--1 Cat: the Category System --1 Cat: the Category System

View File

@@ -4,7 +4,127 @@ concrete LexiconCgg of Lexicon = CatCgg **
open ParadigmsCgg, ResCgg, Prelude in { open ParadigmsCgg, ResCgg, Prelude in {
lin lin
--NOTE: Those commented out are not in the abstract
--burn_V = mkV "sya" ;
--die_V = mkV "fa" ;
--fly_V = mkV "guruka" ;
bird_N = mkN "ekinyonyi" KI_BI ;
boat_N = mkN "eryato" RI_MA ;
book_N = mkN "ekitabo" KI_BI ;
boy_N = mkN "omwojo" "abojo" MU_BA ;
bread_N = mkN "omugati" MU_MI;
car_N = mkN "emootoka" N_N ;
cat_N = mkN "enjangu" N_N ;
--chair_N = mkN "entebbe" N_N ;
child_N = mkN "omwana" MU_BA ;
city_N = mkN "ekibúga" KI_BI; --orurêmbo pl endêmbo
cloud_N = mkN "ekikyu" KI_BI ;
computer_N = mkN "kanyabwêngye" ZERO_ZERO ; --kanyabwêngye, embiikabwengye, kompyuta
cow_N = mkN "ente" N_N ;
dog_N = mkN "embwa" N_N ;
--person_N = mkN "omuntu" "abantu" MU_BA ;
fire_N = mkN "omuriro" MU_MI ;
fish_N = mkN "eky'ényanja" KI_BI ;
flower_N = mkN "ekimuri" KI_BI ;
friend_N = mkN "omunywâni" MU_MI ; -- omunywâni, omunyamukago, omugyenzi
girl_N = mkN "omwishiki" MU_BA ;
--shoe_N = mkN "ekaito" N_N ;
--table_N = mkN "emeza" N_N ;
--airplane_N = mkN "enyonyi" N_N ; -- mkN "endégye" N_N;
animal_N = mkN "enyamaishwa" N_N ;
apple_N = mkN "apple" ZERO_ZERO ;
baby_N = mkN "omwana" MU_BA ;
beer_N = mkN "amarwa" ZERO_MA ;
bike_N = mkN "egaari" N_N ;
bird_N = mkN "ekinyonyi" KI_BI ;
blood_N = mkN "eshágama" N_ZERO ;
grammar_N = mkN "enyómbeka y'órurími" "enyómbeka z'endími" ZERO_ZERO ; -- two words representing one word
horse_N = mkN "embaráàsi" N_N ;
house_N = mkN "enju" N_N ;
language_N = mkN "orurími" "endími" RU_N ;
man_N = mkN "omushaija" MU_BA ;
milk_N = mkN "amate" ZERO_MA ;
music_N = mkN "music" ZERO_ZERO ; -- I have not found the translation
river_N = mkN "omugyera" MU_MI ; --omurîndi,
sea_N = mkN "enyanja" N_N ;
ship_N = mkN "ekyombo" KI_BI ; -- eméèri [NC_n_n]
star_N = mkN "enyonyóòzi" N_N ;
train_N = mkN "egaari y'omwika" N_N ; -- plural would be egáàri z'omwika
tree_N = mkN "omuti" MU_MI ;
water_N = mkN "amáìzi" ZERO_MA ;
wine_N = mkN "víìnyo" ZERO_ZERO ;
woman_N = mkN "omwishiki" MU_BA ;
--Proper Nouns
john_PN = mkPN "Yohana" (AgP3 Sg MU_BA) False;
paris_PN = mkPN "Paris" (AgP3 Sg N_N) True; --Noun class for places???
--Adjectives
bad_A = mkAdjective "bi" False False False; --False means the adjective is a stem and comes after the complete noun
--beautiful_A = mkAdjective "rungi" False;
big_A = mkAdjective "hango" False False False;
black_A = mkAdjective "kwirangura" False False False;
blue_A = mkAdjective "buuru" False True True ;
clean_A = mkAdjective "yonjo" False False False; --: A ;
cold_A = mkAdjective "rikufuka" False False False; --: A ;
good_A =mkAdjective "rungi" False False False; --: A ;
heavy_A = mkAdjective "rikuremeera" False False False; --: A ; --notice ri as a verb is
hot_A = mkAdjective "rikwotsya" False False False; -- rikutagata -- problematic words like hot we need a new set of clitics
new_A = mkAdjective "sya" False False False; --: A ;
old_A = mkAdjective "kúru" False False False; --: A ;
ready_A = mkAdjective "eteekateekire" False False False; --: A ;
red_A = mkAdjective "ríkutukura" False False False; --: A ;
small_A = mkAdjective "kye" False False False;
warm_A = mkAdjective "rikutagata" False False False;--: A ;
white_A = mkAdjective "rikwera" False False False;--: A ;
yellow_A = mkAdjective "kinekye" False True True;--: A ; or yero, or kyenju
young_A = mkAdjective "to" False False False;--: A ;
green_A =mkAdjective "kijubwe" False False True;
--ditransitive verbs
--bite_V2 = mkV2 "rum";
break_V2 = mkV2 "hend"; --: V2 ;
buy_V2 = mkV2 "gur" ; --: V2 ;
--close_V2 = mkV2 "king";
--count_V2 = mkV2 "bar";
--cut_V2 = mkV2 "shar";
--do_V2 = mkV2 "kor";
drink_V2 = mkV2 "nyw";
eat_V2 = mkV2 "ry";
--fear_V2 = mkV2 "tiin";
find_V2 = mkV2 "bon" ; --: V2 ; -- many words; kureeba, kubóna,kushanga, kumamya,kujumbura
kill_V2 = mkV2 "it"; --: V2 ;
love_V2 = mkV2 "kûnd"; --: V2 ;
read_V2 = mkV2 "shoma";--: V2 ;
see_V2 = mkV2 "reeb"; --: V2 ;
teach_V2 = mkV2 "shomes" ; --: V2 ; or kwegyesa
understand_V2 = mkV2 "étegyerez"; --: V2 ;
wait_V2 = mkV2 "tegyerez"; --: V2 ;
-- Intransitive verbs
come_V = mkV "ij";
go_V = mkV "gyend"; --: V ; -- Many words: kuza, kuraba,kutoora, kugyenda=go away, kushuma=go down
jump_V = mkV "guruk" ;
play_V = mkV "zaan"; --: V ;
live_V = mkV "tuur" ; --manyF: kutuura i.e. live somewhere, stay = kuráàra
run_V = mkV "íruk"; -- : V ;
sleep_V = mkV "nyama" ; --: V ;--Kugwejegyera, kubyama
swim_V = mkV "og"; --: V ;
travel_V = mkV "gyend";--: V ;
walk_V = mkV "tabur"; --: V ; or kuribata
--Adverbs
now_Adv = mkAdv "hati" AgrNo;
--far_Adv = mkAdv "hare";
--today_Adv = mkAdv "erizooba" AgrNo;
{-
--Old LexiconCgg.gf
burn_V = mkV "sya" ; burn_V = mkV "sya" ;
die_V = mkV "fa" ; die_V = mkV "fa" ;
fly_V = mkV "guruka" ; fly_V = mkV "guruka" ;
@@ -41,362 +161,6 @@ lin
-------------------------Differences Rukiga only-------------------- -------------------------Differences Rukiga only--------------------
airplane_N : mkN "endegye" N_N; airplane_N : mkN "endegye" N_N;
{-
abstract Lexicon = Cat ** {
fun
here_Adv; --aha
here1_Adv; -- hanu
here2_Adv; -- hanuuya --exactly here or here with emphasis
add_V3 : V3 ;
airplane_N : N ;
alas_Interj : Interj ;
already_Adv : Adv ;
animal_N : N ;
answer_V2S : V2S ;
apartment_N : N ;
apple_N : N ;
art_N : N ;
ashes_N : N ;
ask_V2Q : V2Q ;
baby_N : N ;
back_N : N ;
bad_A : A ;
bank_N : N ;
bark_N : N ;
beautiful_A : A ;
become_VA : VA ;
beer_N : N ;
beg_V2V : V2V ;
belly_N : N ;
big_A : A ;
bike_N : N ;
bird_N : N ;
bite_V2 : V2 ;
black_A : A ;
blood_N : N ;
blow_V : V ;
blue_A : A ;
boat_N : N ;
bone_N : N ;
book_N : N ;
boot_N : N ;
boss_N : N ;
boy_N : N ;
bread_N : N ;
break_V2 : V2 ;
breast_N : N ;
breathe_V : V ;
broad_A : A ;
brother_N2 : N2 ;
brown_A : A ;
burn_V : V ;
butter_N : N ;
buy_V2 : V2 ;
camera_N : N ;
cap_N : N ;
car_N : N ;
carpet_N : N ;
cat_N : N ;
ceiling_N : N ;
chair_N : N ;
cheese_N : N ;
child_N : N ;
church_N : N ;
city_N : N ;
clean_A : A ;
clever_A : A ;
close_V2 : V2 ;
cloud_N : N ;
coat_N : N ;
cold_A : A ;
come_V : V ;
computer_N : N ;
correct_A : A ;
country_N : N ;
count_V2 : V2 ;
cousin_N : N ;
cow_N : N ;
cut_V2 : V2 ;
day_N : N ;
die_V : V ;
dig_V : V ;
dirty_A : A ;
distance_N3 : N3 ;
doctor_N : N ;
dog_N : N ;
door_N : N ;
do_V2 : V2 ;
drink_V2 : V2 ;
dry_A : A ;
dull_A : A ;
dust_N : N ;
ear_N : N ;
earth_N : N ;
easy_A2V : A2 ;
eat_V2 : V2 ;
egg_N : N ;
empty_A : A ;
enemy_N : N ;
eye_N : N ;
factory_N : N ;
fall_V : V ;
far_Adv : Adv ;
father_N2 : N2 ;
fat_N : N ;
fear_VS : VS ;
fear_V2 : V2 ;
feather_N : N ;
fight_V2 : V2 ;
find_V2 : V2 ;
fingernail_N : N ;
fire_N : N ;
fish_N : N ;
float_V : V ;
floor_N : N ;
flower_N : N ;
flow_V : V ;
fly_V : V ;
fog_N : N ;
foot_N : N ;
forest_N : N ;
forget_V2 : V2 ;
freeze_V : V ;
fridge_N : N ;
friend_N : N ;
fruit_N : N ;
full_A : A ;
fun_AV : A ;
garden_N : N ;
girl_N : N ;
give_V3 : V3 ;
glove_N : N ;
gold_N : N ;
good_A : A ;
go_V : V ;
grammar_N : N ;
grass_N : N ;
green_A : A ;
guts_N : N ;
hair_N : N ;
hand_N : N ;
harbour_N : N ;
hate_V2 : V2 ;
hat_N : N ;
head_N : N ;
heart_N : N ;
hear_V2 : V2 ;
heavy_A : A ;
hill_N : N ;
hit_V2 : V2 ;
hold_V2 : V2 ;
hope_VS : VS ;
horn_N : N ;
horse_N : N ;
hot_A : A ;
house_N : N ;
hunt_V2 : V2 ;
husband_N : N ;
ice_N : N ;
important_A : A ;
industry_N : N ;
iron_N : N ;
john_PN : PN ;
jump_V : V ;
kill_V2 : V2 ;
king_N : N ;
knee_N : N ;
know_V2 : V2 ;
know_VQ : VQ ;
know_VS : VS ;
lake_N : N ;
lamp_N : N ;
language_N : N ;
laugh_V : V ;
leaf_N : N ;
learn_V2 : V2 ;
leather_N : N ;
leave_V2 : V2 ;
left_Ord : Ord ;
leg_N : N ;
lie_V : V ;
like_V2 : V2 ;
listen_V2 : V2 ;
liver_N : N ;
live_V : V ;
long_A : A ;
lose_V2 : V2 ;
louse_N : N ;
love_N : N ;
love_V2 : V2 ;
man_N : N ;
married_A2 : A2 ;
meat_N : N ;
milk_N : N ;
moon_N : N ;
mother_N2 : N2 ;
mountain_N : N ;
mouth_N : N ;
music_N : N ;
name_N : N ;
narrow_A : A ;
near_A : A ;
neck_N : N ;
new_A : A ;
newspaper_N : N ;
night_N : N ;
nose_N : N ;
now_Adv : Adv ;
number_N : N ;
oil_N : N ;
old_A : A ;
open_V2 : V2 ;
paint_V2A : V2A ;
paper_N : N ;
paris_PN : PN ;
peace_N : N ;
pen_N : N ;
person_N : N ;
planet_N : N ;
plastic_N : N ;
play_V2 : V2 ;
play_V : V ;
policeman_N : N ;
priest_N : N ;
probable_AS : A ;
pull_V2 : V2 ;
push_V2 : V2 ;
put_V2 : V2 ;
queen_N : N ;
question_N : N ;
radio_N : N ;
rain_N : N ;
rain_V0 : V ;
read_V2 : V2 ;
ready_A : A ;
reason_N : N ;
red_A : A ;
religion_N : N ;
restaurant_N : N ;
right_Ord : Ord ;
river_N : N ;
road_N : N ;
rock_N : N ;
roof_N : N ;
root_N : N ;
rope_N : N ;
rotten_A : A ;
round_A : A ;
rubber_N : N ;
rub_V2 : V2 ;
rule_N : N ;
run_V : V ;
salt_N : N ;
sand_N : N ;
say_VS : VS ;
school_N : N ;
science_N : N ;
scratch_V2 : V2 ;
sea_N : N ;
seed_N : N ;
seek_V2 : V2 ;
see_V2 : V2 ;
sell_V3 : V3 ;
send_V3 : V3 ;
sew_V : V ;
sharp_A : A ;
sheep_N : N ;
ship_N : N ;
shirt_N : N ;
shoe_N : N ;
shop_N : N ;
short_A : A ;
silver_N : N ;
sing_V : V ;
sister_N : N ;
sit_V : V ;
skin_N : N ;
sky_N : N ;
sleep_V : V ;
small_A : A ;
smell_V : V ;
smoke_N : N ;
smooth_A : A ;
snake_N : N ;
snow_N : N ;
sock_N : N ;
song_N : N ;
speak_V2 : V2 ;
spit_V : V ;
split_V2 : V2 ;
squeeze_V2 : V2 ;
stab_V2 : V2 ;
stand_V : V ;
star_N : N ;
steel_N : N ;
stick_N : N ;
stone_N : N ;
stop_V : V ;
stove_N : N ;
straight_A : A ;
student_N : N ;
stupid_A : A ;
suck_V2 : V2 ;
sun_N : N ;
swell_V : V ;
swim_V : V ;
switch8off_V2 : V2 ;
switch8on_V2 : V2 ;
table_N : N ;
tail_N : N ;
talk_V3 : V3 ;
teacher_N : N ;
teach_V2 : V2 ;
television_N : N ;
thick_A : A ;
thin_A : A ;
think_V : V ;
throw_V2 : V2 ;
tie_V2 : V2 ;
today_Adv : Adv ;
tongue_N : N ;
tooth_N : N ;
train_N : N ;
travel_V : V ;
tree_N : N ;
turn_V : V ;
ugly_A : A ;
uncertain_A : A ;
understand_V2 : V2 ;
university_N : N ;
village_N : N ;
vomit_V : V ;
wait_V2 : V2 ;
walk_V : V ;
warm_A : A ;
war_N : N ;
wash_V2 : V2 ;
watch_V2 : V2 ;
water_N : N ;
wet_A : A ;
white_A : A ;
wide_A : A ;
wife_N : N ;
wind_N : N ;
window_N : N ;
wine_N : N ;
wing_N : N ;
win_V2 : V2 ;
wipe_V2 : V2 ;
woman_N : N ;
wonder_VQ : VQ ;
wood_N : N ;
worm_N : N ;
write_V2 : V2 ;
year_N : N ;
yellow_A : A ;
young_A : A ;
-} -}
} }

View File

@@ -4,10 +4,16 @@ concrete NounCgg of Noun = CatCgg **
open ResCgg, Prelude in { open ResCgg, Prelude in {
lin lin
UsePron pron = pron; -- the result of use pron is a NounPhrase --UsePN : PN -> NP ; -- John
UsePN pn = {s = \\ _ => pn.s; agr = pn.a}; -- John
DetCN det cn = mkDeterminer det cn; --Should be nemed mkDetCN
UsePron pron = { s = pron.s; agr = pron.agr}; --: Pron -> NP ; -- he
--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
--DetCN det cn = mkDeterminer det cn; --Should be nemed mkDetCN
DetCN det cn = mkDetCN det cn; -- the man
{- {-
case det.pos of{ case det.pos of{
PreDeterminer =>{s = det.s ++ cn.s!det.ntype!det.num} ; PreDeterminer =>{s = det.s ++ cn.s!det.ntype!det.num} ;
@@ -17,7 +23,54 @@ lin
UseN noun = noun ; UseN noun = noun ;
--Noun = {s : NounType=>Number => Str ; nc : NClass} ; --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 = {s=\\ntype, num=>cn.s!ntype!num ++ ap.s!AgP3 num cn.nc; nc=cn.nc};
AdjCN ap cn =
case <ap.isPre, ap.isProper, > of {
<True, True> => {
s = \\ ns, num =>ap.s ++ cn.s ! ns ! num ;
gender = cn.gender
};
<False, False> => case ap.isPrep of {
False => {
s = \\ ns, num => cn.s ! ns ! num ++ mkAdjPronIVClitic (AgP3 num cn.gender)
++ ap.post ;
gender = cn.gender
};
True => {
s = \\ ns, num => (cn.s ! ns ! num) ++
mkGenPrepNoIVClitic (AgP3 num cn.gender) ++ ap.post ;
gender = cn.gender
}
};
<True, False> => {
s = \\ ns, num => mkAdjPronIVClitic (AgP3 num cn.gender)
++ ap.s ++ (cn.s ! ns ! num) ;
gender = cn.gender
};
<False, True> => {
s = \\ ns, num => (cn.s ! ns ! num) ++ ap.post ;
gender = cn.gender
}
}; -- big house
{-
A predeterminer is any word that modifies a noun Phrase.
These Predeterminers are found in Structural
-}
--PredetNP : Predet -> NP -> NP ; -- only the man
PredetNP predet np = let a = np.agr;
nomS = np.s ! Nom; --It does not matter which. Just pick out one.
accS = np.s ! Acc;
in
case <predet.isMWE, predet.isInflected> of {
<False, True> => {s = \\_ =>nomS ++ mkPredetPref a ++ Predef.BIND ++ predet.s ; agr = a};
<True, True > => {s = \\_ =>nomS ++ mkPredetPref a ++ Predef.BIND ++ predet.s ++
mkPredetPref a ++ Predef.BIND ++ 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
};
-- 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
{- {-
@@ -25,15 +78,15 @@ lin
-} -}
--DetQuant quant num = {s = quant.s ++ num.s ; ntype = Complete ; num = num.n ; pos = PostDeterminer } ; --DetQuant quant num = {s = quant.s ++ num.s ; ntype = Complete ; num = num.n ; pos = PostDeterminer } ;
NumSg = {s=[]; n=Sg}; --NumSg = {s=[]; n=Sg};
NumPl = {s=[]; n=Pl}; --NumPl = {s=[]; n=Pl};
-- NumCard card = {...}; -- NumCard card = {...};
IndefArt = {s=[]}; --IndefArt = {s=[]};
DefArt = {s=[]} ; --DefArt = {s=[]} ;
-- AdvCN : CN -> Adv -> CN ; -- house on the hill -- AdvCN : CN -> Adv -> CN ; -- house on the hill
AdvCN cn adv ={s=\\ntype,num =>cn.s!ntype!num ++ adv.s!(AgP3 num cn.nc); nc=cn.nc}; --AdvCN cn adv ={s=\\ntype,num =>cn.s!ntype!num ++ adv.s!(AgP3 num cn.nc); nc=cn.nc};
{- {-
--1 Noun: Nouns, noun phrases, and determiners --1 Noun: Nouns, noun phrases, and determiners

View File

@@ -16,16 +16,19 @@ oper
mkN = overload { mkN = overload {
mkN : (fish : Str) -> NClass -> N mkN : (fish : Str) -> Gender -> N
= \fish,nclass -> lin N (mkNoun fish fish nclass) ; = \fish,nclass -> lin N (mkNoun fish fish nclass) ;
mkN : (man,men : Str) -> NClass -> N mkN : (man,men : Str) -> Gender -> N
= \man,men,nclass -> lin N (mkNoun man men nclass) ; = \man,men,nclass -> lin N (mkNoun man men nclass) ;
} ; } ;
mkV = overload {
mkV : (cry : Str) -> V mkV : Str -> Verb = \root ->{s =root; morphs= mkVerbMorphs};
= \cry -> lin V (mkVerb cry) ; mkV2 : Str -> Verb2 = \root ->mkV root ** {comp =[]};
}; --mkV = overload {
--mkV : (cry : Str) -> V
--= \cry -> lin V (mkVerb cry) ; -- what does it mean to create a lin on the fly
--};
{- Note: The following is copied from the file swahili/ParadigmsSwa.gf {- Note: The following is copied from the file swahili/ParadigmsSwa.gf

View File

@@ -5,13 +5,21 @@ concrete PhraseCgg of Phrase = CatCgg ** open Prelude, ResCgg in {
lin lin
UttS sent = sent ; UttS sent = sent ;
UttQS qs = qs ; --: QS -> Utt ;-- does John walk
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
NoPConj = {s = ""} ; NoPConj = {s = ""} ;
NoVoc = {s = ""} ; NoVoc = {s = ""} ;
-- Utterances are formed from sentences, questions, and imperatives.
UttNP np = {s= np.s!Acc}; --: NP -> Utt ;
UttAdv adv = {s = adv.s}; --: Adv -> Utt ; -- in the house
UttImpSg pol imp = {s =
case pol.isTrue of {
True => imp.s!True;
False => (mkSubjClitic (AgMUBAP2 Sg)) ++ imp.s!False
}
};--: Pol -> Imp -> Utt ; -- (do not) walk ----s
{- {-
--1 Phrase: Phrases and Utterances --1 Phrase: Phrases and Utterances

File diff suppressed because it is too large Load Diff

910
src/rukiga/ResCggOld.gf Normal file
View File

@@ -0,0 +1,910 @@
--# -path=.:../prelude:../abstract:../common
-- structure of module types i.e header which defines the type of module and
-- tells what other modules it inherits also known as extension(means that a module can inherit the contents
-- of one or more modules to which new judgements are added. You can optionally inherit parts of it using
-- [comma separeted functions]) followed by ** and optionally an open statement(if the module type is concrete
-- or resource i.e open <module name>[namespace identifiers]) and then followed by a mandatory body {}
-- opening a resource means you can use its contents without inheriting them (how I do not know)
-- module types include:
-- 1.abstract modules
-- 2.concrete modules
-- 3.resource modules: these define parameter types and operations usable in several concrete syntaxes as general functions in lincat definitions
-- general structure: <module type> <module name> [of <abstrcat module name if module type is concrete>] = [<extended modules[comma, separted list of objects inherited]>] [**][open <module names[namespace identifiers]> in]{body}
resource ResCgg = ParamX ** --
open Prelude, (Predef=Predef) in {
param
NounType = Complete | Incomplete ;
Position = PostDeterminer | PreDeterminer ;
Case = Nom | Acc | Gen ;
Agr = AgP3 Number NClass | AgMUBAP1 Number |AgMUBAP2 Number ;
NClass = MU_BA | -- for human beings and deity e.g. omuntu/abantu
KI_BI | -- eki-tookye/ebi-tookye
N_N | -- nouns that do not vary their spelling with singular and plural (normally begin with "e")
KU_MA | -- okuguru / amaguru, (leave out the non plurals)okugyenda (Deverbative) / Amagyenda (Deverbative outward journey)
BU_MA |
RU_BU | -- oruro / oburo
GU_GA | -- ogushaija / agashaija --dimunitive
ZERO_ZERO | -- nouns without initial vowel nor class syllables e.g barugu, muha, sho
MU_MI | --
RI_MA |
I_MA |
KA_BU |
KA_TU | --dimunitive version of KA_BU belong to same noun class
RU_N | -- orurimi / endimi
RU_MA |
--those of place or location
HA |
MU |
KU |
--aditions
ZERO_BU |
ZERO_BI |
ZERO_MA | -- amate takes the concords of plural particle "ma"
ZERO_MI |
ZERO_TU |
ZERO_N |
I_ZERO |
RI_ZERO |
KU_ZERO |
MU_ZERO |
RU_ZERO |
ZERO_BAA | -- human relationships
KA_ZERO ; --akabi (ZERO to the right means the concords of that noun are always those of the singular as used in noun-classes KA) see KA_BU, KA_TU
PersonalPronounType = SubjM | Obj | RelSubj | RelObj |
AdjPron2 | -- aAdjectival Prefixes with initial vowel with the semantics of "the" e.g. -- omuntu o-mu-rungi
AdjPron | -- without initial vowel i.e. -- omuntu mu-rungi
--GenPron | -- different types of pronouns
GenPrep1 |
GenPrep2 |
GenAdj |
SStandPron ; --Self-standing pronouns
oper
Noun : Type ;
Noun = {s : NounType=>Number => Str ; nc : NClass } ;
smartNoun : Str -> NClass -> Noun
= \omuntu, g ->
case <omuntu , g> of {
-- Handling the Tone System is also another problem.
< "o" + "mu" + stem, MU_BA > => mkNoun omuntu ("aba" + stem) g ;
--special cases like omwana, omwishiki, omwojo
< "o" + "mw" + stem, MU_BA > => mkNoun omuntu (combine_morphemes "aba" stem) g ; --same as mu_ba but the "u" + "a" of the stem to form mwa
< "o" + "mu" + stem, MU_MI > => mkNoun omuntu (combine_morphemes "emi" stem) g ;
< "o" + "ru" + stem, RU_MA > => mkNoun omuntu (combine_morphemes "ama" stem) g ;
< "o" + "ru" + stem, RU_N > => mkNoun omuntu (combine_morphemes "en" stem) g ; --desist from providing a singlar only but give both
< "o" + "bu" + stem, BU_MA > => mkNoun omuntu (combine_morphemes "ama" stem) g ;
< "o" + "gu" + stem, GU_GA > => mkNoun omuntu (combine_morphemes "aga" stem) g ;
< "o" + ("ku" | "kw") + stem, KU_MA > => mkNoun omuntu (combine_morphemes "ama" stem) g ;
< "o" + "kw" + stem, KU_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ;
< "o" + "ku" + stem, KU_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "o" + "mu" + stem, MU_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "o" + "mu" + stem, MU_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "o" + "ru" + stem, RU_BU > => mkNoun omuntu (combine_morphemes "obu" stem) g ;
< "o" + "ru" + stem, RU_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "a" + "ha" + stem, HA_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "a" + "ka" + stem, KA_BU > => mkNoun omuntu (combine_morphemes "obu" stem) g ;
< "a" + "ka" + stem, KA_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "e" + "ki" + stem, KI_BI > => mkNoun omuntu (combine_morphemes "ebi" stem) g ;
< "e" + "ki" + stem, KI_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "e" + "i" + stem, I_MA > => mkNoun omuntu (combine_morphemes "ama" "") g ;
< "e" + "i" + stem, I_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "e" + "ri" + stem, RI_MA > => mkNoun omuntu (combine_morphemes "ama" stem) g ;
< "e" + "ri" + stem, RI_ZERO > => mkNoun omuntu (combine_morphemes "" "") g ; -- does not exist as plural
< "e" + "ry" + stem, I_MA > => mkNoun omuntu (combine_morphemes "ama" stem) g ;
-- --special cases shall be added with due course as errors are identified
<"e" + "ky" + stem, KI_BI> => mkNoun omuntu (combine_morphemes "ebi" stem) g ;
< _ ,N_N | ZERO_MA > => mkNoun omuntu omuntu g ;
--< _ ,ZERO_MA > => mkNoun omuntu ("ama" + stem) g (Predef.drop 1 omuntu);
--< _ ,> => mkNoun omuntu omuntu g (Predef.drop 1 omuntu);
<_ , ZERO_BAA> => mkNoun omuntu ("baa" + omuntu) g;
< _ ,ZERO_ZERO > => mkNoun omuntu omuntu g;
< _ ,_ > => mkNoun omuntu omuntu g -- improve as we go on.
};
{- Should be taken to Ajective concrete Syntanx-}
mkNoun : Str -> Str -> NClass -> Noun ;
mkNoun child children nc
= { s = table {Complete => table {
Sg => child ; Pl => children } ;
Incomplete => table {
Sg => Predef.drop 1 child ; Pl => Predef.drop 1 children } }; --removal of the initial vowel
nc = nc
} ;
mkN = overload {
mkN : Str -> NClass -> Noun = smartNoun ;
mkN : Str -> Str -> NClass -> Noun = mkNoun;
} ;
-- combine_morphemes need the function last to get
-- the last letter in a morphme.
-- uses Predef.length and Predef.take
-- Please use let so that you compute Predef.length once and use if then else
-- if possible
{-
last : Str -> Str ;
last = \ w ->
case (Predef.length w) of {
0 => [];
_ => Predef.drop ((Predef.length w)-1) w
} ;
-}
{-
This function tries to handle phonological-conditioning.
Usage: Use it whenever you are trying to combine morphemes especially in:
1. Pronouns
2. Verbs and verb Phrases.
3. Noun Phrases
3. Adjectival Phrases e.t.c
Given two morphemes A and B to combine,
1. compare the last letter of the first morpheme A with the first letter of the second morpheme B
2. Use parttern matching to obtain the right letters for the comnined word
Source of rules:
1. personal experience
2. Morris and Kirwan Runynakore Grammar
3. but we shall add more as we meet them during debugging
-}
combine_morphemes : Str -> Str -> Str ;
combine_morphemes = \ f, s ->
case <(Predef.dp 1 f), (Predef.take 1 s)> of {
<"n" , "r"> => f + "d" + (Predef.drop 1 s) ;
<"u" , "a" | "e" | "o" | "i"> => Predef.tk 1 f + "w" + s ;
<"i" , "a" | "e" | "o"> => Predef.tk 1 f + "y" + s ;
<"n" , "b" | "p"> => Predef.tk 1 f + "m" + s ;
<"n" , "m"> => Predef.tk 1 f + s ; -- However, note that for pronouns, the n changes to m
<"n" , "h"> => Predef.tk 1 f + "mp" + Predef.drop 1 s ;
<"i", "i"> => f + Predef.drop 1 s ;
<_ , _ > => f + s
} ;
Determiner : Type = {s : Str ; ntype : NounType ; num : Number ; pos : Position } ; -- type for Determier necessary for catCgg.gf
Pronoun : Type ={s : Str ; agr : Agr} ;
VerbPhrase : Type = { s : Agr => Polarity => Tense => Anteriority => Str};
VPSlash : Type = VerbPhrase ** { c : Str } ;
Numer : Type = { s: Str ; n : Number};
Clause : Type = {s : Polarity => Tense => Anteriority => Str};
Adv : Type = {s : Agr => Str } ; -- check pages 116-131 of grammar book
mkAdv : Str -> Adv = \ s -> { s= \\ agr => s };
ParticleForms : Type = PersonalPronounType => Agr => Str;
mkNCParticles : ParticleForms = table {
SubjM => table {
AgMUBAP1 Sg => "n" ;
AgMUBAP1 Pl => "tu" ;
AgMUBAP2 Sg => "wa" ;
AgMUBAP2 Pl => "mu" ;
AgP3 Sg MU_BA => "a" ;
AgP3 Pl MU_BA => "ba" ;
AgP3 Sg KI_BI => "ki" ;
AgP3 Pl (KI_BI | ZERO_BI) => "bi" ;
AgP3 Sg (RU_N | RU_MA | RU_ZERO | RU_BU) => "ru" ;
AgP3 Pl RU_N => "zi"; --| "i";
AgP3 Sg N_N => "e";
AgP3 Pl N_N => "zi"; --| "i";
AgP3 Sg (MU_MI | MU_ZERO) => "gu" ;
AgP3 Pl MU_MI => "e" ;
AgP3 Sg (RI_MA | RI_ZERO | I_ZERO) => "ri";
AgP3 Pl (RI_MA | BU_MA | KU_MA | ZERO_MA | I_MA |RU_MA) => "ga" ;
AgP3 Sg (KA_BU | KA_ZERO | KA_TU) => "ka" ;
AgP3 Pl (KA_BU | RU_BU) => "bu" ;
AgP3 Sg ZERO_BU => "bu" ;
AgP3 Pl ZERO_BU => "bu" ;
AgP3 Sg ZERO_BI => "bi" ;
AgP3 Sg ZERO_MA => "ga" ;
AgP3 Pl RI_ZERO => "ga" ;
AgP3 Sg KU_ZERO => "ku" ;
AgP3 Pl KU_ZERO => "ku" ;
AgP3 Pl MU_ZERO => "gu" ;
AgP3 Pl RU_ZERO => "ru" ;
AgP3 Sg ZERO_TU => "tu" ;
AgP3 Pl ZERO_TU => "tu" ;
AgP3 Sg (ZERO_MI | ZERO_ZERO) => "" ;
AgP3 Pl ZERO_MI => "e" ;
AgP3 Pl KA_ZERO => "" ;
_ => "XX" --for checking if there is some class unaccounted for
};
{-Object particle may be used as
1. a prefix: e.g mu-kwate = catch him,
2. an infix: o-mu-kwate = you catch him
-}
Obj => table {
AgMUBAP1 Sg => "n" ;
AgMUBAP1 Pl => "tu" ;
AgMUBAP2 Sg => "ku" ;
AgMUBAP2 Pl => "ba" ;
AgP3 Sg MU_BA => "mu" ;
AgP3 Pl MU_BA => "ba";
AgP3 Pl (ZERO_BU | KA_BU | KA_TU | RU_BU) => "bu" ;
AgP3 Sg BU_MA => "bu" ;
AgP3 Sg KI_BI => "ki" ;
AgP3 Pl (KI_BI | ZERO_BI) => "bi";
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "ga" ;
AgP3 (Sg | Pl) HA => "ha";
AgP3 Sg (I_ZERO | I_MA | RI_MA) => "ri" ;
AgP3 Sg (KA_ZERO | KA_BU | KA_TU) => "ka" ;
AgP3 Sg (KU_ZERO | KU_MA) => "ku" ;
{-
#comment for the following two lines
the follwing partciles are all used by Noun Classes of Place i.e. HA, KU and MU
We take the particle to be "ha" for all of them although noun class KU can use
another particle "gi" -- see Table of Concords in Appendix of Dictionary by Mpairwe and Kahangi
Note: The particles do not change with respect to gender
TODO: obtain clear examples of usage
-}
AgP3 (Sg | Pl) (HA | MU) => "ha" ;
AgP3 (Sg | Pl) KU => "ha" ; -- gi is also possible -- see comment above
AgP3 Sg (RU_N | RU_ZERO | RU_BU | RU_MA) => "ru" ;
AgP3 Pl (KA_TU | ZERO_TU) => "tu" ;
AgP3 Sg (N_N | ZERO_ZERO) => "gi" ;
AgP3 Sg (MU_MI | MU_ZERO) => "gu" ;
AgP3 Pl GU_GA => "ga" ;
AgP3 Pl (MU_MI | ZERO_MI) => "gi" ;
{-
According to Mpaiwe & Kahangi in their table of concords, the particle for the plural
of noun classes N_N , ZERO_ZERO , ZERO_N & RU_N can be either "i" or "zi" depending
on object they refer to.
Problem:
However, we cannot use the | operator in strings as GF will
fail to compile to comletion.
Implication:
Some of our output strings will have the wrong object particle attached.
Even if the operator | worked, we would generate two versions of the linearized
string of which one would be right and the other wrong
What is the solution to this?
-}
AgP3 Pl (N_N | ZERO_ZERO | ZERO_N | RU_N) => "zi" ; --some cases require use of particle "i"
_ => "-" -- Hopefully exhausted all forms
};
-- who, which
RelSubj => table {
AgMUBAP1 Sg => "o" ;
AgMUBAP1 Pl => "aba" ;
AgMUBAP2 Sg => "o" ;
AgMUBAP2 Pl => "aba" ;
AgP3 Sg MU_BA => "o" ;
AgP3 Pl MU_BA => "aba" ;
AgP3 Sg BU_MA => "obu" ;
AgP3 Pl (ZERO_BU | KA_BU | RU_BU) =>"obu" ;
AgP3 Sg KI_BI => "eki" ;
AgP3 Pl (KI_BI | ZERO_BI) => "ebi" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "aga" ;
AgP3 (Sg | Pl) (HA | MU) => "ha" ; -- better AgP3 _ (HA | MU) => "ha";
AgP3 (Sg | Pl) KU => "e" ;
AgP3 Sg (I_ZERO | I_MA | RI_ZERO | RI_MA) => "eri" ;
AgP3 Sg (KA_ZERO | KA_BU) => "aka" ;
AgP3 Sg (KU_ZERO | KU_MA) => "oku" ;
AgP3 Sg (RU_N | RU_ZERO | RU_BU | RU_MA) => "oru" ;
AgP3 Pl (ZERO_TU | KA_TU) => "otu" ;
AgP3 Pl RU_N => "ezi" ;
AgP3 Sg N_N => "ei" ;
AgP3 Pl (ZERO_ZERO | ZERO_N | RU_N | N_N) => "ezi" ;
AgP3 Sg (MU_MI | MU_ZERO | GU_GA) => "ogu" ;
AgP3 Sg (ZERO_ZERO | N_N ) => "e" ;
AgP3 Pl (MU_MI | ZERO_MI) => "e" ;
AgP3 Pl GU_GA => "aga" ;
_ => "=" -- means something forgoten i.e. debugging purposes
};
--Relative Object paticle such as whom/which found in row 13 of Table of concords in Mpairwe & Kahangi
RelObj => table {
AgMUBAP1 Sg => "ou" ;
AgMUBAP1 Pl => "abi" ; -- use of "abu" is also allowed (depending on what?) but omitted because of compiler issues with | operator
AgMUBAP2 Sg => "ou" ;
AgMUBAP2 Pl => "abi" ; -- use of "abu" is also allowed (depending on what?) but omitted because of compiler issues with | operator
AgP3 Sg MU_BA => "ou" ;
AgP3 Pl MU_BA => "abi" ; -- use of "abu" is also allowed (depending on what?) but omitted because of compiler issues with | operator
AgP3 Sg BU_MA => "obu" ;
AgP3 Pl (ZERO_BU | KA_BU |RU_BU) => "obu" ;
AgP3 Sg KI_BI => "eki" ;
AgP3 Pl (KI_BI | ZERO_BI) => "ebi" ;
{-
The noun classes ZERO_MA,KU_MA,RI_MA,I_MA & BU_MA can use of Relative object particles
"agi" or "agu" (depending on noun class of clause -sure? (depending on what?)) but we
choose one "agi" because of compiler issues with | operator
Qn: Any Solutions
-}
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "agi" ;
-- of place HA & MU
--both ahi and "ahu" are valid particles for noun classes HA and MU but "ahu" omitted
--because of compiler issues with | operator
AgP3 (Sg | Pl) (HA | MU) => "ahi" ; -- better AgP3 _ (HA | MU) => "ha";
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>"eri" ;
-- of place KU
AgP3 (Sg | Pl) KU => "ei" ;
--both aki and "aku" are valid particles for noun classes KA_ZERO & KA_BU but "aku" omitted
--because of compiler issues with | operator
AgP3 Sg (KA_ZERO | KA_BU) =>"aki" ;
AgP3 Sg (KU_ZERO | KU_MA) => "oku" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "oru" ;
AgP3 Pl (ZERO_TU | KA_TU) =>"otu" ;
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "ezi" ;
AgP3 Sg (ZERO_ZERO | N_N) =>"ei" ;
AgP3 Sg (MU_MI | MU_ZERO | GU_GA) => "ogu" ;
AgP3 Pl (MU_MI | ZERO_MI) => "ei" ;
--both agi and "agu" are valid particles for noun classes GU_GA in plural but "agu" omitted
--because of compiler issues with | operator
AgP3 Pl GU_GA => "agi" ;
_ => "=" -- means something forgoten i.e. debugging purposes
};
-- Adjectival Prefixes with initial vowel with the semantics of the
AdjPron2 => table {
AgMUBAP1 Sg => "omu" ;
AgMUBAP1 Pl => "aba" ;
AgMUBAP2 Sg => "omu" ;
AgMUBAP2 Pl => "aba" ;
AgP3 Sg MU_BA => "omu" ;
AgP3 Pl MU_BA => "aba" ;
AgP3 Pl ZERO_BU => "obu" ;
AgP3 Sg BU_MA => "obu" ;
AgP3 Pl (KA_BU | RU_BU) =>"obu" ;
AgP3 Pl (KI_BI | ZERO_BI) => "ebi" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "ama";
AgP3 (Sg | Pl) (HA | MU) => "aha" ; -- of place HA & MU
AgP3 (Sg | Pl) KU => "en" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>"eri" ;
AgP3 Sg (KA_ZERO | KA_BU) =>"aka" ;
AgP3 Sg KI_BI => "eki" ;
AgP3 Sg (KU_ZERO | KU_MA) => "oku" ;
AgP3 Sg (MU_MI | MU_ZERO) => "omu" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "oru" ;
AgP3 Pl (ZERO_TU | KA_TU) =>"otu" ;
AgP3 Sg (ZERO_ZERO | N_N) =>"en" ;
AgP3 Pl ZERO_MI => "en" ;
AgP3 Pl MU_MI => "emi";
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "en" ;
AgP3 Sg GU_GA => "ogu" ;
AgP3 Pl GU_GA => "aga" ;
_ => "XXX" -- error checking for any case not catered for
};
-- Adjectival Prefixes without initial vowel
AdjPron => table {
AgMUBAP1 Sg => "mu" ;
AgMUBAP1 Pl => "ba" ;
AgMUBAP2 Sg => "mu" ;
AgMUBAP2 Pl => "ba" ;
AgP3 Sg MU_BA => "mu" ;
AgP3 Pl MU_BA => "ba" ;
AgP3 Pl ZERO_BU => "bu";
AgP3 Sg BU_MA => "bu" ;
AgP3 Pl (KA_BU | RU_BU) =>"bu" ;
AgP3 Pl (KI_BI | ZERO_BI) => "bi" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "ma" ;
AgP3 (Sg | Pl) (HA | MU) => "ha" ; -- of place HA & MU
AgP3 (Sg | Pl) KU => "n" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>"ri" ;
AgP3 Sg (KA_ZERO | KA_BU) =>"ka" ;
AgP3 Sg KI_BI => "ki" ;
AgP3 Sg (KU_ZERO | KU_MA) => "ku" ;
AgP3 Sg (MU_MI | MU_ZERO) => "omu";
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "ru" ;
AgP3 Pl (ZERO_TU | KA_TU) =>"tu" ;
AgP3 Sg (ZERO_ZERO | N_N) =>"n" ;
AgP3 Pl ZERO_MI => "n" ;
AgP3 Pl MU_MI => "emi" ;
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "n" ;
AgP3 Sg GU_GA => "ogu" ;
AgP3 Pl GU_GA => "aga" ;
_ => "XXX" -- for debugging purposes
} ;
--Genetive Preposition: exclusively of (with initial vowel)
GenPrep1 => table {
AgMUBAP1 Sg => "owa" ;
AgMUBAP1 Pl => "aba" ;
AgMUBAP2 Sg => "owa" ;
AgMUBAP2 Pl => "aba" ;
AgP3 Sg MU_BA => "owa" ;
AgP3 Pl MU_BA => "aba" ;
AgP3 Pl ZERO_BU => "obwa" ;
AgP3 Sg BU_MA => "obwa" ;
AgP3 Pl (KA_BU | RU_BU) =>"obwa" ;
AgP3 Pl (KI_BI | ZERO_BI) => "ebya" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "aga" ;
AgP3 (Sg | Pl) HA => "aha" ; -- of place HA
AgP3 (Sg | Pl) MU => "omwa" ; -- of place MU
AgP3 (Sg | Pl) KU => "eya" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>"erya" ;
AgP3 Sg (KA_ZERO | KA_BU) =>"aka" ;
AgP3 Sg KI_BI => "ekya" ;
AgP3 Sg (KU_ZERO | KU_MA) => "okwa" ;
AgP3 Sg (MU_MI | MU_ZERO) => "ogwa" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "orwa" ;
AgP3 Pl (ZERO_TU | KA_TU) =>"otwa" ;
AgP3 Sg (ZERO_ZERO | N_N) =>"eya" ;
AgP3 Pl ZERO_MI => "eya" ;
AgP3 Pl MU_MI => "eya" ;
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "eza" ;
AgP3 Sg GU_GA => "ogwa" ;
AgP3 Pl GU_GA => "aga" ;
_ => "XYY" -- for debugging purposes
};
--Genetive Preposition: simply of without initial vowel
GenPrep2 => table {
AgMUBAP1 Sg => "wa" ;
AgMUBAP1 Pl => "ba" ;
AgMUBAP2 Sg => "wa" ;
AgMUBAP2 Pl => "ba" ;
AgP3 Sg MU_BA => "wa" ;
AgP3 Pl MU_BA => "ba" ;
AgP3 Pl ZERO_BU => "bwa" ;
AgP3 Sg BU_MA => "bwa" ;
AgP3 Pl (KA_BU | RU_BU) =>"bwa" ;
AgP3 Pl (KI_BI | ZERO_BI) => "bya" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "ga" ;
AgP3 (Sg | Pl) HA => "ha" ; -- of place HA
AgP3 (Sg | Pl) MU => "mwa" ; -- of place MU
AgP3 (Sg | Pl) KU => "ya" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>"rya" ;
AgP3 Sg (KA_ZERO | KA_BU) =>"ka" ;
AgP3 Sg KI_BI => "kya" ;
AgP3 Sg (KU_ZERO | KU_MA) => "kwa" ;
AgP3 Sg (MU_MI | MU_ZERO) => "gwa" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "rwa";
AgP3 Pl (ZERO_TU | KA_TU) =>"twa" ;
AgP3 Sg (ZERO_ZERO | N_N) =>"ya" ;
AgP3 Pl ZERO_MI => "ya" ;
AgP3 Pl MU_MI => "ya" ;
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "za" ;
AgP3 Sg GU_GA => "gwa" ;
AgP3 Pl GU_GA => "ga" ;
_ => "XYY" -- for debugging purposes
};
-- Genetive Adjective suffixes used to form genetive adjectives when conjugated to
-- the genetive prepositions particles
-- examples: ekya-{ngye}= my own or mine, ekya-{itu}= our own or ours,
-- ekya-{we}-your own or yours
GenAdj => table {
AgMUBAP1 Sg => "ngye" ;
AgMUBAP1 Pl => "itu" ;
AgMUBAP2 Sg => "we" ;
AgMUBAP2 Pl => "nyu" ;
AgP3 Sg MU_BA => "e" ;
AgP3 Pl MU_BA => "bo" ;
AgP3 Pl ZERO_BU => "bwo" ;
AgP3 Sg BU_MA => "bwo" ;
AgP3 Pl (KA_BU | RU_BU) =>"bwo" ;
AgP3 Pl (KI_BI | ZERO_BI) => "byo" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "go" ;
AgP3 (Sg | Pl) HA => "ho" ; -- of place HA
AgP3 (Sg | Pl) MU => "mwo" ; -- of place MU
AgP3 (Sg | Pl) KU => "yo" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>"ryo" ;
AgP3 Sg (KA_ZERO | KA_BU) =>"ko" ;
AgP3 Sg KI_BI => "kyo" ;
AgP3 Sg (KU_ZERO | KU_MA) => "kwo" ;
AgP3 Sg (MU_MI | MU_ZERO) => "gwo" ;
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "rwo" ;
AgP3 Pl (ZERO_TU | KA_TU) =>"two" ;
AgP3 Sg (ZERO_ZERO | N_N) =>"two" ;
AgP3 Pl ZERO_MI => "yo" ;
AgP3 Pl MU_MI => "yo" ;
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "zo" ;
AgP3 Sg GU_GA => "gwo" ;
AgP3 Pl GU_GA => "go" ;
_ => "XXYY" -- for debugging purposes
} ;
SStandPron => table {
AgMUBAP1 Sg =>"nyowe" ;
AgMUBAP1 Pl =>"itwe" ;
AgMUBAP2 Sg =>"iwe" ;
AgMUBAP2 Pl =>"imwe" ;
AgP3 Sg MU_BA => "uwe" ;
AgP3 Pl MU_BA => "bo" ;
AgP3 Pl ZERO_BU => "bwo" ;
AgP3 Sg BU_MA => "bwo" ;
AgP3 Pl (KA_BU | RU_BU) =>"bwo" ;
AgP3 Pl (KI_BI | ZERO_BI) => "byo" ;
AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => "go" ;
AgP3 (Sg | Pl) HA => "ho" ; -- of place HA
AgP3 (Sg | Pl) MU => "mwo" ; -- of place MU
AgP3 (Sg | Pl) KU => "yo" ; -- of place KU
AgP3 Sg (I_ZERO | I_MA | RI_MA) =>"ryo" ;
AgP3 Sg (KA_ZERO | KA_BU) =>"ko" ;
AgP3 Sg KI_BI => "kyo";
AgP3 Sg (KU_ZERO | KU_MA) => "kwo" ;
AgP3 Sg (MU_MI | MU_ZERO) => "gwo";
AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "rwo" ;
AgP3 Pl (ZERO_TU | KA_TU) =>"two" ;
AgP3 Sg (ZERO_ZERO | N_N) =>"two" ;
AgP3 Pl ZERO_MI => "yo" ;
AgP3 Pl MU_MI => "yo" ;
AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "zo" ;
AgP3 Sg GU_GA => "gwo" ;
AgP3 Pl GU_GA => "go" ;
_ => "XXYY" -- for debugging purposes
}
} ;
{-
Operation to create Noun Phrases from a Determiner and Nouns.
In Runyankore and Rukiga, depending on the particular Determiner,
it can appear before (we call PreDeterminer) or after (PostDeterminer) the noun.
Examples:
A. PreDeterminers
1. Definite aricles: Usually using the initial vowel sufficient
2. Demonstratives: ogu muntu (This person)
3. Every: every man = "buri muntu"
B. PostDeterminers
1. Definite aricles: Usually using the initial vowel sufficient
2. Demonstratives: omuntu ogu (person this)
3. few: omuntu mu-kye
-}
NounPhrase = { s : Str ; agr : Agr } ;
{-This function should be renamed to mkDetCN-}
mkDeterminer: Determiner -> Noun -> NounPhrase = \ det, cn ->
case det.pos of {
PreDeterminer => { s = det.s ++ cn.s ! det.ntype ! det.num; agr = AgP3 det.num cn.nc} ;
PostDeterminer => { s = cn.s!det.ntype!det.num ++ mkNCParticles!SubjM!AgP3 det.num cn.nc ++ det.s; agr = AgP3 det.num cn.nc} -- There is a mistake here. If the determiner is empty, we end up with a meaningless subject particle standing alone. we can test if det.s is a string or empty.
};
{-
Operation to create scenarios in which the PRIMARY NEGATIVE MARKER
for the verb is used. The presence of this marker negates the semantics of the verb.
It is used in the PAST, Simultaneous and all other tenses.
NOTE: The Primary and Secondary markers are in complementary distribution
TO DO: Improve this!!!
-}
mkPol1Marker : Polarity => Tense => Anteriority => Str = table {
Neg => table {
Past => table {
Anter => "" ;
Simul => "ti"
} ;
_ => table {
_ => "ti"
}
} ;
Pos => \\_ => \\_ => ""
};
{-
Operation to create scenarios in which the SECONDARY NEGATIVE MARKER
for the verb is used. The presence of this marker negates the semantics of the verb.
It is used in the PAST, Anterior only.
NOTE: The Primary and Secondary markers are in complementary distribution
-}
mkPol2Marker : Polarity => Tense => Anteriority => Str = table{
Neg => table {
Past => table {
Anter => "ta";
Simul => ""
};
_ => table{
_ => ""
}
};
Pos => \\_=>\\_=> ""
} ;
{-
TO DO: stop here
-}
mkTenseMarker1 : Tense => Anteriority => Str = table{
Past => table{
Anter =>"baire";
Simul =>""
};
Pres => table{
_ =>""
};
Fut => table{
Anter => "ijakubá";-- | "zakubá";
Simul =>"ijaku"-- | "kuzaku" | "raa"
};
Cond => table{
_ => "kaa"
}
};
mkTenseMarker2:Tense=>Anteriority=>Str = table{
Past => table{
Anter =>"ire";
Simul =>"ire"
};
Pres => table{
Anter =>"ire";
Simul =>""
};
Fut => table{
Anter => "ire";
Simul =>""
};
Cond => table{
Anter => "ire";
Simul =>""
}
};
mkAuxTenseMarker: Tense =>Anteriority=>Str =table {
Past => table {
Anter =>"kaba" ;
Simul =>"baire"
};
Pres => table {
Anter =>"baire" ;
Simul =>[]
};
Fut => table {
Anter => "ryaba" ;
Simul =>"ryaba"
};
Cond => table {
Anter => "XX" ;
Simul =>"XX"
}
};
Verb : Type ;
Verb = { s : Agr => Polarity => Tense => Anteriority => Str } ;
AdjectivalPhrase : Type = { s : Agr => Str } ;
mkAdjective: Str-> Bool -> { s : Agr=> Str } = \ a , b -> case b of {
True => { s = \\ agr => a } ;
False => { s = \\ agr => let agrM = mkNCParticles ! AdjPron ! agr in
agrM + a --this is supposed to be a concatenation
}
};
Verb2 : Type = Verb **{ c : Str } ;
mkV2 : Str -> Verb2 = \s -> (mkVerb s) ** { c = [] } ;
Adjective : Type = { s : Agr => Str } ;
mkComp : AdjectivalPhrase -> VerbPhrase ; --comp means compula
mkComp comp = {
s = \\ agr , pol , tense, anter =>
let aux = mkAuxTenseMarker ! tense ! anter;
p2 = mkPol2Marker ! pol ! tense ! anter;
s = mkNCParticles ! SubjM ! agr
in aux ++ p2 + s ++ "ri" ++ comp.s!agr --why does the plus fail?
};
mkVerb : Str -> Verb ; -- write an operation for the object marker
mkVerb run = { s = \\ subjM , pol , tense , anter =>
let p1 = mkPol1Marker ! pol! tense ! anter ;
p2 = mkPol2Marker ! pol! tense ! anter ;
t1 = mkTenseMarker1 ! tense ! anter ;
t2 = mkTenseMarker2 ! tense ! anter ;
s = mkNCParticles ! SubjM !subjM
in
case < tense , anter > of {
<Past, Anter> => p1 + s + t1 ++ s + p2 + run + t2;
<Fut, _> => p1 + s + t1 ++ p2 + run + t2;
_ => (p1 + s + p2 + t1 + run + t2)
}
};
{-
Note: The following is copied from the file swahili/ResSwa.gf
-}
--1 Swahili auxiliary operations.
-- This module contains operations that are needed to make the
-- resource syntax work. To define everything that is needed to
-- implement $Test$, it moreover contains regular lexical
-- patterns needed for $Lex$.
resource ResSwa = ParamX ** open Prelude in {
--For $Noun$
-- This is the worst-case $Case$ needed for pronouns.
param Case = Nom | Loc ;
param Animacy = AN | IN ;
param Gender = g1_2 | g3_4 | g5_6 | g5a_6 | g6 | g7_8 | g9_10 | g11 | g11_6 | g11_10 ;
--2 For $Adjective$
AForm = AF Number Gender Animacy
| AA ;
-- The order of sentence is needed already in $VP$.
Order = ODir | OQuest ;
--2 For $Verb$
-- Verbs will take one of the five forms
param
VForm = VInf
| VImper Number Person
| VPres Number Gender Animacy Person
| VPast Number Gender Animacy Person
| VFut Number Gender Animacy Person;
oper
Verb : Type = {s : VForm => Str} ;
VerbForms : Type = Tense => Anteriority => Polarity => Agr => Str ;
VP : Type = {
s : VerbForms ;
s2 : Agr => Str
} ;
mkV : Str -> {s : VForm => Str} =
\cheza -> {
s = table {
VInf => case Predef.take 2 cheza of {
"ku" => cheza;
_ => "ku"+cheza
};
VImper n p => case <n,p> of{
<Sg,P2> => init cheza + "eni";
<_,_> => cheza};
VPres n g anim p => Verbprefix n g anim p + "na" + cheza;
VPast n g anim p => Verbprefix n g anim p + "li" + cheza ;
VFut n g anim p => Verbprefix n g anim p + "ta" + cheza
}
} ;
predV : Verb -> VP = \verb -> {
s = \\t,ant,b,agr =>
let
inf = verb.s ! VInf ;
imper = verb.s ! VImper agr.n agr.p;
pres = verb.s ! VPres agr.n agr.g agr.anim agr.p ;
past = verb.s ! VPast agr.n agr.g agr.anim agr.p ;
fut = verb.s ! VFut agr.n agr.g agr.anim agr.p ;
in
case <t,ant,b> of {
<_,Anter,Pos> => imper;
<Pres,Simul,Pos> => pres ;
<Past,Anter,Pos> => past ;
<Fut, Anter,Pos> => fut ;
<_,_,_> => inf
};
s2 = \\_ => []
};
Verbprefix : Number -> Gender -> Animacy -> Person -> Str = \n,g,anim,p ->
case <anim,n,g,p> of {
<AN,Sg,_,P1> => "ni" ;
<AN,Sg,_,P2> => "u" ;
<AN,Pl,_,P1> => "tu" ;
<AN,Pl,_,P2> => "m" ;
<AN,Sg,_,_> => "a" ;
<AN,Pl,_,_> => "wa" ;
<_,Sg,g1_2,_> => "a" ;
<_,Pl,g1_2,_> => "wa" ;
<_,Sg,g3_4,_> => "u" ;
<_,Pl,g3_4,_> => "i" ;
<_,Sg,g5_6,_> => "li" ;
<_,Pl,g5_6,_> => "ya" ;
<_,Sg,g5a_6,_> => "li" ;
<_,Pl,g5a_6,_> => "ya" ;
<IN,_,g6,_> => "ya" ;
<IN,Sg,g7_8,_> => "ki" ;
<IN,Pl,g7_8,_> => "vi" ;
<IN,Sg,g9_10,_> => "i" ;
<IN,Pl,g9_10,_> => "zi" ;
<IN,_,g11,_> => "u" ;
<IN,Sg,g11_6,_> => "u" ;
<IN,Pl,g11_6,_> => "ya" ;
<IN,Sg,g11_10,_> => "u" ;
<IN,Pl,g11_10,_> => "zi"
} ;
-- Auxiliary verbs have special negative forms.
param
VVForm =
VVF VForm
| VVPresNeg
| VVPastNeg --# notpresent
;
--Adjectives
oper Adj = {s : AForm => Str} ;
--2 For $Quantifiers$
-- A 3-dimensional system of quantifiers (demonstrative pronouns) based on position of object, hearer + speaker
-- need to find linguistic term to express this
param Spatial = SpHrObj | SpHr | HrObj ; --w.r.t object
-- Agreement of adjectives, verb phrases, and relative pronouns.
oper
AGR = {n : Number ; g : Gender ; anim : Animacy ; p : Person} ;
Agr : Type = {n : Number ; g : Gender ; anim : Animacy ; p : Person} ;
agr : Number -> Gender -> Animacy -> Person -> Agr = \n,g,anim,p -> {n = n ; g = g ; anim = anim ; p = p} ;
-- For $Sentence$.
Clause : Type = {
s : Tense => Anteriority => Polarity => Str
} ;
mkClause : Str -> Agr -> VP -> Clause =
\subj,agr,vp -> {
s = \\t,a,b =>
let
verb = vp.s ! t ! a ! b ! agr
in
subj ++ verb
} ;
-}
}

View File

@@ -4,13 +4,85 @@ concrete SentenceCgg of Sentence = CatCgg **
open Prelude, ResCgg in { open Prelude, ResCgg in {
lin lin
PredVP np vp = {s=\\pol,tense,anter => np.s ++ vp.s!np.agr!pol!tense!anter};--formation of a clause. Error for always picking third person. change to general case
{-creating a sentence-} {-creating a sentence-}
UseCl temp pol cl = { --UseCl temp pol cl = {
s = temp.s ++ pol.s ++ cl.s !pol.p ! temp.t ! temp.a -- s = temp.s ++ pol.s ++ cl.s !pol.p ! temp.t ! temp.a
} ; -- } ;
--2 Sentences
--UseCl : Temp -> Pol -> Cl -> S ; -- she had not slept
UseCl temp pol cl = let
subj = cl.subj;
clitic = mkSubjClitic cl.subjAgr;
simul = cl.morphs ! Pres; --this is not delivering the string
ant = cl.morphs ! PastPart; --this is not delivering the string
root = cl.root;
presRestOfVerb = cl.morphs ! Pres ! RestOfVerb;
pastRestOfVerb = cl.morphs ! PastPart ! RestOfVerb;
compl = cl.compl
in
case <temp.isPres, pol.isTrue> of {
<True, True> => {s = subj ++ clitic ++ --Predef.BIND ++
root ++ Predef.BIND ++ presRestOfVerb ++ compl};
{-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-}
<True, False> => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ --Predef.BIND ++
root ++ presRestOfVerb ++ compl};
<False, True> => {s = subj ++ clitic ++ --Predef.BIND ++
ant!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
<False, False> =>{s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ --Predef.BIND ++
ant!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl}
}; --: Temp -> Pol -> QCl -> QS ; -- has John walked
UseQCl = UseCl; -- : Temp -> Pol -> Cl -> S ; -- John has not walked
QuestCl cl = cl; --: Cl -> QCl ; -- does John (not) walk
PredVP np vp = case vp.isCompApStem of{
False => {
subj = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk
subjAgr = np.agr;
root = vp.s;
morphs = vp.morphs;
{-
inf = mkVerbInrf vp.root;
pres = mkVerbPres vp.root;
past = mkVerbPast vp.root;
presPart = mkVerbPresPart vp.root;
pastPart = mkVerbPastPart vp.root; -- subject
-}
--root = vp.root ;
compl = vp.comp
};
True => {
subj = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk
subjAgr = np.agr;
root = vp.s;
morphs = vp.morphs;
{-
inf = mkVerbInrf vp.root;
pres = mkVerbPres vp.root;
past = mkVerbPast vp.root;
presPart = mkVerbPresPart vp.root;
pastPart = mkVerbPastPart vp.root; -- subject
-}
--root = vp.root ;
compl = mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp
}
};--: NP -> VP -> Cl ; -- John walks / John does not walk
{-
Note: It seems mkSubjClitic comes with a Predef.BIND already
prepared for the next token to bind.
Reason: When I add a BIND command, I get two bind tokens in the linearizations
-}
ImpVP vp = {
s =table{
True=> vp.s ++ Predef.BIND ++ vp.morphs!Inf!RestOfVerb ++ vp.comp;
False => case vp.isCompApStem of { -- How do I make the number dynamic use case?
True =>vp.morphs!Pres!SecNegM ++ Predef.BIND ++ vp.s ++ Predef.BIND ++
vp.morphs!Inf!RestOfVerb ++ (mkAdjPronNoIVClitic (AgMUBAP2 Sg)) ++ vp.comp;
False => vp.morphs!Pres!SecNegM ++ Predef.BIND ++ vp.s ++ Predef.BIND ++
vp.morphs!Inf!RestOfVerb ++ vp.comp
}
}
}; --: VP -> Imp ; -- walk / do not walk
{- {-
--1 Sentence: Sentences, Clauses, and Imperatives --1 Sentence: Sentences, Clauses, and Imperatives

View File

@@ -4,29 +4,120 @@ concrete StructuralCgg of Structural = CatCgg **
open ResCgg, ParadigmsCgg, (C = ConstructX), Prelude in { open ResCgg, ParadigmsCgg, (C = ConstructX), Prelude in {
lin lin
a_Det = {s =[] ; ntype = Complete; num = Sg; pos = PreDeterminer}; --: Det ; indefinite singular ---s
aPl_Det = {s =[]; ntype = Complete; num = Pl; pos = PreDeterminer}; -- : Det ;indefinite plural ---s
the_Det = {s =[]; ntype = Complete; num = Sg; pos = PreDeterminer}; --: Det ; -- definite singular ---s thePl_Det = {s =[]; ntype = Complete; num = Pl; pos = PreDeterminer}; --: Det ;definite plural ---s
every_Det = {s = "buri"; ntype=Incomplete; num=Sg; pos=PreDeterminer} ; every_Det = {s = "buri"; ntype=Incomplete; num=Sg; pos=PreDeterminer} ;
few_Det = {s="kye"; ntype =Complete; num=Pl; pos=PostDeterminer} ; few_Det = {s="kye"; ntype =Complete; num=Pl; pos=PostDeterminer} ;
many_Det ={s="ingi"; ntype =Complete; num=Pl; pos=PostDeterminer} ; many_Det ={s="ingi"; ntype =Complete; num=Pl; pos=PostDeterminer} ;
i_Pron = {s = table {Nom = "nyowe"; Acc = "nyowe"}; agr = AgMUBAP1 Sg}; i_Pron = mkPron "nyowe" "nyowe" (AgMUBAP1 Sg);
youSg_Pron {s = table {Nom = "iwe"; Acc = "we"}; agr=AgMUBAP2 Sg }; youSg_Pron = mkPron "iwe" "we" (AgMUBAP2 Sg);
she_Pron = {s = table {Nom = "uwe"; Acc = "uwe"}; agr=AgP3 Sg MU_BA}; he_Pron, she_Pron = mkPron "uwe" "uwe" (AgP3 Sg MU_BA);
he_Pron = {s= table {Nom = "uwe"; Acc = "uwe"}; agr=AgP3 Sg MU_BA}; we_Pron = mkPron "itwe" "itwe" (AgMUBAP1 Pl);
it_Pron = {s = table {Nom = "kyo"; Acc = "kyo"}; agr=AgP3 Sg KI_BI}; -- should form an it_Pron_NClass in extra module youPl_Pron = mkPron "imwe" "imwe" (AgMUBAP2 Pl);
we_Pron = {s = table {Nom = "itwe"; Acc = "itwe"}; agr = AgMUBAP1 Pl}; they_Pron = mkPron "bo" "bo" (AgP3 Pl MU_BA);
youPl_Pron ={s = table {Nom = "imwe"; Acc = "imwe"}; agr = AgMUBAP2 Pl}; it_Pron = mkPron "kyo" "kyo" (AgP3 Sg KI_BI); -- should form an it_Pron_NClass in extra module
they_Pron = {s= table {Nom = "bo"; Acc = "bo"}; agr=AgP3 Pl MU_BA};--But there are lots of other representations from other noun classes in extra module
behind_Prep ={s="enyuma ya"}; behind_Prep ={s="enyuma ya"};
between_Prep = {s="hagati ya"}; between_Prep = {s="hagati ya"};
to_Prep ={s="aha"}; to_Prep ={s="aha"};
in_Prep ={s="omu"}; -- several words depending on use omuri??
on_Prep ={s="aha"}; in_Prep = mkPrep "omu" "omuri";
--aha-ri Kamukuzi??? works for places
on_Prep = mkPrep "aha" "ahari";
--na --please this string varies with vowels use combine_morphemes or
--combine_words when using it.
with_Prep = mkPrep "na" [];
from_Prep ={s="kuruga"}; from_Prep ={s="kuruga"};
under_Prep = {s="hansi ya"}; under_Prep = {s="hansi ya"};
---Structural
{-
--there are several and i.e.
-- na (two nouns, 2 Noun Phrases, 2 Pronouns, 2 relative subject clauses, )
--kandi (clauses having a commonality of subjects, object or tense)
--the best structure is a table
--mkConjunction "na" "kandi" and_Conj ;
-}
and_Conj = {
s = table {
AConj Other => "kandi";
_ => "na"
};
s2 =[];
n = Pl
};
{-
TODO: Look at the grammar books by Mpairwe & Kahangi Pg 155
and investigate or to find out its arguments but for now
I will assume nari works on all types of
ConjArg (Conjunction Arguments)
nari is the general or
These are candidates for Extra module if they are not specific
to the type of argument.
nînga for Runynakore and
nainga for rukiga
-}
or_Conj = {
s = \\ _ => "nari";
s2 =[];
n = Sg
};
have_V2 ={s= "ine"; morphs = mkVerbMorphs; comp = []}; --: V2 ;
{-
All Predeterminers are given here.
Initial analysis shows that
a) They appear after the noun phrase but some may be multi-word expressions for a single word in eblish.
b) They appear to agree with the noun class particle. But nothing in the literature states about
their morphological structure. The stems can be guessed by removing the two letter
suffix at the begining of the word. However, there are exceptions such as "not" which is not
inflected according to noun class
c) A table of concords must be built to accomodate every instance and this can only be done
using an analysis of some of the words in the dictionary(Mapirwe and Kahagi).
I am incluned to say use of the table of self-standing pronouns is sufficient.
d) An investigation of the tone systems would also be worthwhile.
Example sentences:
1. All these chickens
2. once a day
3. only the man
-}
all_Predet = {s = "òna"; s2 = []; isMWE = False; isInflected =True};
only_Predet = {s = "nka"; s2 = []; isMWE = False; isInflected =True};
{-
-- how do we deal with superlatives. There seems to be no distinction between countable
-- and uncountable when it comes to superlatioves
-}
most_Predet = {s = "rikukíra"; s2 = "îngi"; isMWE = True; isInflected =True};
not_Predet = {s = "ti"; s2 = []; isMWE = False; isInflected =False};
{-Section for Adverbs-}
always_AdV = {s = "obutóòsha"; agr = AgrNo};
everywhere_Adv = {s = "hóòna"; agr = AgrNo}; -- adverb of place.
here_Adv = {s = "hanu"; agr = AgrNo};
{-End of Adverbs Adverbs-}
{-variants {-variants
NOTE: Please add them to the abstract syntax, ask aarne NOTE: Please add them to the abstract syntax, ask aarne
or creat you own abstract Lexicon which inherits from the or creat you own abstract Lexicon which inherits from the

View File

@@ -1,37 +1,48 @@
--# -path=.:../prelude:../abstract:../common --# -path=.:../prelude:../abstract:../common
concrete VerbCgg of Verb = CatCgg ** open ResCgg in { concrete VerbCgg of Verb = CatCgg ** open ResCgg, Prelude in {
lin lin
UseV verb = verb ; UseV v = {s = v.s ; morphs = v.morphs; comp =[]; isCompApStem = False; agr = AgrNo}; --: V -> VP; -- sleep --ignoring object agreement
-- UseComp : Comp -> VP ; -- be warm -- UseComp : Comp -> VP ; -- be warm means complement of a copula especially adjectival Phrase
--VerbPhrase: Type ={s:Agr=>Polarity=>Tense=>Anteriority=>Str}; --VerbPhrase: Type ={s:Agr=>Polarity=>Tense=>Anteriority=>Str};
UseComp comp = mkComp comp ; --its not generating any sentence --AdjectivalPhrase : Type = {s : Str ; post : Str; isPre : Bool; isProper : Bool; isPrep: Bool};
UseComp comp = {
s = comp.s; --Assuming there is no AP which is prepositional
morphs=\\form,morphs=>[] ;
comp = [] ;
isCompApStem = False;
agr = AgrNo}; --its not generating any sentence
-- CompAP : AP -> Comp ; -- (be) small -- CompAP : AP -> Comp; -- (be) small
CompAP ap = ap; CompAP ap = {s=ap.s};
-- CompNP : NP -> Comp ; -- (be) the man -- CompNP : NP -> Comp ; -- (be) the man
CompNP np = {s =\\agr=> CompNP np = {s= np.s ! Acc}; --{s =[] ; post =np.s; isPre = False; isProper = Bool; isPrep: Bool};
case np.agr of{
agr => np.s;
_ => []
}
};
-- CompAdv : Adv -> Comp ; -- (be) here -- CompAdv : Adv -> Comp ; -- (be) here
CompAdv adv =adv; CompAdv adv =adv;
-- SlashV2a : V2 -> VPSlash ; -- love (it) -- SlashV2a : V2 -> VPSlash ; -- love (it)
SlashV2a v2 = {s=v2.s; c=v2.c}; SlashV2a v2 ={
s =v2.s;
morphs = v2.morphs;
comp = []
};
-- ComplSlash : VPSlash -> NP -> VP ; -- love it -- ComplSlash : VPSlash -> NP -> VP ; -- love it
ComplSlash vpslash np ={
s =vpslash.s;
morphs = vpslash.morphs;
comp = vpslash.comp ++ np.s ! Acc;
isCompApStem = False;
agr = AgrYes np.agr
};
-- AdvVP : VP -> Adv -> VP ; -- sleep here -- AdvVP : VP -> Adv -> VP ; -- sleep here
-- VerbPhrase: Type ={s:Agr=>Polarity=>Tense=>Anteriority=>Str}; -- VerbPhrase: Type = {s:Str; morphs: VMorphs ; comp:Str ; isCompApStem : Bool; agr : AgrExist};
AdvVP vp adv ={s=\\agr,pol,tense,anter=>vp.s!agr!pol!tense!anter ++ adv.s!agr}; AdvVP vp adv ={s=vp.s; morphs = vp.morphs; comp = adv.s; isCompApStem = False; agr = AgrNo};
{- {-
--1 The construction of verb phrases --1 The construction of verb phrases