From 7c997ea280b935f0bc7d4bae656e6386e8e1ad37 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 12 Oct 2020 17:31:40 +0300 Subject: [PATCH 01/18] 1. Created Linearization types for V2V as Res.Verb ** {comp,c3 : Str ; typ : Res.VVType} ; but however I have eerors with mkV2 overload methods and lock_C fields. I cannot seem to find out the reason for the error. --- src/prelude/Coordination.gf | 10 +- src/rukiga/CatCgg.gf | 2 +- src/rukiga/LexiconCgg.gf | 526 +++++++++++++++++------------------- src/rukiga/ParadigmsCgg.gf | 103 ++++--- src/rukiga/ResCgg.gf | 167 +++++++----- 5 files changed, 408 insertions(+), 400 deletions(-) diff --git a/src/prelude/Coordination.gf b/src/prelude/Coordination.gf index 33d7b805..53d664f6 100644 --- a/src/prelude/Coordination.gf +++ b/src/prelude/Coordination.gf @@ -6,14 +6,14 @@ param oper ListX = {s1,s2 : Str} ; - twoStr : (x,y : Str) -> ListX = \x,y -> + twoStr : (x,y : Str) -> ListX = \x,y -> --stores two strings in a record {s1 = x ; s2 = y} ; - consStr : Str -> ListX -> Str -> ListX = \comma,xs,x -> + consStr : Str -> ListX -> Str -> ListX = \comma,xs,x -> {s1 = xs.s1 ++ comma ++ xs.s2 ; s2 = x } ; - twoSS : (_,_ : SS) -> ListX = \x,y -> + twoSS : (_,_ : SS) -> ListX = \x,y -> --stores two string records into one record twoStr x.s y.s ; - consSS : Str -> ListX -> SS -> ListX = \comma,xs,x -> + consSS : Str -> ListX -> SS -> ListX = \comma,xs,x -> -- Combines and a record into a record separated by a comma. consStr comma xs x.s ; Conjunction : Type = SS ; @@ -33,7 +33,7 @@ oper -- all this lifted to tables - ListTable : PType -> Type = \P -> {s1,s2 : P => Str} ; + ListTable : PType -> Type = \P -> {s1,s2 : P => Str} ; --Type family for tables twoTable : (P : PType) -> (_,_ : {s : P => Str}) -> ListTable P = \_,x,y -> {s1 = x.s ; s2 = y.s} ; diff --git a/src/rukiga/CatCgg.gf b/src/rukiga/CatCgg.gf index 4022333e..b6f540a1 100755 --- a/src/rukiga/CatCgg.gf +++ b/src/rukiga/CatCgg.gf @@ -34,7 +34,7 @@ lincat V,VS, VQ, VA = Res.Verb ; --change to {verb : Str ; comp = []} -- one-place verb e.g. "sleep" V2,V2Q, V2S = Res.Verb2; V2A,V3 = Res.Verb3; -- three-place verb e.g. "show" - + V2V = Res.Verb ** {comp,c3 : Str ; typ : Res.VVType} ; VP = Res.VerbPhrase ; -- verb phrase e.g. "is very warm" N = Res.Noun ; -- common noun e.g. "house" diff --git a/src/rukiga/LexiconCgg.gf b/src/rukiga/LexiconCgg.gf index 1baa3e48..f7ecb8d7 100755 --- a/src/rukiga/LexiconCgg.gf +++ b/src/rukiga/LexiconCgg.gf @@ -24,7 +24,7 @@ lin 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 ; + person_N = mkN "omuntu" MU_BA ; eye_N = mkN "eriisho" RI_MA; fire_N = mkN "omuriro" MU_MI ; fish_N = mkN "eky'ényanja" KI_BI ; @@ -68,7 +68,6 @@ lin --Adjectives bad_A = mkAdjective "bi" Post False False; --False means the adjective is a stem and comes after the complete noun - --beautiful_A = mkAdjective "rungi" False; big_A = mkAdjective "hango" Post False False; black_A = mkAdjective "kwirangura" Post False False; blue_A = mkAdjective "buuru" Post True True ; @@ -158,298 +157,257 @@ lin distance_N3 = mkN3 (mkN "orugyendo" ZERO_BU) (lin Prep (mkPrep "kurunga" "" False)) (lin Prep (mkPrep "mpáka" "" False)); --could orugyendo work in its place? alas_Interj ={s="ryakareeba"; }; --: Interj ; - - --- New Lexicon switch8off_V2 = mkV2 "raza" "za" "riize"; television_N = mkN "TV" N_N; doctor_N = mkN "omushaho" MU_BA; clever_A =mkAdjective "amagyezi" Post False True; laugh_V = mkV "sheka"; - + beautiful_A = mkAdjective "rungi" Post False False; airplane_N = mkN "endegye" N_N; -{-- - answer_V2S - apartment_N - art_N - ashes_N - ask_V2Q - back_N - bank_N - bark_N - beautiful_A - beg_V2V - belly_N - blow_V - bone_N - boot_N - boss_N - breast_N - breathe_V - broad_A - brother_N2 - brown_A - burn_V - butter_N - camera_N - cap_N - carpet_N - ceiling_N - cheese_N - church_N - coat_N - country_N - cousin_N - day_N - dig_V - dirty_A - doctor_N - door_N - dry_A - dull_A - dust_N - ear_N - earth_N - easy_A2V - egg_N - empty_A - enemy_N - factory_N - fall_V - far_Adv - fat_N - feather_N - fight_V2 - fingernail_N - float_V - floor_N - flow_V - fly_V - fog_N - foot_N - forest_N - forget_V2 - freeze_V - fridge_N - fruit_N - full_A - fun_AV - garden_N - glove_N - gold_N - grass_N - guts_N - hair_N - hand_N - harbour_N - hat_N - hate_V2 - head_N - hear_V2 - heart_N - hill_N - hit_V2 - hold_V2 - horn_N - hunt_V2 - husband_N - ice_N - important_A - industry_N - iron_N - king_N - knee_N - know_V2 - lake_N - lamp_N - leaf_N - learn_V2 - leather_N - leave_V2 - left_Ord - leg_N - lie_V - like_V2 - listen_V2 - liver_N - long_A - lose_V2 - louse_N - love_N - married_A2 - moon_N - mother_N2 - mountain_N - mouth_N - name_N - narrow_A - near_A - neck_N - newspaper_N - night_N - nose_N - number_N - oil_N - open_V2 - paint_V2A - paper_N - peace_N - pen_N - person_N - planet_N - plastic_N - play_V2 - policeman_N - priest_N - probable_AS - pull_V2 - push_V2 - put_V2 - queen_N - question_N - radio_N - rain_N - rain_V0 - religion_N - restaurant_N - right_Ord - road_N - rock_N - roof_N - root_N - rope_N - rotten_A - round_A - rub_V2 - rubber_N - salt_N - sand_N - school_N - science_N - scratch_V2 - seed_N - seek_V2 - sew_V - sharp_A - shirt_N - shoe_N - shop_N - short_A - silver_N - sing_V - sister_N - sit_V - skin_N - sky_N - smell_V - smoke_N - smooth_A - snake_N - snow_N - sock_N - song_N - speak_V2 - spit_V - split_V2 - squeeze_V2 - stab_V2 - stand_V - steel_N - stick_N - stone_N - stop_V - stove_N - straight_A - student_N - stupid_A - suck_V2 - sun_N - swell_V - switch8on_V2 - table_N - tail_N - teacher_N - thick_A - think_V - throw_V2 - tie_V2 - tongue_N - tooth_N - turn_V - ugly_A - uncertain_A - university_N - village_N - vomit_V - war_N - wash_V2 - watch_V2 - wet_A - wide_A - wife_N - win_V2 - wind_N - window_N - wing_N - wipe_V2 - wonder_VQ - wood_N - worm_N - write_V2 - ---} -year_N = mkN "omwaka" "emyaka" MU_MI; + year_N = mkN "omwaka" "emyaka" MU_MI; + +-- New Lexicon + {- + Perhaps create an adverb form whose + surface realisation comes from verb tense e.g nagyenzire implies I have alredy gone. + -} + already_Adv = mkAdv "" AgrNo; -- Already is realized as a verb form + answer_V2S = mkV2S (mkV "garu" "kamu" "kiremu") noPrep; + apartment_N = mkN "apatimenti" "apatimenti" N_N; + art_N = mkN "aati" "aati" N_N; + ashes_N = mkN "eiju" "eiju" N_N; + ask_V2Q = mkV2Q (mkV2 "bunza" "za" "rize") noPrep; + back_N = mkN "omugongo" MU_MI; + bank_N = mkN "banka" "banka" N_N; + bark_N = mkN "ask for the Rukiga equivalent of bark" N_N; --TODO find actual word + beg_V2V = mkV2V (mkV "shab" "a" "ire") noPrep toP ; + belly_N = mkN "eibondo" "amabondo" I_MA ; + blow_V = mkV "hag" "a" "ire" ; + bone_N = mkN "eigufa" "amagufa" I_MA ; + boot_N = mkN "buuntu" "buuntu" N_N ; + boss_N = mkN "mukama" "bakama" MU_BA ; + breast_N = mkN "eibere" "amabere" I_MA ; + breathe_V = mkV "is" "a" "ire"; + broad_A = mkAdjective "TODO : Ask for the right word" Post False False; + --Note: younger brother. mukuru and others + brother_N2 = mkN2 (mkN "murumuna" "barumuna" MU_BA) (mkPrep "" "" True) ; + newspaper_N = mkN "eihurire" I_MA; + night_N = mkN "ekiro" N_ZERO; + nose_N = mkN "enyindo" N_N; + --number_N = mkN "enamba" N_N -- TODO look out for the correct word + oil_N = mkN "amajuta" N_N; + open_V2 = mkV2 "yingura" "ura" "wire"; + -- brown_A + -- burn_V + -- butter_N + -- camera_N + -- cap_N + -- carpet_N + -- ceiling_N + -- cheese_N + -- church_N + -- coat_N + -- country_N + -- cousin_N + -- day_N + -- dig_V + -- dirty_A + -- door_N + -- dry_A + -- dull_A + -- dust_N + -- ear_N + -- earth_N + -- easy_A2V + -- egg_N + -- empty_A + -- enemy_N + -- factory_N + -- fall_V + -- far_Adv + -- fat_N + -- feather_N + -- fight_V2 + -- fingernail_N + -- float_V + -- floor_N + -- flow_V + -- fly_V + -- fog_N + -- foot_N + -- forest_N + -- forget_V2 + -- freeze_V + -- fridge_N + -- fruit_N + -- full_A + -- fun_AV + -- garden_N + -- glove_N + -- gold_N + -- grass_N + -- guts_N + -- hair_N + -- hand_N + -- harbour_N + -- hate_V2 + -- head_N + -- hear_V2 + -- heart_N + -- hill_N + -- hit_V2 + -- hold_V2 + -- horn_N + -- hunt_V2 + -- husband_N + -- ice_N + -- important_A + -- industry_N + -- iron_N + -- king_N + -- knee_N + -- know_V2 + -- lake_N + -- lamp_N + -- leaf_N + -- learn_V2 + -- leather_N + -- leave_V2 + -- left_Ord + -- leg_N + -- lie_V + -- like_V2 + -- listen_V2 + -- liver_N + -- long_A + -- lose_V2 + -- louse_N + -- love_N + -- married_A2 + -- moon_N + -- mother_N2 + -- mountain_N + -- mouth_N + -- name_N + -- narrow_A + -- near_A + -- neck_N + -- paint_V2A + -- paper_N + -- peace_N + -- pen_N + -- planet_N + -- plastic_N + -- play_V2 + -- policeman_N + -- priest_N + -- probable_AS + -- pull_V2 + -- push_V2 + -- put_V2 + -- queen_N + -- question_N + -- radio_N + -- rain_N + -- rain_V0 + -- religion_N + -- restaurant_N + -- right_Ord + -- road_N + -- rock_N + -- roof_N + -- root_N + -- rope_N + -- rotten_A + -- round_A + -- rub_V2 + -- rubber_N + -- salt_N + -- sand_N + -- school_N + -- science_N + -- scratch_V2 + -- seed_N + -- seek_V2 + -- sew_V + -- sharp_A + -- shirt_N + -- shoe_N + -- shop_N + -- short_A + -- silver_N + -- sing_V + -- sister_N + -- sit_V + -- skin_N + -- sky_N + -- smell_V + -- smoke_N + -- smooth_A + -- snake_N + -- snow_N + -- sock_N + -- song_N + -- speak_V2 + -- spit_V + -- split_V2 + -- squeeze_V2 + -- stab_V2 + -- stand_V + -- steel_N + -- stick_N + -- stone_N + -- stop_V + -- stove_N + -- straight_A + -- student_N + -- stupid_A + -- suck_V2 + -- sun_N + -- swell_V + -- switch8on_V2 + -- table_N + -- tail_N + -- teacher_N + -- thick_A + -- think_V + -- throw_V2 + -- tie_V2 + -- tongue_N + -- tooth_N + -- turn_V + -- ugly_A + -- uncertain_A + -- university_N + -- village_N + -- vomit_V + -- war_N + -- wash_V2 + -- watch_V2 + -- wet_A + -- wide_A + -- wife_N + -- win_V2 + -- wind_N + -- window_N + -- wing_N + -- wipe_V2 + -- wonder_VQ + -- wood_N + -- worm_N + -- write_V2 + + + -- End of New Lexicon oper - aboutP = mkPrep "about" ; - atP = mkPrep "at" ; - forP = mkPrep "for" ; + aboutP = mkPrep "TODO : find rukiga equivalent of about" "" False ; + atP = mkPrep "TODO : find rukiga equivalent of at" "" False ; + forP = mkPrep "TODO : find rukiga equivalent of for" "" False; fromP = mkPrep "kurunga" "" False; inP = mkPrep "omu" "omuri" False; onP = mkPrep "aha" "ahari" False; - toP = mkPrep "aha" [] False; - - - - - {- - --Old LexiconCgg.gf - burn_V = mkV "sya" ; - die_V = mkV "fa" ; - fly_V = mkV "guruka" ; - run_V = mkV "iruka" ; - sleep_V = mkV "byama" ; - walk_V = mkV "tabula" ; - - 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 ; - car_N = mkN "emootoka" N_N ; - chair_N = mkN "entebbe" N_N; - cloud_N = mkN "ekikyu" KI_BI ; - person_N = mkN "omuntu" "abantu" MU_BA ; - girl_N = mkN "omwishiki" MU_BA ; - shoe_N = mkN "ekaito" N_N ; - table_N = mkN "emeza" N_N ; - bad_A = mkAdjective "bi" False; --False means the adjective is a stem and comes after the complet noun - beautiful_A = mkAdjective "rungi" False; - far_Adv = mkAdv "hare"; - now_Adv = mkAdv "hati"; - today_Adv = mkAdv "erizooba"; - bite_V2 = mkV2 "ruma"; - break_V2 = mkV2 "henda"; - buy_V2 = mkV2 "gura"; - close_V2 = mkV2 "kinga"; - count_V2 = mkV2 "bara"; - cut_V2 = mkV2 "shara"; - do_V2 = mkV2 "kora"; - drink_V2 = mkV2 "nywa"; - eat_V2 = mkV2 "rya"; - fear_V2 = mkV2 "tiina"; - --------------------------Differences Rukiga only-------------------- -airplane_N : mkN "endegye" N_N; --} + toP = mkPrep ("ku" ++ Predef.BIND) [] False; + --noPrep = mkPrep [] [] False; } diff --git a/src/rukiga/ParadigmsCgg.gf b/src/rukiga/ParadigmsCgg.gf index 3480876c..af05ac5d 100755 --- a/src/rukiga/ParadigmsCgg.gf +++ b/src/rukiga/ParadigmsCgg.gf @@ -27,12 +27,14 @@ oper mkV : Str -> Verb = \root -> lin V (smartVerb root); --{s =root; pres =[]; perf = []; morphs= mkVerbMorphs; isRegular = True}; --only those verbs whose conjugation involves change of last letter and are done in the same way in both runyankore and rukiga mkV : Str -> Str ->Str -> Verb - = \root, restPres, restPerf ->lin V (mkVerb root restPres restPerf); --{s =root; pres =restPres; perf = restPerf; morphs= mkVerbMorphs; isRegular = False}; + = \root, restPres, restPerf ->lin V (mkVerb root restPres restPerf); + mkV : Str -> Str ->Str ->Str -> Bool -> Verb + = \root, restPres, restPerf, p, bool ->lin V (mkVerbV2X root restPres restPerf p bool); }; mkV2 = overload { - mkV2 : Str -> Verb2 = \root ->mkV root ** {comp =[]}; - mkV2 : Str -> Str ->Str -> Verb2 = \root, s1, s2 ->mkV root s1 s2 ** {comp =[]}; + mkV2 : Str -> V2 = \root ->dirV2 (smartVerb root); --** {comp =[] ; isCompN2 = False}; + mkV2 : Str -> Str ->Str -> V2 = \root, s1, s2 ->dirV2 (mkVerb root s1 s2); --** {comp =[] ; isCompN2 = False}; }; mkV3 = overload { mkV3 : Str -> Verb3 = \root ->mkV2 root ** {comp2 =[]}; @@ -44,36 +46,37 @@ oper --3 Relational nouns mkN2 : overload { - mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --% - mkN2 : N -> N2 ; -- e.g. wife of (default prep. to) - mkN2 : N -> Str -> N2 ; -- access to --% + --mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --% + --mkN2 : N -> N2 ; -- e.g. wife of (default prep. to) + --mkN2 : N -> Str -> N2 ; -- access to --% mkN2 : N -> Prep -> N2 ; -- e.g. access to - mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --% + --mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --% } ; - --3 Relational nouns - - mkN2 : overload { - mkN2 : Str -> N2; -- reg. noun, prep. "of" --% - mkN2 : N -> N2 ; -- e.g. wife of (default prep. to) - mkN2 : N -> Str -> N2 ; -- access to --% - mkN2 : N -> Prep -> N2 ; -- e.g. access to - mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --% + mkN2 = overload { + mkN2 : N -> Prep -> N2 = prepN2 ; + --mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPrep s); + --mkN2 : Str -> Str -> N2 = \n,s -> prepN2 (regN n) (mkPrep s); + --mkN2 : N -> N2 = \n -> prepN2 n (mkPrep "of") ; + --mkN2 : Str -> N2 = \s -> prepN2 (regN s) (mkPrep "of") } ; - mkN2 : N -> Prep -> N2 ; - mkN2 : N -> Prep -> N2 = \n,p -> case p.isGenPrep of{ + -- mkN2 : N -> Prep -> N2 = \n,p -> case p.isGenPrep of{ + -- False => lin N2 (n ** {c2 =\\_=> p.s}) ; + -- True => lin N2 (n ** {c2 = mkGenPrepWithIV }) --avoiding lock_C fields + -- }; + prepN2 : N -> Prep -> N2 = \n,p -> case p.isGenPrep of{ False => lin N2 (n ** {c2 =\\_=> p.s}) ; - True => lin N2 (n ** {c2 = mkGenPrepWithIVClitic}) --avoiding lock_C fields + True => lin N2 (n ** {c2 = mkGenPrepWithIV }) --avoiding lock_C fields }; -- Three-place relational nouns ("the connection from x to y") need two prepositions. mkN3 : N -> Prep -> Prep -> N3 ; -- e.g. connection from x to y mkN3 = \n,p,q -> case of{ => lin N3 ( lin N2 (n ** {c2 =\\_=> p.s}) ** {c3 =\\_=> q.s}); --method of avoiding lock_C fields - => n ** {c2 = mkGenPrepWithIVClitic ; c3 =\\_=> q.s; lock_N2 = <>;lock_N3 = <>} ; - => n ** {c2 =\\_=> p.s ; c3 = mkGenPrepWithIVClitic; lock_N2 = <>;lock_N3 = <>} ; - => n ** {c2 = mkGenPrepWithIVClitic; c3 = mkGenPrepWithIVClitic; lock_N2 = <>; lock_N3 = <>} + => n ** {c2 = mkGenPrepWithIV ; c3 =\\_=> q.s; lock_N2 = <>;lock_N3 = <>} ; + => n ** {c2 =\\_=> p.s ; c3 = mkGenPrepWithIV; lock_N2 = <>;lock_N3 = <>} ; + => n ** {c2 = mkGenPrepWithIV; c3 = mkGenPrepWithIV; lock_N2 = <>; lock_N3 = <>} }; mkVS : V -> VS ; -- sentence-compl e.g. say (that S) @@ -84,27 +87,51 @@ oper mkVA : V -> VA ; -- e.g. become (AP) mkVA v = lin VA v ; - {- - prepV2 v p = lin V2 {s = v.s ; p = v.p ; c2 = p.s ; isRefl = v.isRefl} ; - dirV2 v = prepV2 v noPrep ; - - --2 Prepositions --- --- A preposition as used for rection in the lexicon, as well as to --- build $PP$s in the resource API, just requires a string. - mkPrep : Str -> Prep ; -- e.g. "in front of" - --mkPost : Str -> Prep ; -- e.g. "ago" - noPrep : Prepostion; -- no preposition - noPrep = mkPrep [] ; - -} - {- - --V2V verbs + mkV2S : V -> Prep -> V2S ; -- e.g. tell (NP) (that S) + mkV2S v p = lin V2S (prepV2 v p) ; + --mkPrep : Str -> Str ->Bool -> Preposition ; -- e.g. "in front of" + mkPrep : Str -> Str ->Bool -> Preposition; + mkPrep first other bool = lin Prep { + s = first ; + other = other; + isGenPrep = bool + }; + prepV2 : V -> Prep -> V2 ; + prepV2 v p = lin V2 {s = v.s ; + pres = v.pres ; + perf = v.perf ; + isPresBlank = v.isPresBlank ; + isPerfBlank = v.isPerfBlank; + isRegular = v.isRegular; + p = v.p ; + isRefl = v.isRefl; + comp = p.s; + isCompN2 = p.isGenPrep}; --; isRefl = v.isRefl} ; + dirV2 : V -> V2 = \v -> prepV2 v noPrep ; + noPrep = mkPrep [] [] False; + --2 Prepositions + -- + -- A preposition as used for rection in the lexicon, as well as to + -- build $PP$s in the resource API, just requires a string. + + -- mkPrep : Str -> Str ->Bool -> Prep ; -- e.g. "in front of" + -- noPrep : Prep; -- no preposition + -- noPrep = mkPrep [] [] False; + + --mkVQ : V -> VQ ; -- e.g. wonder (QS) + mkV2Q : V -> Prep -> V2Q ; -- e.g. ask (NP) (QS) + mkV2Q v p = lin V2Q (prepV2 v p) ; + + --V2V verbs mkV2V = overload { - mkV2V : Str -> V2V = \s -> lin V2V (dirV2 (regV s) ** {c3 = [] ; typ = VVAux}) ; + -- mkV2V : Str -> V2V = \s -> lin V2V (dirV2 (mkV s) ** {c3 = [] ; typ = VVAux}) ; mkV2V : V -> V2V = \v -> lin V2V (dirV2 v ** {c3 = [] ; typ = VVAux}) ; mkV2V : V -> Prep -> Prep -> V2V = \v,p,t -> lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVAux}) ; - } ; + } ; + + {- + mkV2V : overload { diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index 1c09e640..6efcffbe 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -40,6 +40,8 @@ param ImpPol = ImpPos | ImpNeg; INumber = ISg | IPl | INeut; + -- copied from the English Resource Grammar + VVType = VVAux | VVInf | VVPresPart ; -- can do / try to do / start doing {- --there are several and i.e. -- na (two nouns, 2 Noun Phrases, 2 Pronouns, 2 relative subject clauses, ) @@ -54,7 +56,7 @@ param AgrExist = AgrNo | AgrYes Agreement; --Position = PostDeterminer | PreDeterminer ; Position = Post | Pre; - Variants = V1|V2; + --Variants = V1|V2; --Functional forms of the regular verb Mood = Infinitive | Imperative | Subjunctive | Perfective; VerbCat = Simple | Prepositional | Causative; @@ -115,7 +117,22 @@ oper isPerfBlank = False; --morphs = mkVerbMorphs; isRegular = False; + p = []; + isRefl = False }; + -- creates a verb of type that has particles (prepositions or + --adverbials. this is for phrasal verbs) + mkVerbV2X : Str ->Str ->Str ->Str -> Bool->Verb = \rad, end1,end2, p, bool ->{ + s = rad; + pres = end1; + perf = end2; + isPresBlank = False; + isPerfBlank = False; + --morphs = mkVerbMorphs; + isRegular = False; + p = p; + isRefl = bool + }; --These are regular verbs with {a-ire} entry in the dictionary smartVerb : Str ->Verb = \rad ->{ s = rad; @@ -125,6 +142,8 @@ oper isPresBlank = False; isPerfBlank = False; isRegular = True; + p = []; + isRefl = False }; {- Smart paradigm @@ -915,69 +934,69 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { _ => mkClitic "XX" -- error checking for any case not catered for }; - -- Genetive Preposition: simple "of" without Initila vowel - mkGenPrepNoIVClitic : Agreement -> Str = \a -> case a of { - AgMUBAP1 n => mkClitics "wa" "ba" n; - --AgMUBAP1 Pl => "aba" ; - AgMUBAP2 n => mkClitics "wa" "ba" n; --probably an error check your grammar book - --AgMUBAP2 Pl => "aba" ; - AgP3 n MU_BA => mkClitics "wa" "ba" n; - --AgP3 Pl MU_BA => "aba" ; - AgP3 Pl ZERO_BU => mkClitic "bwa" ; - AgP3 Sg BU_MA => mkClitic "bwa" ; - AgP3 Pl (KA_BU | RU_BU) => mkClitic "bwa" ; - AgP3 Pl (KI_BI | ZERO_BI) => mkClitic "bya" ; - AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => mkClitic "ga"; - AgP3 (Sg | Pl) HA => mkClitic "ha" ; -- of place HA - AgP3 (Sg | Pl) MU => mkClitic "mwa" ; -- of place MU - AgP3 (Sg | Pl) KU => mkClitic "ya" ; -- of place KU - AgP3 Sg (I_ZERO | I_MA | RI_MA) =>mkClitic "rya" ; - AgP3 Sg (KA_ZERO | KA_BU) =>mkClitic "ka" ; - AgP3 Sg KI_BI => mkClitic "kya" ; - AgP3 Sg (KU_ZERO | KU_MA) => mkClitic "kwa" ; - AgP3 Sg (MU_MI | MU_ZERO) => mkClitic "gwa" ; - AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => mkClitic "rwa" ; - AgP3 Pl (ZERO_TU | KA_TU) =>mkClitic "twa" ; - AgP3 Sg (ZERO_ZERO | N_N) =>mkClitic "ya" ; - AgP3 Pl ZERO_MI =>mkClitic "ya" ; - AgP3 Pl MU_MI => mkClitic "emi"; - AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) =>mkClitic "za" ; - AgP3 Sg GU_GA => mkClitic "gwa" ; - AgP3 Pl GU_GA => mkClitic "ga" ; - _ => mkClitic "Error mkGenPrepNoIVClitic" -- error checking for any case not catered for + -- Genetive Preposition: simple "of" without Initila vowel. It does not combine + mkGenPrepNoIV : Agreement -> Str = \a -> case a of { + AgMUBAP1 Sg => "wa"; + AgMUBAP1 Pl => "ba" ; + AgMUBAP2 Sg => "wa" ; --probably an error check your grammar book + 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 => "emi"; + AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "za" ; + AgP3 Sg GU_GA => "gwa" ; + AgP3 Pl GU_GA => "ga" ; + _ => Predef.error "Error mkGenPrepNoIV" -- error checking for any case not catered for }; -- Genetive Preposition: simple "of" with Initil vowel - mkGenPrepWithIVClitic : Agreement => Str = table { - AgMUBAP1 n => mkClitics "owa" "aba" n; - --AgMUBAP1 Pl => "aba" ; - AgMUBAP2 n => mkClitics "owa" "aba" n; --probably an error check your grammar book - --AgMUBAP2 Pl => "aba" ; - AgP3 n MU_BA => mkClitics "owa" "aba" n; - --AgP3 Pl MU_BA => "aba" ; - AgP3 Pl ZERO_BU => mkClitic "obwa" ; - AgP3 Sg BU_MA => mkClitic "obwa" ; - AgP3 Pl (KA_BU | RU_BU) => mkClitic "obwa" ; - AgP3 Pl (KI_BI | ZERO_BI) => mkClitic "ebya" ; - AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => mkClitic "aga"; - AgP3 (Sg | Pl) HA => mkClitic "aha" ; -- of place HA - AgP3 (Sg | Pl) MU => mkClitic "amwa" ; -- of place MU - AgP3 (Sg | Pl) KU => mkClitic "aya" ; -- of place KU - AgP3 Sg (I_ZERO | I_MA | RI_MA) =>mkClitic "arya" ; - AgP3 Sg (KA_ZERO | KA_BU) =>mkClitic "aka" ; - AgP3 Sg KI_BI => mkClitic "ekya" ; - AgP3 Sg (KU_ZERO | KU_MA) => mkClitic "okwa" ; - AgP3 Sg (MU_MI | MU_ZERO) => mkClitic "ogwa" ; - AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => mkClitic "orwa" ; - AgP3 Pl (ZERO_TU | KA_TU) =>mkClitic "otwa" ; - AgP3 Sg (ZERO_ZERO | N_N) =>mkClitic "eya" ; - AgP3 Pl ZERO_MI =>mkClitic "eya" ; - AgP3 Pl MU_MI => mkClitic "emi"; - AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) =>mkClitic "eza" ; - AgP3 Sg GU_GA => mkClitic "ogwa" ; - AgP3 Pl GU_GA => mkClitic "aga" ; - _ => mkClitic "Error mkGenPrepWithIVClitic" -- error checking for any case not catered for + mkGenPrepWithIV : Agreement => Str = table { + AgMUBAP1 Sg => "owa" ; + AgMUBAP1 Pl => "aba" ; + AgMUBAP2 Sg => "owa" ; --probably an error check your grammar book + 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 => "amwa" ; -- of place MU + AgP3 (Sg | Pl) KU => "aya" ; -- of place KU + AgP3 Sg (I_ZERO | I_MA | RI_MA) => "arya" ; + 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 => "emi"; + AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "eza" ; + AgP3 Sg GU_GA => "ogwa" ; + AgP3 Pl GU_GA => "aga" ; + _ => Predef.error "Error in mkGenPrepWithIVClitic : no pattern matched" -- error checking for any case not catered for }; @@ -1253,13 +1272,11 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { -- Structural -- prepositions sometimes have two kinds, near or far i.e omu or omuri - -- ho - Preposition = {s,other : Str; isGenPrep : Bool}; - mkPrep : Str -> Str ->Bool -> Preposition = \ first, other, isGenPrep -> { - s = first ; - other = other; - isGenPrep = isGenPrep - }; + -- We ignore the distal dexis to be entered as a separate lemma + -- Instead str for positional arguments 1 & 2 cater for prepositions that inflect with Number + -- while str for positional argument 3 caters for those that do not inflect with Number + Preposition : Type = {s : Str; other : Str; isGenPrep : Bool}; + NounPhrase : Type = {s :Case => Str; agr : Agreement}; {- Operation to create Noun Phrases from a Determiner and Nouns. @@ -1308,7 +1325,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { --morphs: VFormMini => VerbMorphPos=> Str; isPresBlank : Bool; isPerfBlank : Bool; - isRegular:Bool + isRegular: Bool; + p : Str; -- some verbs have particles such as prepositions and adverbial that give the verb a meaning different from what would be automatically deduced + isRefl : Bool }; GVerb : Type = { @@ -1327,7 +1346,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { Because of the fusion, I have deffered including this in the compPrep. Actually, it is going to be empty in the next version -} - Verb2 : Type = Verb ** {comp:Str}; + Verb2 : Type = Verb ** {comp: Str; isCompN2: Bool}; Verb3 : Type = Verb2 ** {comp2 : Str} ; {- Given a root, can you form the different verbforms? @@ -1385,7 +1404,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { --morphs= mkVerbMorphs; isPresBlank = True; isPerfBlank = True; - isRegular=False + isRegular=False; + p = []; + isRefl = False }; mkBecome : Verb ={ s = "b" ; @@ -1394,7 +1415,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { isPresBlank = False; isPerfBlank = False; --morphs= mkVerbMorphs; - isRegular=False + isRegular=False; + p = []; + isRefl = False }; @@ -1538,7 +1561,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { glue: Str -> Str ->Str =\ x, y -> x ++ BIND ++ y; --Concatenates two strings for the genetive case - glueGen: Agreement ->Str = \ a -> mkGenPrepNoIVClitic a ++ BIND ++ mkGenAdjSuffix a; + glueGen: Agreement ->Str = \ a -> mkGenPrepNoIV a ++ BIND ++ mkGenAdjSuffix a; --Number determining element Numer : Type = { s: Agreement => Str ; n : Number; numeralExists:Bool}; From 5dc5433068cf6d31a5f844cea058960269f41019 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 12 Oct 2020 23:18:27 +0300 Subject: [PATCH 02/18] Made sutitable changes that were wanrranted due to changes in linearization types for Verbs to include information about particles and checks on source of complements i.e. Verb : Type = { s : Str; pres:Str; perf:Str; --morphs: VFormMini => VerbMorphPos=> Str; isPresBlank : Bool; isPerfBlank : Bool; isRegular: Bool }; changed to: Verb : Type = { s : Str; pres:Str; perf:Str; --morphs: VFormMini => VerbMorphPos=> Str; isPresBlank : Bool; isPerfBlank : Bool; isRegular: Bool; p : Str; -- some verbs have particles such as prepositions and adverbial that give the verb a meaning different from what would be automatically deduced isRefl : Bool }; --- src/rukiga/LexiconCgg.gf | 4 ++-- src/rukiga/NounCgg.gf | 6 +++--- src/rukiga/NumeralCgg.gf | 2 +- src/rukiga/ResCgg.gf | 4 ++-- src/rukiga/StructuralCgg.gf | 13 ++++++++----- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/rukiga/LexiconCgg.gf b/src/rukiga/LexiconCgg.gf index f7ecb8d7..3be1b463 100755 --- a/src/rukiga/LexiconCgg.gf +++ b/src/rukiga/LexiconCgg.gf @@ -172,11 +172,11 @@ lin surface realisation comes from verb tense e.g nagyenzire implies I have alredy gone. -} already_Adv = mkAdv "" AgrNo; -- Already is realized as a verb form - answer_V2S = mkV2S (mkV "garu" "kamu" "kiremu") noPrep; + --answer_V2S = mkV2S (mkV "garu" "kamu" "kiremu") noPrep; apartment_N = mkN "apatimenti" "apatimenti" N_N; art_N = mkN "aati" "aati" N_N; ashes_N = mkN "eiju" "eiju" N_N; - ask_V2Q = mkV2Q (mkV2 "bunza" "za" "rize") noPrep; + --ask_V2Q = mkV2Q (mkV2 "bunza" "za" "rize") noPrep; back_N = mkN "omugongo" MU_MI; bank_N = mkN "banka" "banka" N_N; bark_N = mkN "ask for the Rukiga equivalent of bark" N_N; --TODO find actual word diff --git a/src/rukiga/NounCgg.gf b/src/rukiga/NounCgg.gf index 9d9eb41f..41aa22b8 100755 --- a/src/rukiga/NounCgg.gf +++ b/src/rukiga/NounCgg.gf @@ -39,7 +39,7 @@ lin }; True => { s = \\ num, ns => (cn.s ! num ! ns) ++ - mkGenPrepNoIVClitic (AgP3 num cn.gender) ++ ap.s ! AgP3 Sg KI_BI; + mkGenPrepNoIV (AgP3 num cn.gender) ++ ap.s ! AgP3 Sg KI_BI; gender = cn.gender; nounCat = cn.nounCat } }; @@ -210,9 +210,9 @@ SentCN cn sc = {s = \\ n, ns => cn.s!n!ns ++ sc.s; gender = cn.gender; nounCat -- (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; nounCat = cn.nounCat}; + PossNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIV 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; nounCat = cn.nounCat}; + PartNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIV np.agr ++ np.s ! Nom; gender = cn.gender; nounCat = cn.nounCat}; {- --1 Noun: Nouns, noun phrases, and determiners diff --git a/src/rukiga/NumeralCgg.gf b/src/rukiga/NumeralCgg.gf index 87168fd8..1af17162 100755 --- a/src/rukiga/NumeralCgg.gf +++ b/src/rukiga/NumeralCgg.gf @@ -125,7 +125,7 @@ lin pot3plus n m = let n : Number } ; - mkOrdinal : Str -> Agreement => Str =\c -> \\agr => mkGenPrepWithIVClitic ! agr ++ c; + mkOrdinal : Str -> Agreement => Str =\c -> \\agr => mkGenPrepWithIV ! agr ++ c; {- --1 Numerals diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index 6efcffbe..43739fbc 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -963,7 +963,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "za" ; AgP3 Sg GU_GA => "gwa" ; AgP3 Pl GU_GA => "ga" ; - _ => Predef.error "Error mkGenPrepNoIV" -- error checking for any case not catered for + _ => "Error mkGenPrepNoIV" -- error checking for any case not catered for }; @@ -996,7 +996,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "eza" ; AgP3 Sg GU_GA => "ogwa" ; AgP3 Pl GU_GA => "aga" ; - _ => Predef.error "Error in mkGenPrepWithIVClitic : no pattern matched" -- error checking for any case not catered for + _ => "Error in mkGenPrepWithIVClitic : no pattern matched" -- error checking for any case not catered for }; diff --git a/src/rukiga/StructuralCgg.gf b/src/rukiga/StructuralCgg.gf index f2e092a5..df82f809 100755 --- a/src/rukiga/StructuralCgg.gf +++ b/src/rukiga/StructuralCgg.gf @@ -99,7 +99,10 @@ lin }; have_V2 ={s= "in"; pres="e"; perf ="e"; isPresBlank = False; - isPerfBlank = False; morphs = mkVerbMorphs; comp = []; isRegular=False}; --: V2 ; + isPerfBlank = False; + p = []; isRefl = False; + morphs = mkVerbMorphs; comp = []; isCompN2 = False; + isRegular=False}; --: V2 ; {- All Predeterminers are given here. @@ -210,15 +213,15 @@ lin };--: Det ; want_VV = {s = "yend"; pres="da"; perf = "zire"; isPresBlank = False; - isPerfBlank = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth}; + isPerfBlank = False; isRegular = True; p = []; isRefl = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth}; can8know_VV = {s = "baas"; pres="a"; perf = "ize"; isPresBlank = False; - isPerfBlank = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (capacity) + isPerfBlank = False; isRegular = True; p = []; isRefl = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (capacity) can_VV = {s = "baas"; pres="a"; perf = "ize"; isPresBlank = False; - isPerfBlank = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (possibility) + isPerfBlank = False; isRegular = True; p = []; isRefl = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (possibility) -- must_VV used especially in the perfective mood: see dictionary entry shemerera on Pg 501 of Mpairwe -- must has no passive form must_VV = {s = "shemere"; pres="ra"; perf = "ire"; isPresBlank = False; - isPerfBlank = False; morphs=mkVerbMorphs; isRegular=False; inf=[]; whenUsed = VVPerf}; --VV + isPerfBlank = False; isRegular = False; p = []; isRefl = False; morphs=mkVerbMorphs; isRegular=False; inf=[]; whenUsed = VVPerf}; --VV --somebody_NP = {}; --: NP ; --something_NP : NP ; --somewhere_Adv : Adv ; From d4aba3bded4f0d46afc3889c4c07a21dcd5d6df5 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 12 Oct 2020 23:23:54 +0300 Subject: [PATCH 03/18] made sure error is reproducable by uncommenting answer_V2S and ask_V2Q. However, there are other errors due to N2 types in lexicon --- src/rukiga/LexiconCgg.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rukiga/LexiconCgg.gf b/src/rukiga/LexiconCgg.gf index 3be1b463..f7ecb8d7 100755 --- a/src/rukiga/LexiconCgg.gf +++ b/src/rukiga/LexiconCgg.gf @@ -172,11 +172,11 @@ lin surface realisation comes from verb tense e.g nagyenzire implies I have alredy gone. -} already_Adv = mkAdv "" AgrNo; -- Already is realized as a verb form - --answer_V2S = mkV2S (mkV "garu" "kamu" "kiremu") noPrep; + answer_V2S = mkV2S (mkV "garu" "kamu" "kiremu") noPrep; apartment_N = mkN "apatimenti" "apatimenti" N_N; art_N = mkN "aati" "aati" N_N; ashes_N = mkN "eiju" "eiju" N_N; - --ask_V2Q = mkV2Q (mkV2 "bunza" "za" "rize") noPrep; + ask_V2Q = mkV2Q (mkV2 "bunza" "za" "rize") noPrep; back_N = mkN "omugongo" MU_MI; bank_N = mkN "banka" "banka" N_N; bark_N = mkN "ask for the Rukiga equivalent of bark" N_N; --TODO find actual word From 6ca4907c1188b0ba2b73764642abf4e111ec9ea8 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Thu, 22 Oct 2020 00:02:51 +0300 Subject: [PATCH 04/18] =Added linearisations for several lexical items. The linearization type for adjectives was modified to cater for certain adjectives that are negatives of others. An example is certain and uncertain --- src/rukiga/CatCgg.gf | 2 +- src/rukiga/LexiconCgg.gf | 419 ++++++++++++++++++------------------- src/rukiga/ParadigmsCgg.gf | 248 +++++++--------------- src/rukiga/ResCgg.gf | 15 +- 4 files changed, 293 insertions(+), 391 deletions(-) diff --git a/src/rukiga/CatCgg.gf b/src/rukiga/CatCgg.gf index b6f540a1..1d19e003 100755 --- a/src/rukiga/CatCgg.gf +++ b/src/rukiga/CatCgg.gf @@ -94,7 +94,7 @@ lincat Card = {s :Res.Agreement=>Str; n : Res.Number} ; DAP = Res.Determiner ; - N2 = Res.Noun ** {c2 : Res.Agreement =>Str}; -- relational noun e.g. "son" + N2 = Res.Noun ** {c2 : Res.Agreement =>Str}; -- relational noun e.g. "son" Prep = Res.Preposition; -- preposition, or just case e.g. "in" N3 = N2 ** {c3 : Res.Agreement =>Str}; VV = Res.Verb ** {inf:Str; whenUsed: Res.VVMood}; --inf is the other verb diff --git a/src/rukiga/LexiconCgg.gf b/src/rukiga/LexiconCgg.gf index f7ecb8d7..6da5b2fe 100755 --- a/src/rukiga/LexiconCgg.gf +++ b/src/rukiga/LexiconCgg.gf @@ -67,27 +67,27 @@ lin paris_PN = mkPN "Paris" (AgP3 Sg N_N) True; --Noun class for places??? --Adjectives - bad_A = mkAdjective "bi" Post False False; --False means the adjective is a stem and comes after the complete noun - big_A = mkAdjective "hango" Post False False; - black_A = mkAdjective "kwirangura" Post False False; - blue_A = mkAdjective "buuru" Post True True ; - clean_A = mkAdjective "yonjo" Post False False; --: A ; - cold_A = mkAdjective "kufuka" Post False False; --: A ; - correct_A = mkAdjective "hikire" Post False False; --: A ; - good_A =mkAdjective "rungi" Post False False; --: A ; - heavy_A = mkAdjective "kuremeera" Post False False; --: A ; --notice ri as a verb is - hot_A = mkAdjective "kwosya" Post False False; -- rikutagata -- problematic words like hot we need a new set of clitics - new_A = mkAdjective "sya" Post False False; --: A ; - old_A = mkAdjective "kúru" Post False False; --: A ; - ready_A = mkAdjective "eteekateekire" Post False False; --: A ; - red_A = mkAdjective "kutukura" Post False False; --: A ; - small_A = mkAdjective "kye" Post False False; - warm_A = mkAdjective "kutagata" Post False False;--: A ; - white_A = mkAdjective "rikwera" Post False False;--: A ; - yellow_A = mkAdjective "kinekye" Post True True;--: A ; or yero, or kyenju - young_A = mkAdjective "to" Post False False;--: A ; - green_A =mkAdjective "kijubwe" Post False True; - thin_A = mkAdjective "kye" Post False False; + bad_A = mkAdjective "bi" Post False False False; --False means the adjective is a stem and comes after the complete noun + big_A = mkAdjective "hango" Post False False False; + black_A = mkAdjective "kwirangura" Post False False False; + blue_A = mkAdjective "buuru" Post True True False ; + clean_A = mkAdjective "yonjo" Post False False False ; --: A ; + cold_A = mkAdjective "kufuka" Post False False False ; --: A ; + correct_A = mkAdjective "hikire" Post False False False; --: A ; + good_A =mkAdjective "rungi" Post False False False; --: A ; + heavy_A = mkAdjective "kuremeera" Post False False False; --: A ; --notice ri as a verb is + hot_A = mkAdjective "kwosya" Post False False False; -- rikutagata -- problematic words like hot we need a new set of clitics + new_A = mkAdjective "sya" Post False False False; --: A ; + old_A = mkAdjective "kúru" Post False False False; --: A ; + ready_A = mkAdjective "eteekateekire" Post False False False; --: A ; + red_A = mkAdjective "kutukura" Post False False False; --: A ; + small_A = mkAdjective "kye" Post False False False; + warm_A = mkAdjective "kutagata" Post False False False;--: A ; + white_A = mkAdjective "rikwera" Post False False False;--: A ; + yellow_A = mkAdjective "kinekye" Post True True False;--: A ; or yero, or kyenju + young_A = mkAdjective "to" Post False False False;--: A ; + green_A =mkAdjective "kijubwe" Post False True False; + thin_A = mkAdjective "kye" Post False False False; --ditransitive verbs bite_V2 = mkV2 "rum"; @@ -148,7 +148,7 @@ lin --beg_V2V : V2V ; --Adverbs now_Adv = mkAdv "hati" AgrNo; - --far_Adv = mkAdv "hare"; + far_Adv = mkAdv "hare" AgrNo; today_Adv = mkAdv "erizooba" AgrNo; @@ -160,9 +160,9 @@ lin switch8off_V2 = mkV2 "raza" "za" "riize"; television_N = mkN "TV" N_N; doctor_N = mkN "omushaho" MU_BA; - clever_A =mkAdjective "amagyezi" Post False True; + clever_A =mkAdjective "amagyezi" Post False True False; laugh_V = mkV "sheka"; - beautiful_A = mkAdjective "rungi" Post False False; + beautiful_A = mkAdjective "rungi" Post False False False; airplane_N = mkN "endegye" N_N; year_N = mkN "omwaka" "emyaka" MU_MI; @@ -172,11 +172,11 @@ lin surface realisation comes from verb tense e.g nagyenzire implies I have alredy gone. -} already_Adv = mkAdv "" AgrNo; -- Already is realized as a verb form - answer_V2S = mkV2S (mkV "garu" "kamu" "kiremu") noPrep; + --answer_V2S = mkV2S (mkV "garu" "kamu" "kiremu") noPrep; apartment_N = mkN "apatimenti" "apatimenti" N_N; art_N = mkN "aati" "aati" N_N; ashes_N = mkN "eiju" "eiju" N_N; - ask_V2Q = mkV2Q (mkV2 "bunza" "za" "rize") noPrep; + --ask_V2Q = mkV2Q (mkV2 "bunza" "za" "rize") noPrep; back_N = mkN "omugongo" MU_MI; bank_N = mkN "banka" "banka" N_N; bark_N = mkN "ask for the Rukiga equivalent of bark" N_N; --TODO find actual word @@ -188,214 +188,213 @@ lin boss_N = mkN "mukama" "bakama" MU_BA ; breast_N = mkN "eibere" "amabere" I_MA ; breathe_V = mkV "is" "a" "ire"; - broad_A = mkAdjective "TODO : Ask for the right word" Post False False; + broad_A = mkAdjective "TODO : Ask for the right word for broad" Post False False False; --Note: younger brother. mukuru and others - brother_N2 = mkN2 (mkN "murumuna" "barumuna" MU_BA) (mkPrep "" "" True) ; + --brother_N2 = mkN2 (mkN "murumuna" "barumuna" MU_BA) (mkPrep "" "" True) ; newspaper_N = mkN "eihurire" I_MA; night_N = mkN "ekiro" N_ZERO; nose_N = mkN "enyindo" N_N; --number_N = mkN "enamba" N_N -- TODO look out for the correct word oil_N = mkN "amajuta" N_N; open_V2 = mkV2 "yingura" "ura" "wire"; - -- brown_A - -- burn_V - -- butter_N - -- camera_N - -- cap_N - -- carpet_N - -- ceiling_N - -- cheese_N - -- church_N - -- coat_N - -- country_N - -- cousin_N - -- day_N - -- dig_V - -- dirty_A - -- door_N - -- dry_A - -- dull_A - -- dust_N - -- ear_N - -- earth_N + brown_A = mkAdjective "TODO: Get the right word for brown" Post False True False; + burn_V = mkV "batur" "a" "ire"; + butter_N = mkN "amajuta g'ente" "amajuta g'ente" N_N; + camera_N = mkN "kamera" "kamera" ZERO_ZERO; + cap_N = mkN "TODO-enkofiira" "enkofiira" N_N; + carpet_N = mkN "kapeti" "kapeti" ZERO_ZERO; + ceiling_N = mkN "TO-DO:silingi" "TO-DO:silingi" N_N; + cheese_N = mkN "TO-DO" "TO-DO" N_N; + church_N = mkN "ekelezia" "amakelezia" N_N; + coat_N = mkN "kabuti" "kabuti" ZERO_ZERO; + country_N = mkN "eihanga" "amahanga" I_MA; + cousin_N = mkN "munyanyako" "banyanyako" MU_BA; + day_N = mkN "eizooba" "amazoba" I_MA; + dig_V = mkV "hiing" "a" "ire"; + dirty_A = mkAdjective "rofa" Post False False False; + door_N = mkN "orwigi" "enyigi" RU_N; + dry_A = mkAdjective "yoma" Post False False False; + dull_A = mkAdjective "TODO: find out word for dull" Post False False False; + dust_N = mkN "omucuucu" "omucuucu" ZERO_ZERO; + ear_N = mkN "okutu" "amatu" KU_MA; + earth_N = mkN "ensi" "ensi" N_N; -- easy_A2V - -- egg_N + egg_N = mkN "eihuri" "amahuri" I_MA; -- empty_A - -- enemy_N - -- factory_N - -- fall_V - -- far_Adv - -- fat_N - -- feather_N - -- fight_V2 - -- fingernail_N - -- float_V - -- floor_N - -- flow_V - -- fly_V - -- fog_N - -- foot_N - -- forest_N - -- forget_V2 - -- freeze_V - -- fridge_N - -- fruit_N - -- full_A + enemy_N = mkN "TODO : cofirm omurabe" "TODO : cofirm abarabe" MU_BA; + factory_N = mkN "TODO : cofirm fakatore" "TODO : cofirm fakatore" N_N; + fall_V = mkV "gw" "a" "ire"; + fat_N = mkN "ebishaju" "ebishaju" ZERO_ZERO; + feather_N = mkN "ekyoya" "ebyoya" KI_BI; + fight_V2 = mkV2 "rwan" "a" "ire"; + fingernail_N = mkN "ekyara ky'engaro" "ebyara by'engaro" KI_BI; + --float_V + --floor_N + flow_V = mkV "TODO: confirm himintuk" "a" "ire"; + fly_V = mkV "guruk" "a" "ire"; + fog_N = mkN "TODO word for fog" "TODO word for fog" N_N; + foot_N = mkN "ekigyere" "ebigyere" KI_BI; + forest_N = mkN "eihamba" "amahamba" I_MA; + forget_V2 = mkV2 "yebw" "a" "ire"; + freeze_V = mkV "kwat" "a" "sire"; + fridge_N = mkN "firigi" "firigi" ZERO_ZERO; + fruit_N = mkN "ekijuma" "ebijuma" KI_BI; + full_A = mkAdjective "injwire" Post False True False; -- fun_AV - -- garden_N - -- glove_N - -- gold_N - -- grass_N - -- guts_N - -- hair_N - -- hand_N + garden_N = mkN "omusiri" "emisiri" MU_MI; + --glove_N + gold_N = mkN "TODO:feza" "TODO:feza" ZERO_ZERO; + grass_N = mkN "akanyaasi" "obunyaasi" KA_BU; + guts_N = mkN "orubondo" "amabondo" RU_MA; + hair_N = mkN "eishokye" "eishokye" N_N; + hand_N = mkN "omukono" "emikono" MU_MI; -- harbour_N - -- hate_V2 - -- head_N - -- hear_V2 - -- heart_N - -- hill_N - -- hit_V2 - -- hold_V2 - -- horn_N - -- hunt_V2 - -- husband_N + hate_V2 = mkV2 "kwag" "a" "ire"; + head_N = mkN "omutwe" MU_MI; + hear_V2 = mkV2 "hurir" "a" "e"; + heart_N = mkN "omutima" "emitima" MU_MI; + hill_N = mkN "orushozi" "enshozi" N_N; + hit_V2 = mkV2 "kangaa" "ta" "sire"; + hold_V2 = mkV2 "kwa" "ta" "sire"; + horn_N = mkN "eihembe" "amahembe" I_MA; + hunt_V2 = mkV2 "hiig" "a" "ire"; + husband_N = mkN "iba" "biba" ZERO_ZERO; -- ice_N - -- important_A - -- industry_N - -- iron_N - -- king_N - -- knee_N - -- know_V2 - -- lake_N - -- lamp_N - -- leaf_N - -- learn_V2 - -- leather_N - -- leave_V2 + important_A = mkAdjective "omugasho" Post False True False; + --industry_N = + iron_N = mkN "ekyoma ebirikurunga omu butare" "ebyoma ebirikurunga omu butare" ZERO_ZERO; + king_N = mkN "omugabe" MU_BA; + knee_N = mkN "okuju" "amaju" KU_MA; + know_V2 = mkV2 "many" "a" "ire"; + lake_N = mkN "enyanja" "enyanja" N_N; + lamp_N = mkN "entara" "entara" N_N; + leaf_N = mkN "ibabi" "amababi" I_MA; + learn_V2 = mkV2 "yeg" "a" "ire"; + leather_N = mkN "oruhu" "empu" RU_N; --I think plural should be oruhu again + leave_V2 = mkV2 "rug" "a" "ire"; -- left_Ord - -- leg_N - -- lie_V - -- like_V2 - -- listen_V2 - -- liver_N - -- long_A - -- lose_V2 - -- louse_N - -- love_N + leg_N = mkN "okuguru" "amaguru" KU_MA; + lie_V = mkV "beih" "a" "ire"; + like_V2 = mkV2 "kun" "da" "zire"; + listen_V2 = mkV2 "huri" "iriza" "riize"; + liver_N = mkN "ekine" "ebine" KI_BI; + long_A = mkAdjective "raingwa" Post False False False; + --lose_V2 = mkV2 "" + louse_N = mkN "omura" "emira" MU_MI; + love_N = mkN "rukundo" "rukundo" ZERO_ZERO; -- married_A2 - -- moon_N - -- mother_N2 - -- mountain_N - -- mouth_N - -- name_N - -- narrow_A - -- near_A - -- neck_N + moon_N = mkN "okwezi" "emwezi" KU_MA; + --mother_N2 = mkN2 (mkN "mama" ZERO_BAA) (lin Prep (mkPrep [] [] True)) ; + --mountain_N = mkN + mouth_N = mkN "omunwa" "eminwa" MU_MI; + name_N = mkN "eiziina" "amaziina" I_MA; + narrow_A = mkAdjective "kye" Post False False False; + near_A = mkAdjective "hihi" Pre False True False; -- the preposition is "na" + neck_N = mkN "ebisya" "ebisya" ZERO_ZERO; -- paint_V2A - -- paper_N - -- peace_N - -- pen_N - -- planet_N - -- plastic_N - -- play_V2 - -- policeman_N - -- priest_N + paper_N = mkN "orupapura" "empapura" RU_N; + peace_N = mkN "obusingye" "obusingye" ZERO_BU; + pen_N = mkN "akacumu" "obucumu" KA_BU; + planet_N = mkN "ensi" "ensi" N_N; + plastic_N = mkN "pulasitika" "pulasitika" ZERO_ZERO; + play_V2 = mkV2 "zaan" "a" "ire"; + policeman_N = mkN "omupolisi" "abapolisi" MU_BA; + priest_N = mkN "omuhongyerezi" "abahongyerezi" MU_BA; -- probable_AS - -- pull_V2 - -- push_V2 - -- put_V2 - -- queen_N - -- question_N - -- radio_N - -- rain_N + pull_V2 = mkV2 "kuru" "ra" "ire"; + push_V2 = mkV2 "sindik" "a" "ire"; + put_V2 = mkV2 "t" "a" "ire"; + queen_N = mkN "Kwini" "baakwini" ZERO_BAA; + question_N = mkN "ekibuzo" "ebibuzo" KI_BI; + radio_N = mkN "radiyo" "radiyo" ZERO_ZERO; + rain_N = mkN "enjura" "enjura" ZERO_N; -- rain_V0 - -- religion_N - -- restaurant_N + religion_N = mkN "endiini" "endiini" N_N; + restaurant_N = mkN "hooteeri" "hooteeri" ZERO_ZERO; -- right_Ord - -- road_N + road_N = mkN "orugundo" "engundo" RU_N; -- rock_N - -- roof_N - -- root_N - -- rope_N - -- rotten_A + --roof_N = mkN "" + root_N = mkN "omuzi" "emizi" MU_MI; + rope_N = mkN "omuguha" "emiguha" MU_MI; + rotten_A = mkAdjective "njuzire" Post False False False; -- round_A - -- rub_V2 + rub_V2 = mkV2 "harabur" "a" "ire"; -- rubber_N - -- salt_N - -- sand_N - -- school_N - -- science_N - -- scratch_V2 - -- seed_N - -- seek_V2 - -- sew_V - -- sharp_A - -- shirt_N - -- shoe_N - -- shop_N - -- short_A - -- silver_N - -- sing_V - -- sister_N - -- sit_V - -- skin_N - -- sky_N - -- smell_V - -- smoke_N - -- smooth_A - -- snake_N + salt_N = mkN "omwonyo" "emyonyo" MU_MI; + sand_N = mkN "omushenyi" MU_MI; + school_N = mkN "eishomero" I_MA; + science_N = mkN "sayansi" "sayansi" ZERO_ZERO; + scratch_V2 = mkV2 "ha" "ra" "ire"; + seed_N = mkN "ensingo" "ensigo" N_N; + seek_V2 = mkV2 "kyenuuz" "a" "ire"; + sew_V = mkV "ruk" "a" "ire"; + sharp_A = mkAdjective "shazire" Post False False False; + shirt_N = mkN "esaati" "esaati" ZERO_ZERO; --TODO: confirm this entry + shoe_N = mkN "enkaito" "enkaito" N_N; --TODO : confirm the existence of this entry + shop_N = mkN "eduuka" "eduuka" ZERO_ZERO; + short_A = mkAdjective "gufu" Post False False False; + --silver_N + sing_V = mkV "yeshogor" "ora" "wire"; --TODO : confirm this word and the conjugation + sister_N = mkN "munyanyazi" "banyanyanzi" MU_BA; + sit_V = mkV "shutam" "a" "ire"; + --skin_N = mkN "omubiri" "emibiri" MU_MI; This is wrong + sky_N = mkN "eiguru" "eiguru" ZERO_ZERO; + smell_V = mkV "kag" "a" "ire"; + smoke_N = mkN "omwika" "emyiika" MU_MI; + --smooth_A + snake_N = mkN "enjoka" "enjoka" N_N; -- snow_N - -- sock_N - -- song_N - -- speak_V2 - -- spit_V - -- split_V2 - -- squeeze_V2 - -- stab_V2 - -- stand_V + sock_N = mkN "sitokisi" "sitokisi" ZERO_ZERO; + song_N = mkN "ekyeshongoro" "ebyeshongoro" KI_BI; + speak_V2 = mkV2 "gamba"; + spit_V = mkV "cwer" "a" "ire"; + split_V2 = mkV2 "gangabura"; + squeeze_V2 =mkV2 "imat" "a" "si"; + stab_V2 = mkV2 "cumi" "ta" "sire"; --edit for Runyankore + stand_V = mkV "yemerera" "ra" "ire"; -- steel_N - -- stick_N - -- stone_N - -- stop_V - -- stove_N - -- straight_A - -- student_N - -- stupid_A - -- suck_V2 - -- sun_N - -- swell_V - -- switch8on_V2 - -- table_N - -- tail_N - -- teacher_N + stick_N = mkN "omunyafu" "eminyafu" MU_MI; + stone_N = mkN "eibare" "amabara" I_MA; + stop_V = mkV "komya" "ya" "ize"; + stove_N = mkN "sitoovu" "sitoovu" ZERO_ZERO; + straight_A = mkAdjective "gorwire" Post False False False; + student_N = mkN "omwana w'eishomero" "abaana b'eishomero" MU_BA; + stupid_A = mkAdjective "himbagire" Post False False False; + suck_V2 = mkV2 "komaguza" "za" "ize"; + sun_N = mkN "omushana" "omushana" MU_ZERO; + swell_V = mkV "bimba"; + switch8on_V2 = mkV2 "ya" "sya" "kise"; + table_N = mkN "emeeza" "emeeza" N_N; + tail_N = mkN "omukira" "emikira" MU_MI; + teacher_N = mkN "omushomesa" "abashomesa" MU_BA; -- thick_A - -- think_V - -- throw_V2 - -- tie_V2 - -- tongue_N - -- tooth_N - -- turn_V - -- ugly_A - -- uncertain_A - -- university_N - -- village_N - -- vomit_V - -- war_N - -- wash_V2 - -- watch_V2 - -- wet_A - -- wide_A - -- wife_N - -- win_V2 - -- wind_N - -- window_N - -- wing_N - -- wipe_V2 - -- wonder_VQ - -- wood_N - -- worm_N - -- write_V2 + --think_V = mkV + throw_V2 = mkV2 "naga"; + tie_V2 = mkV2 "siba"; + tongue_N = mkN "orurimi" RU_N; + tooth_N = mkN "erino" "amino" RI_MA; + turn_V = mkV "hinduka"; + ugly_A = mkAdjective "bi" Post False False False; --I think I should add another boolean for copulative version + uncertain_A = mkAdjective "manyirwe" Post False False True; -- we need to investigate the place of negative adjectives i.e those that come from positive words + university_N = mkN "yunivasite" "yunivasite" ZERO_ZERO; + village_N = mkN "ekyalo" "ebyalo" KI_BI; + vomit_V = mkV "tanaka"; + war_N = mkN "orutaro" "entaro" RU_N; + wash_V2 = mkV2 "yozya" "zya" "yogize"; + watch_V2 = mkV2 "reeba"; + wet_A = mkAdjective "jubire" Post False False False; + wide_A = mkAdjective "hango" Post False False False; + wife_N = mkN "omukyara" "abakyara" MU_BA; + win_V2 = mkV2 "singa"; + wind_N = mkN "omuyaga" "emiyaga" MU_MI; + window_N = mkN "eidirisa" "eidirisa" N_N; + wing_N = mkN "eipapa" "amapapa" I_MA; + wipe_V2 = mkV2 "sim" "ura" "wire"; + --wonder_VQ = mkV2Q (mkV2 "tanga" "ara" "ire") noPrep; + wood_N = mkN "ekiti" "ebiti" KI_BI; + --worm_N + write_V2 = mkV2 "handika"; diff --git a/src/rukiga/ParadigmsCgg.gf b/src/rukiga/ParadigmsCgg.gf index af05ac5d..d007baa6 100755 --- a/src/rukiga/ParadigmsCgg.gf +++ b/src/rukiga/ParadigmsCgg.gf @@ -1,4 +1,21 @@ --# -path=.:../prelude:../abstract:../common +--# -path=.:../abstract:../../prelude:../common + +--1 Rukiga Lexical Paradigms +-- +-- David Bamutura 2017--2020 +-- based on the English Paradigms file. +-- This is an API for the user of the resource grammar +-- for adding lexical items. It gives functions for forming +-- expressions of open categories: nouns, adjectives, verbs. +-- +-- Closed categories (determiners, pronouns, conjunctions) are +-- accessed through the resource syntax API, $Structural.gf$. +-- +-- The structure of functions for each word class $C$ is the following: +-- first we give a handful of patterns that aim to cover all +-- regular cases. Then we give a worst-case function $mkC$, which serves as an +-- escape to construct the most irregular words of type $C$. resource ParadigmsCgg = open (Predef=Predef), ResCgg, CatCgg, Prelude in { @@ -45,13 +62,13 @@ oper --3 Relational nouns - mkN2 : overload { - --mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --% - --mkN2 : N -> N2 ; -- e.g. wife of (default prep. to) - --mkN2 : N -> Str -> N2 ; -- access to --% - mkN2 : N -> Prep -> N2 ; -- e.g. access to - --mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --% - } ; + -- mkN2 : overload { + -- --mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --% + -- --mkN2 : N -> N2 ; -- e.g. wife of (default prep. to) + -- --mkN2 : N -> Str -> N2 ; -- access to --% + -- mkN2 : N -> Prep -> N2 ; -- e.g. access to + -- --mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --% + -- } ; mkN2 = overload { mkN2 : N -> Prep -> N2 = prepN2 ; @@ -130,187 +147,68 @@ oper mkV2V : V -> Prep -> Prep -> V2V = \v,p,t -> lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVAux}) ; } ; - {- - + -- Verbs with a particle. +-- The particle, such as in "switch on", is given as a string. - - mkV2V : overload { - mkV2V : Str -> V2V ; - mkV2V : V -> V2V ; - mkV2V : V -> Prep -> Prep -> V2V ; -- e.g. want (noPrep NP) (to VP) - } ; - - -} - --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 - ---1 Swahili Lexical Paradigms - ---2 Parameters --- --- To abstract over gender names, we define the following identifiers. - -oper - Animacy : Type ; - - animate : Animacy ; - inanimate : Animacy ; - --- To abstract over number names, we define the following. - - Number : Type ; - - singular : Number ; - plural : Number ; - --- To abstract over case names, we define the following. - - Case : Type ; - - nominative : Case ; - locative : Case ; - --- To abstract over nounclass names, we define the following. + partV : V -> Str -> V ; -- with particle, e.g. switch + on + partV v p = lin V {s = v.s ; + pres = v.pres; + perf = v.perf; + isPresBlank = v.isPresBlank; + isPerfBlank = v.isPerfBlank; + isRegular = v.isRegular; + p = p ; + isRefl = v.isRefl + } ; + partV2 : V2 -> Str -> V2 ; -- with particle, e.g. switch + on + partV2 v p = lin V2 {s = v.s ; + pres = v.pres; + perf = v.perf; + isPresBlank = v.isPresBlank; + isPerfBlank = v.isPerfBlank; + isRegular = v.isRegular; + p = p ; + isRefl = v.isRefl; + comp = []; isCompN2 = False} ; - Gender : Type ; + -- mkVA : V -> VA ; -- e.g. become (AP) + -- mkV2A : overload { + -- mkV2A : V -> V2A ; -- e.g. paint (NP) (AP) + -- mkV2A : V -> Prep -> V2A ; -- backwards compatibility + -- mkV2A : V -> Prep -> Prep -> V2A ; -- e.g. strike (NP) as (AP) + -- } ; + -- mkVQ : V -> VQ ; -- e.g. wonder (QS) + -- mkV2Q : V -> Prep -> V2Q ; -- e.g. ask (NP) (QS) - m_wa : Gender ; - m_mi : Gender ; - ji_ma : Gender ; - e_ma : Gender ; - ma_ma : Gender ; - ki_vi : Gender ; - e_e : Gender ; - u_u : Gender ; - u_ma : Gender ; - u_e : Gender ; + -- mkAS : A -> AS ; --% + -- mkA2S : A -> Prep -> A2S ; --% + -- mkAV : A -> AV ; --% + -- mkA2V : A -> Prep -> A2V ; --% - +-- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$. +-- $V0$ is just $V$; the second argument is treated as adverb. ---2 Nouns + V0 : Type ; --% + AS, A2S, AV, A2V : Type ; --% --- Worst case: give all four forms and the semantic gender. +--2 Other categories - mkN : (mtu,watu : Str) -> Gender -> Animacy -> N ; - --- The regular function captures the variants for nouns depending on Gender and Number - - regN : Str -> Gender -> Animacy -> N ; - --- In practice the worst case is just: give singular and plural nominative. - - - mk2N : (mtu , watu : Str) -> Gender -> Animacy -> N ; - mk2N x y g anim = mkNounIrreg x y g anim ** {lock_N = <>}; - - mkN2 : N -> Prep -> N2 ; - mkN2 : N -> Prep -> N2 = \n,p -> n ** {c2 = p.s ; lock_N2 = <>} ; - - mkPrep : Str -> Prep ; --- mkPrep p = {s = p ; c = CPrep PNul ; isDir = False ; lock_Prep = <>} ; - mkPrep p = {s = p ; lock_Prep = <>} ; - - ---3 Relational nouns --- --- Relational nouns ("fille de x") need a case and a preposition. - --- All nouns created by the previous functions are marked as --- $nonhuman$. If you want a $human$ noun, wrap it with the following --- function: - --- genderN : Gender -> N -> N ; - --- For regular adjectives, the adverbial form is derived. This holds --- even for cases with the variation "happy - happily". - - regA : Str -> A ; - --- If comparison is formed by "kuliko", as usual in Swahili, --- the following pattern is used: - - compADeg : A -> A ; +mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --% +mkInterj : Str -> Interj + = \s -> lin Interj (ss s) ; +--. --2 Definitions of paradigms -- -- The definitions should not bother the user of the API. So they are -- hidden from the document. ---. - Animacy = ResSwa.Animacy ; - Number = ResSwa.Number ; - Case = ResSwa.Case ; - Gender = ResSwa.Gender ; - animate = AN ; - inanimate = IN ; - singular = Sg ; - plural = Pl ; - nominative = Nom ; - locative = Loc ; - m_wa = g1_2 ; - m_mi = g3_4 ; - ji_ma = g5_6 ; - e_ma = g5a_6 ; - ma_ma = g6 ; - ki_vi = g7_8 ; - e_e = g9_10 ; - u_u = g11 ; - u_ma = g11_6 ; - u_e = g11_10 ; - VForm = ResSwa.VForm ; --- regN x g anim = mkNomReg x g anim ** {lock_N = <>} ; - - regN = \x,g,anim -> - mkNomReg x g anim ** {lock_N = <>} ; - --- mkN x y g anim = mkNounIrreg x y g anim ** {lock_N = <>} ; - mkN = \x,y,g,anim -> - mkNounIrreg x y g anim ** {lock_N = <>} ; - --- Adjectives - - regA a = compADeg { - s = \\_ => (mkAdjective a).s ; - lock_A = <>} ; - - compADeg a = - { - s = table { - Posit => a.s ! Posit ; - _ => \\f => a.s ! Posit ! f ++ "kuliko" - } ; - lock_A = <>} ; - --- Verbs - regV : Str -> V ; - regV = \enda -> mkV enda ** {s1 = [] ; lock_V = <>} ; - -{-- - mkV2 = overload { - mkV2 : Str -> V2 = \s -> dirV2 (regV s) ; - mkV2 : V -> V2 = dirV2 ; - mkV2 : V -> Prep -> V2 = mmkV2 - } ; - - mmkV2 : V -> Prep -> V2 ; - mmkV2 v p = v ** {c2 = p ; lock_V2 = <>} ; - dirV2 : V -> V2 = \v -> mmkV2 v "na" ; ---} - ---2 Adverbs - --- Adverbs are not inflected. Most lexical ones have position --- after the verb. - - mkAdv : Str -> Adv ; - mkAdv x = ss x ** {lock_Adv = <>} ; - --} +-- Rearrange this document in future so that a paradigms file is +-- as should be i.e with an abstract part and a a part with +-- definitions + V0 : Type = V ; + AS, A2S, AV : Type = A ; + A2V : Type = A2 ; } diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index 43739fbc..89253088 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -177,7 +177,7 @@ oper < "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_MA > => mkNoun omuntu (combine_morphemes "ama" stem) 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 @@ -188,7 +188,7 @@ oper --< _ ,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 ; - < _ ,_ > => mkNoun omuntu omuntu g-- improve as we go on. + < _ ,_ > => mkNoun omuntu omuntu g -- improve as we go on. }; @@ -590,9 +590,14 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { --AdjectivalPhrase : Type {s : Str ; post : Str; isPre : Bool; isProper : Bool; isPrep: Bool} ; AdjectivalPhrase : Type = {s : Str ; position : Position; isProper : Bool; isPrep: Bool}; --Adjective : Type = {s : Str ; post : Str; isPre : Bool; isProper : Bool; isPrep: Bool}; - Adjective : Type = {s : Str ; position : Position; isProper : Bool; isPrep: Bool}; - mkAdjective: Str -> Position -> Bool -> Bool -> Adjective = \ a , pos, isProper, isPrep -> - { s = a ; position = pos ; isPre = False; isProper = isProper; isPrep = isPrep}; + Adjective : Type = {s : Str ; + position : Position; + isProper : Bool; + isPrep: Bool; + isNeg : Bool -- this is for specifying that uncertain is the negative of certain + }; + mkAdjective: Str -> Position -> Bool -> Bool ->Bool-> Adjective = \ a , pos, isProper, isPrep,isNeg -> + { s = a ; position = pos ; isPre = False; isProper = isProper; isPrep = isPrep; isNeg = isNeg}; {- TO DO: From b2e2631269dcf770f46971e113ce2eba7e1365a2 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Sat, 24 Oct 2020 03:05:05 +0300 Subject: [PATCH 05/18] All structural words and most of the linearization functions for LexiconCgg have been provided --- src/rukiga/CatCgg.gf | 6 +- src/rukiga/LexiconCgg.gf | 12 ++-- src/rukiga/ParadigmsCgg.gf | 51 ++++++++++++++++- src/rukiga/ResCgg.gf | 11 ++-- src/rukiga/StructuralCgg.gf | 107 ++++++++++++++++++++++++++++++------ 5 files changed, 156 insertions(+), 31 deletions(-) diff --git a/src/rukiga/CatCgg.gf b/src/rukiga/CatCgg.gf index 1d19e003..e46cf623 100755 --- a/src/rukiga/CatCgg.gf +++ b/src/rukiga/CatCgg.gf @@ -92,7 +92,7 @@ lincat Digits = {s : Res.CardOrd => Res.Agreement=>Str ; n : Res.Number ; tail : Px.DTail} ; Ord = {s :Res.Agreement=>Str; position:Res.Position} ; Card = {s :Res.Agreement=>Str; n : Res.Number} ; - + A2 = Res.Adjective ** { c2 : Str ; isPre : Bool} ; DAP = Res.Determiner ; N2 = Res.Noun ** {c2 : Res.Agreement =>Str}; -- relational noun e.g. "son" Prep = Res.Preposition; -- preposition, or just case e.g. "in" @@ -106,6 +106,10 @@ linref VP =\vp -> vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2 ++ vp.ap; VPSlash =\vpslash -> vpslash.s ++ BIND ++ vpslash.pres; +lindef + A2 = \s -> {s = s; position = Res.Post; isProper = False; + isPrep = False; isNeg = False;c2 = ""; isPre = True}; + --1 Cat: the Category System diff --git a/src/rukiga/LexiconCgg.gf b/src/rukiga/LexiconCgg.gf index 6da5b2fe..08b1f2c1 100755 --- a/src/rukiga/LexiconCgg.gf +++ b/src/rukiga/LexiconCgg.gf @@ -218,9 +218,9 @@ lin dust_N = mkN "omucuucu" "omucuucu" ZERO_ZERO; ear_N = mkN "okutu" "amatu" KU_MA; earth_N = mkN "ensi" "ensi" N_N; - -- easy_A2V + easy_A2V = mkA2V "yaguhi" Post False False False; egg_N = mkN "eihuri" "amahuri" I_MA; - -- empty_A + empty_A = mkAdjective "rimu busha" Post False True False; enemy_N = mkN "TODO : cofirm omurabe" "TODO : cofirm abarabe" MU_BA; factory_N = mkN "TODO : cofirm fakatore" "TODO : cofirm fakatore" N_N; fall_V = mkV "gw" "a" "ire"; @@ -240,9 +240,9 @@ lin fridge_N = mkN "firigi" "firigi" ZERO_ZERO; fruit_N = mkN "ekijuma" "ebijuma" KI_BI; full_A = mkAdjective "injwire" Post False True False; - -- fun_AV + --fun_AV = mkAdjective garden_N = mkN "omusiri" "emisiri" MU_MI; - --glove_N + glove_N = mkN "gilavu" "gilavu" ZERO_ZERO; gold_N = mkN "TODO:feza" "TODO:feza" ZERO_ZERO; grass_N = mkN "akanyaasi" "obunyaasi" KA_BU; guts_N = mkN "orubondo" "amabondo" RU_MA; @@ -272,7 +272,7 @@ lin learn_V2 = mkV2 "yeg" "a" "ire"; leather_N = mkN "oruhu" "empu" RU_N; --I think plural should be oruhu again leave_V2 = mkV2 "rug" "a" "ire"; - -- left_Ord + left_Ord = mkOrd "bumosho"; leg_N = mkN "okuguru" "amaguru" KU_MA; lie_V = mkV "beih" "a" "ire"; like_V2 = mkV2 "kun" "da" "zire"; @@ -311,7 +311,7 @@ lin -- rain_V0 religion_N = mkN "endiini" "endiini" N_N; restaurant_N = mkN "hooteeri" "hooteeri" ZERO_ZERO; - -- right_Ord + right_Ord = mkOrd "buryo"; road_N = mkN "orugundo" "engundo" RU_N; -- rock_N --roof_N = mkN "" diff --git a/src/rukiga/ParadigmsCgg.gf b/src/rukiga/ParadigmsCgg.gf index d007baa6..a44f0aaf 100755 --- a/src/rukiga/ParadigmsCgg.gf +++ b/src/rukiga/ParadigmsCgg.gf @@ -207,8 +207,57 @@ mkInterj : Str -> Interj -- Rearrange this document in future so that a paradigms file is -- as should be i.e with an abstract part and a a part with -- definitions - + mkOrd : Str -> Ord = \s -> lin Ord { s = \\_=>s; position = Post}; V0 : Type = V ; AS, A2S, AV : Type = A ; A2V : Type = A2 ; + mkV0 : V -> V; + mkV0 v = v ; + mkA2 : Str -> Position -> Bool -> Bool ->Bool-> A2 = \a2, pos, isProper, isPrep,isNeg -> + lin A2 ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True}); + --mkA2V : A -> A2V; + --mkA2V a = lin A2V (a * {c2 = ""; isPre = True}); + mkA2V : Str -> Position -> Bool -> Bool ->Bool-> A2V =\a2, pos, isProper, isPrep,isNeg -> lin A2V ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True}); + + + -- Adverbs modifying numerals + + mkAdN : Str -> AdN ; -- e.g. approximately + mkCAdv : Str -> CAdv ; + mkAdN x = lin AdN (ss x) ; + mkCAdv x = lin CAdv (ss x ** {p = []}) ; + + mkConj : overload { + mkConj : Str -> Conj ; -- and (plural agreement) --% + mkConj : Str -> Number -> Conj ; -- or (agrement number given as argument) --% + mkConj : Str -> Str -> Conj ; -- both ... and (plural) --% + mkConj : Str -> Str -> Number -> Conj ; -- either ... or (agrement number given as argument) --% + } ; + + mkConj = overload { + mkConj : Str -> Conj = \y -> mk2Conj [] y Pl ; -- when you have simply and + mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ; + mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y Pl ; -- when you have both ... and ... + mkConj : Str -> Str -> Number -> Conj = mk2Conj ; + } ; + + mk2Conj : Str -> Str -> Number -> Conj = \x,y,n -> + lin Conj {s = \\_=>x; s2 = y; n = n}; + + --2 Adverbs + + -- Adverbs are not inflected. Most lexical ones have position + -- after the verb. Some can be preverbal (e.g. "always"). + + mkAdv : Str -> AgrExist -> Adv ; -- e.g. today + + --mkAdV : Str -> AdV ; -- e.g. always + + -- Adverbs modifying adjectives and sentences can also be formed. + + mkAdA : Str -> Position -> AdA ; -- e.g. quite + --mkCAdv : Str -> Str -> Str -> CAdv ; -- more than/no more than + + mkAdv x agrEx = lin Adv {s = x ; agr = agrEx } ; + mkAdA x pos = lin AdA {s = x ; position = pos } ; -- e.g. quite } diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index 89253088..a6405a02 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -563,8 +563,8 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { _ => mkClitic "-" -- Hopefully exhausted all forms }; - Adverb = {s :Str; agr : AgrExist} ; - mkAdv: Str -> AgrExist -> Adverb =\str, agr ->{s=str; agr=agr}; + Adverb : Type = {s :Str; agr : AgrExist} ; + --dealing with the adjective {- The Adjective can be before the noun for TRUE or @@ -1277,12 +1277,13 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { -- Structural -- prepositions sometimes have two kinds, near or far i.e omu or omuri - -- We ignore the distal dexis to be entered as a separate lemma - -- Instead str for positional arguments 1 & 2 cater for prepositions that inflect with Number - -- while str for positional argument 3 caters for those that do not inflect with Number + -- We provide for two kinds: near and distal plus a status checker for + -- genitive prepositions + Preposition : Type = {s : Str; other : Str; isGenPrep : Bool}; NounPhrase : Type = {s :Case => Str; agr : Agreement}; + {- Operation to create Noun Phrases from a Determiner and Nouns. In Runyankore and Rukiga, depending on the particular Determiner, diff --git a/src/rukiga/StructuralCgg.gf b/src/rukiga/StructuralCgg.gf index df82f809..1ae12767 100755 --- a/src/rukiga/StructuralCgg.gf +++ b/src/rukiga/StructuralCgg.gf @@ -6,7 +6,7 @@ concrete StructuralCgg of Structural = CatCgg ** {-variants NOTE: Please add them to the abstract syntax, ask aarne - or creat you own abstract Lexicon which inherits from the + or creat your own abstract Lexicon which inherits from the standard one. See how english does it. i.e. use DictCggAbs.gf for the funs. and DictCgg.gf for the lins. @@ -15,14 +15,15 @@ concrete StructuralCgg of Structural = CatCgg ** lin --Determiner : Type = {s : Str ; s2: Agreement=>Str; ntype : NounState ; num : Number ; pos : Position; doesAgree: Bool }; - a_Det = {s =[] ; s2 = \\_ => []; ntype = Complete; num = Sg; pos = Pre; doesAgree = False; numeralS=\\_=>[]; numeralExists = False}; --: Det ; indefinite singular ---s - aPl_Det = {s =[]; s2= \\_ => []; ntype = Complete; num = Pl; pos = Pre; doesAgree = False; numeralS=\\_=>[]; numeralExists = False}; -- : Det ;indefinite plural ---s - the_Det = {s =[]; s2= \\_ => []; ntype = Complete; num = Sg; pos = Pre; doesAgree = False; numeralS=\\_=>[]; numeralExists = False}; --: Det ; -- definite singular ---s thePl_Det = {s =[]; ntype = Complete; num = Pl; pos = PreDeterminer}; --: Det ;definite plural ---s - + --a_Det = {s =[] ; s2 = \\_ => []; ntype = Complete; num = Sg; pos = Pre; doesAgree = False; numeralS=\\_=>[]; numeralExists = False}; --: Det ; indefinite singular ---s + --aPl_Det = {s =[]; s2= \\_ => []; ntype = Complete; num = Pl; pos = Pre; doesAgree = False; numeralS=\\_=>[]; numeralExists = False}; -- : Det ;indefinite plural ---s + --the_Det = {s =[]; s2= \\_ => []; ntype = Complete; num = Sg; pos = Pre; doesAgree = False; numeralS=\\_=>[]; numeralExists = False}; --: Det ; -- definite singular ---s thePl_Det = {s =[]; ntype = Complete; num = Pl; pos = PreDeterminer}; --: Det ;definite plural ---s + -- 1 Determiners every_Det = {s ="buri"; s2 = \\_ => []; ntype=Incomplete; num=Sg; pos=Pre; doesAgree = False; numeralS=\\_=>[]; numeralExists = False} ; few_Det = {s="kye"; s2 = \\_ => []; ntype =Complete; num=Pl; pos=Post; doesAgree = False; numeralS=\\_=>[]; numeralExists = False} ; many_Det ={s="ingi"; s2 = \\_ => []; ntype =Complete; num=Pl; pos=Post; doesAgree = False; numeralS=\\_=>[]; numeralExists = False} ; + -- 2 Pronouns i_Pron = {s = table{Gen => glueGen (AgMUBAP1 Sg); _=> mkSStand (AgMUBAP1 Sg)}; third = \\_,_=>[]; agr = AgrYes (AgMUBAP1 Sg)};--mkPron "nyowe" "nyowe" (AgMUBAP1 Sg); youSg_Pron = {s = table{Gen => glueGen (AgMUBAP2 Sg); _=>mkSStand (AgMUBAP2 Sg)}; third = \\_,_=>[]; agr = AgrYes(AgMUBAP2 Sg)};--mkPron "iwe" "we" (AgMUBAP2 Sg); he_Pron, she_Pron = {s = table{Gen => glueGen (AgP3 Sg MU_BA); _=>mkSStand (AgP3 Sg MU_BA)}; third = \\_,_=>[]; agr = AgrYes(AgP3 Sg MU_BA)};--mkPron "uwe" "uwe" (AgP3 Sg MU_BA); @@ -35,7 +36,9 @@ lin third = \\agr => table{Gen =>glueGen agr; _ => mkSStand agr}; agr = AgrNo }; --mkPron "kyo" "kyo" (AgP3 Sg KI_BI); -- should form an it_Pron_NClass in extra module - + youPol_Pron = {s = table{Gen => glueGen (AgMUBAP2 Pl); _=>mkSStand (AgMUBAP2 Pl)}; third = \\_,_=>[]; agr =AgrYes (AgMUBAP2 Pl)};--mkPron "imwe" "imwe" (AgMUBAP2 Pl); + -- 3 Prepositions + above_Prep = mkPrep "ahinguru ya" [] False; behind_Prep = mkPrep "enyuma ya" [] False; between_Prep =mkPrep "hagati ya" [] False; to_Prep = mkPrep "aha" [] False; @@ -45,16 +48,33 @@ lin on_Prep = mkPrep "aha" "ahari" False; in8front_Prep = mkPrep "enyuma ya" [] False; --: Prep ; -- in front of + by8agent_Prep = mkPrep "by8agent_Prep" [] False ; -- when you meet by, use the passive of the verb + by8means_Prep = mkPrep "by8means_Prep" [] False; + during_Prep = mkPrep "omu" "omuri" False; + except_Prep = mkPrep "kwihaho" [] False; + for_Prep = mkPrep "for_Prep: would need paraphrasing" [] False; + + + {- + the word before is realised as a phrase in RR. + We use the negative version of the verb + used in the main clause. + it is always paraphrased. Let us put a hint for post processing + -} + before_Prep = mkPrep "PostProcess_before_proximal" "PostProcess_before_distal" False; ---na --please this string varies with vowels use combine_morphemes or ---combine_words when using it. + --na --please this string varies with vowels use combine_morphemes or + --combine_words when using it. with_Prep = mkPrep "na" [] False; from_Prep =mkPrep "kurunga" "" False; under_Prep = mkPrep "hansi ya" "" False; after_Prep = mkPrep "omu maisho" "" False; --: Prep ; - - ---Structural + part_Prep = mkPrep "part_Prep=of:Disambiguate" [] False; -- suspect "part of" + possess_Prep = mkPrep [] [] True; -- of is a huge table we should not be carrying arround + through_Prep = mkPrep "raba omu" [] False; + without_Prep = mkPrep "tiine" [] False; + -- 4 Conjunctions {- --there are several and i.e. -- na (two nouns, 2 Noun Phrases, 2 Pronouns, 2 relative subject clauses, ) @@ -97,6 +117,10 @@ lin s2 =[]; n = Sg }; + if_then_Conj = mkConj "kuri" [] Sg; + -- Distributed Conjunction + both7and_DConj = mkConj "mbi" "na"; + either7or_DConj = mkConj "mwe ahari" "nari" Sg; have_V2 ={s= "in"; pres="e"; perf ="e"; isPresBlank = False; isPerfBlank = False; @@ -139,6 +163,12 @@ lin always_AdV = {s = "obutóòsha"; agr = AgrNo}; everywhere_Adv = {s = "hóòna"; agr = AgrNo}; -- adverb of place. here_Adv = {s = "hanu"; agr = AgrNo}; + here7from_Adv = mkAdv "here7from_Adv:findout" AgrNo; + quite_Adv = mkAdA "quite_Adv:findout" Post; + there7from_Adv = mkAdv "there7from_Adv:findout" AgrNo; + there7to_Adv = mkAdv "there7to_Adv:findout" AgrNo; + here7to_Adv = mkAdv "here7to_Adv:findout" AgrNo; + there_Adv = mkAdv "hari" AgrNo; {-End of Adverbs Adverbs-} {-Begining of Quantifiers-} @@ -171,8 +201,9 @@ lin whoPl_IP = { s= "ha"; n = IPl; isVerbSuffix = True; requiresIPPrefix = False; aux="ni"; endOfSentence = True} ;--: IP ; -- who (plural) whoSg_IP = { s= "ha"; n = ISg; isVerbSuffix = True; requiresIPPrefix = False; aux="ni"; endOfSentence = True}; --: IP ; -- who (singular) --You may need to use booleans to indicate that you need these tables rather than carrying them. + --interogative adverbs how_IAdv = {s ="ta"; requiresSubjPrefix = True; endOfSentence =True}; --: IAdv ; - --how8much_IAdv = {s ="kwiga"; s2requireSubjPrefix = True};--: IAdv ; + how8much_IAdv = {s ="kwigana"; requiresSubjPrefix = True; endOfSentence =True};--: IAdv ; when_IAdv = {s ="ryari"; requiresSubjPrefix = False; endOfSentence =True}; --: IAdv ; where_IAdv = {s ="nkahe"; requiresSubjPrefix = False; endOfSentence =True}; --: IAdv ; @@ -211,28 +242,51 @@ lin numeralS=\\_=>[]; numeralExists = False };--: Det ; + + much_Det = + { + s =[]; + s2 =\\agr => "ingi";-- mkSubjCliticTablePl ! agr ++ "mwe"; + ntype = Complete; + num = Pl; + pos = Post; + doesAgree = True; + numeralS=\\_=>[]; + numeralExists = False + };--: Det ; + - want_VV = {s = "yend"; pres="da"; perf = "zire"; isPresBlank = False; + want_VV = {s = "yend"; pres="da"; perf = "zire"; isPresBlank = False; isPerfBlank = False; isRegular = True; p = []; isRefl = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth}; - can8know_VV = {s = "baas"; pres="a"; perf = "ize"; isPresBlank = False; + can8know_VV = {s = "baas"; pres="a"; perf = "ize"; isPresBlank = False; isPerfBlank = False; isRegular = True; p = []; isRefl = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (capacity) - can_VV = {s = "baas"; pres="a"; perf = "ize"; isPresBlank = False; + can_VV = {s = "baas"; pres="a"; perf = "ize"; isPresBlank = False; isPerfBlank = False; isRegular = True; p = []; isRefl = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (possibility) -- must_VV used especially in the perfective mood: see dictionary entry shemerera on Pg 501 of Mpairwe -- must has no passive form must_VV = {s = "shemere"; pres="ra"; perf = "ire"; isPresBlank = False; isPerfBlank = False; isRegular = False; p = []; isRefl = False; morphs=mkVerbMorphs; isRegular=False; inf=[]; whenUsed = VVPerf}; --VV - --somebody_NP = {}; --: NP ; - --something_NP : NP ; - --somewhere_Adv : Adv ; + everybody_NP = {s = \\_=>"buri muntu" ; agr=AgP3 Sg MU_BA}; + everything_NP = {s = \\_=>"buri kintu" ; agr=AgP3 Sg KI_BI}; + somebody_NP = {s = \\_=>"somebody:omuntu omwe" ; agr=AgP3 Sg MU_BA}; --: NP ; + something_NP = {s = \\_=>"Something:ekintu kimwe" ; agr=AgP3 Sg KI_BI} ; -- NP ; + nobody_NP = {s = \\_=>"tihiine muntu" ; agr=AgP3 Sg MU_BA}; + nothing_NP = {s = \\_=>"tihiine kintu" ; agr=AgP3 Sg KI_BI}; + + + -- Subjunctives that_Subj = ss "ngu" ; when_Subj = ss "obu"; because_Subj = ss "ahabwokuba"; - + although_Subj = ss "nobu"; + if_Subj = ss "kuri"; --Adjective modifying Adverbs almost_AdA = {s="haihi"; position=Pre}; --: AdA ; --quite_Adv ss "kimwe"; --: AdA ; used in the pr + somewhere_Adv = mkAdv "hamwe ahantu" (AgrYes (AgP3 Sg HA)); -- : Adv ; + + so_AdA = {s="munônga"; position=Post};--: AdA ; too_AdA = {s="munônga"; position=Post}; --: AdA ; very_AdA = {s="munônga"; position=Post}; --: AdA ; @@ -242,6 +296,23 @@ lin but_PConj = ss "báìtu"; --: PConj ; -- variants béìtu otherwise_PConj = ss "okûndi"; --: PConj ; therefore_PConj = ss "n'ahabwe'êkyo"; --: PConj ; + + + -- Comparative Adverb + as_CAdv = mkCAdv "nka" ; + less_CAdv = mkCAdv "kye ahari"; + more_CAdv = mkCAdv "ingi ahari"; + + + -- Adverbs modifying numerals + at_most_AdN = mkAdN "ekihango"; + + -- Utterances + no_Utt = ss "apaana"; + yes_Utt = ss "yego"; + lin language_title_Utt = ss "Rukiga" ; + + {- and_Conj : Conj ; both7and_DConj : Conj ; -- both...and From c96156116eb3ac568504b4d2247b0f06d252da03 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 26 Oct 2020 09:23:35 +0300 Subject: [PATCH 06/18] =added rukigaa to languages.csv --- languages.csv | 91 ++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/languages.csv b/languages.csv index 0bc0de3b..f5b59da0 100644 --- a/languages.csv +++ b/languages.csv @@ -1,45 +1,46 @@ -Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis -Afr,Afrikaans,afrikaans,,,,,,n,,y -Amh,Amharic,amharic,,,,,n,n,,n -Ara,Arabic,arabic,,,,,,y,,y -Bul,Bulgarian,bulgarian,,,y,,,,,y -Cat,Catalan,catalan,Romance,,y,,,,y,y -Chi,Chinese (simplified),chinese,,,,,,,,y -Dan,Danish,danish,Scand,,y,,,,,y -Dut,Dutch,dutch,,,y,,,,,y -Eng,English,english,,,y,,,,y,y -Est,Estonian,estonian,,,,,,,,y -Eus,Basque,basque,,,,,,,,y -Fin,Finnish,finnish,,,y,,,,y,y -Fre,French,french,Romance,,y,,,,y,y -Ger,German,german,,,,,,,,y -Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n -Gre,Greek,greek,,,,,,,,y -Heb,Hebrew,hebrew,,,,,n,n,,n -Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y -Hun,Hungarian,hungarian,,,y,n,n,n,,n -Ice,Icelandic,icelandic,,,,,,n,,y -Ina,Interlingua,interlingua,,,y,,n,n,,n -Ita,Italian,italian,Romance,,y,,,,y,y -Jpn,Japanese,japanese,,,,,,,,y -Lat,Latin,latin,,,y,,n,n,,n -Lav,Latvian,latvian,,,,,,,y,y -Mlt,Maltese,maltese,,,,,,,,y -Mon,Mongolian,mongolian,,,,,,n,,y -Nep,Nepali,nepali,,,,,,n,,y -Nno,Norwegian (nynorsk),nynorsk,,,y,,,,,y -Nor,Norwegian (bokmål),norwegian,Scand,,y,,,,,y -Pes,Persian,persian,,,,,,,,y -Pnb,Punjabi,punjabi,,,y,,,,,y -Pol,Polish,polish,,,,,,,,y -Por,Portuguese,portuguese,Romance,,y,,,,y,y -Ron,Pomanian,romanian,,,y,,,,,y -Rus,Russian,russian,,,y,,,,,y -Snd,Sindhi,sindhi,,,,,,,,y -Spa,Spanish,spanish,Romance,,y,,,,y,y -Swa,Swahili,swahili,,,,n,n,n,y,n -Swe,Swedish,swedish,Scand,,y,,,,y,y -Tel,Telugu,telugu,,,y,n,n,n,,n -Tha,Thai,thai,,to_thai,,,,,,y -Tur,Turkish,turkish,,,,,n,n,,n -Urd,Urdu,urdu,Hindustani,,,,,,,y +Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis +Afr,Afrikaans,afrikaans,,,,,,n,,y +Amh,Amharic,amharic,,,,,n,n,,n +Ara,Arabic,arabic,,,,,,y,,y +Bul,Bulgarian,bulgarian,,,y,,,,,y +Cat,Catalan,catalan,Romance,,y,,,,y,y +Chi,Chinese (simplified),chinese,,,,,,,,y +Dan,Danish,danish,Scand,,y,,,,,y +Dut,Dutch,dutch,,,y,,,,,y +Eng,English,english,,,y,,,,y,y +Est,Estonian,estonian,,,,,,,,y +Eus,Basque,basque,,,,,,,,y +Fin,Finnish,finnish,,,y,,,,y,y +Fre,French,french,Romance,,y,,,,y,y +Ger,German,german,,,,,,,,y +Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n +Gre,Greek,greek,,,,,,,,y +Heb,Hebrew,hebrew,,,,,n,n,,n +Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y +Hun,Hungarian,hungarian,,,y,n,n,n,,n +Ice,Icelandic,icelandic,,,,,,n,,y +Ina,Interlingua,interlingua,,,y,,n,n,,n +Ita,Italian,italian,Romance,,y,,,,y,y +Jpn,Japanese,japanese,,,,,,,,y +Lat,Latin,latin,,,y,,n,n,,n +Lav,Latvian,latvian,,,,,,,y,y +Mlt,Maltese,maltese,,,,,,,,y +Mon,Mongolian,mongolian,,,,,,n,,y +Nep,Nepali,nepali,,,,,,n,,y +Nno,Norwegian (nynorsk),nynorsk,,,y,,,,,y +Nor,Norwegian (bokmål),norwegian,Scand,,y,,,,,y +Pes,Persian,persian,,,,,,,,y +Pnb,Punjabi,punjabi,,,y,,,,,y +Pol,Polish,polish,,,,,,,,y +Por,Portuguese,portuguese,Romance,,y,,,,y,y +Ron,Pomanian,romanian,,,y,,,,,y +Rus,Russian,russian,,,y,,,,,y +Snd,Sindhi,sindhi,,,,,,,,y +Spa,Spanish,spanish,Romance,,y,,,,y,y +Swa,Swahili,swahili,,,,n,n,n,y,n +Swe,Swedish,swedish,Scand,,y,,,,y,y +Tel,Telugu,telugu,,,y,n,n,n,,n +Tha,Thai,thai,,to_thai,,,,,,y +Tur,Turkish,turkish,,,,,n,n,,n +Urd,Urdu,urdu,Hindustani,,,,,,,y +Cgg,Rukiga,rukiga,,,y,y,n,n,y,y \ No newline at end of file From b776f47c6bd2c506db5cef7730144fe55ab7a635 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 26 Oct 2020 10:11:41 +0300 Subject: [PATCH 07/18] =edited languages.csv --- languages.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages.csv b/languages.csv index f5b59da0..9030c3d8 100644 --- a/languages.csv +++ b/languages.csv @@ -1,10 +1,11 @@ -Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis Afr,Afrikaans,afrikaans,,,,,,n,,y Amh,Amharic,amharic,,,,,n,n,,n Ara,Arabic,arabic,,,,,,y,,y Bul,Bulgarian,bulgarian,,,y,,,,,y Cat,Catalan,catalan,Romance,,y,,,,y,y +Cgg,Rukiga,rukiga,,,y,y,n,n,y,y Chi,Chinese (simplified),chinese,,,,,,,,y +Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis Dan,Danish,danish,Scand,,y,,,,,y Dut,Dutch,dutch,,,y,,,,,y Eng,English,english,,,y,,,,y,y @@ -42,5 +43,4 @@ Swe,Swedish,swedish,Scand,,y,,,,y,y Tel,Telugu,telugu,,,y,n,n,n,,n Tha,Thai,thai,,to_thai,,,,,,y Tur,Turkish,turkish,,,,,n,n,,n -Urd,Urdu,urdu,Hindustani,,,,,,,y -Cgg,Rukiga,rukiga,,,y,y,n,n,y,y \ No newline at end of file +Urd,Urdu,urdu,Hindustani,,,,,,,y \ No newline at end of file From aad7b002aad23f5052be59c34c0a947b7378d655 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 26 Oct 2020 16:00:34 +0300 Subject: [PATCH 08/18] =made changes to Verb Phrase and VPSlash that check if the complements actually exists --- src/rukiga/ParadigmsCgg.gf | 8 +-- src/rukiga/ResCgg.gf | 8 ++- src/rukiga/SentenceCgg.gf | 62 ++++++++++++++---- src/rukiga/VerbCgg.gf | 127 ++++++++++++++++++++++++++++++------- 4 files changed, 164 insertions(+), 41 deletions(-) diff --git a/src/rukiga/ParadigmsCgg.gf b/src/rukiga/ParadigmsCgg.gf index a44f0aaf..5eed44d3 100755 --- a/src/rukiga/ParadigmsCgg.gf +++ b/src/rukiga/ParadigmsCgg.gf @@ -108,7 +108,7 @@ oper mkV2S : V -> Prep -> V2S ; -- e.g. tell (NP) (that S) mkV2S v p = lin V2S (prepV2 v p) ; --mkPrep : Str -> Str ->Bool -> Preposition ; -- e.g. "in front of" - mkPrep : Str -> Str ->Bool -> Preposition; + mkPrep : Str -> Str ->Bool -> Prep; mkPrep first other bool = lin Prep { s = first ; other = other; @@ -213,11 +213,11 @@ mkInterj : Str -> Interj A2V : Type = A2 ; mkV0 : V -> V; mkV0 v = v ; - mkA2 : Str -> Position -> Bool -> Bool ->Bool-> A2 = \a2, pos, isProper, isPrep,isNeg -> - lin A2 ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True}); + mkA2 : Str -> Position -> Bool -> Bool ->Bool-> A2V = \a2, pos, isProper, isPrep,isNeg -> + lin A2V ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True}); --mkA2V : A -> A2V; --mkA2V a = lin A2V (a * {c2 = ""; isPre = True}); - mkA2V : Str -> Position -> Bool -> Bool ->Bool-> A2V =\a2, pos, isProper, isPrep,isNeg -> lin A2V ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True}); + mkA2V : Str -> Position -> Bool -> Bool ->Bool-> A2 =\a2, pos, isProper, isPrep,isNeg -> lin A2 ((mkAdjective a2 pos isProper isPrep isNeg) ** {c2 = ""; isPre = True}); -- Adverbs modifying numerals diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index a6405a02..551f7bec 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -1379,7 +1379,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { adv:Str; containsAdv: Bool; adV:Str; - containsAdV:Bool + containsAdV:Bool; + containsComp : Bool; + containsComp2 : Bool }; -- in VP formation, all verbs are lifted to GVerb, but morphology doesn't need to know this verb2gverb : Verb ->Str -> GVerb = \v, ba -> { @@ -1587,7 +1589,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { adv:Str; containsAdv:Bool; adV:Str; - containsAdV:Bool + containsAdV:Bool; + containsComp : Bool; + containsComp2 : Bool }; --comp is empty diff --git a/src/rukiga/SentenceCgg.gf b/src/rukiga/SentenceCgg.gf index 3d6f5e5d..4365fed7 100755 --- a/src/rukiga/SentenceCgg.gf +++ b/src/rukiga/SentenceCgg.gf @@ -281,8 +281,8 @@ lin - PredVP np vp = case of { - => { + PredVP np vp = case of { + => { s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk subjAgr = np.agr; pres = vp.pres; @@ -293,16 +293,16 @@ lin isPerfBlank = vp.isPerfBlank; {- inf = mkVerbInrf vp.root; - pres = mkVerbPres vp.root; - past = mkVerbPast vp.root; - presPart = mkVerbPresPart vp.root; - pastPart = mkVerbPastPart vp.root; -- subject - -} + pres = mkVerbPres vp.root; + past = mkVerbPast vp.root; + presPart = mkVerbPresPart vp.root; + pastPart = mkVerbPastPart vp.root; -- subject + -} --root = vp.root ; compl = vp.adV }; - <_, _> => { + <_, _,True,False> => { s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk subjAgr = np.agr; pres = vp.pres; @@ -313,13 +313,51 @@ lin isPerfBlank = vp.isPerfBlank; {- inf = mkVerbInrf vp.root; - pres = mkVerbPres vp.root; - past = mkVerbPast vp.root; - presPart = mkVerbPresPart vp.root; - pastPart = mkVerbPastPart vp.root; -- subject + pres = mkVerbPres vp.root; + past = mkVerbPast vp.root; + presPart = mkVerbPresPart vp.root; + pastPart = mkVerbPastPart vp.root; -- subject -} --root = vp.root ; compl = mkSubjClitic np.agr ++ vp.comp --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp + }; + <_, _,True, True> => { + s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk + subjAgr = np.agr; + pres = vp.pres; + perf = vp.perf; + root = vp.s; + --morphs = vp.morphs; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; + {- + 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 ++ vp.comp ++ vp.comp2--mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp + }; + <_, _,_, _> => { + s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk + subjAgr = np.agr; + pres = vp.pres; + perf = vp.perf; + root = vp.s; + --morphs = vp.morphs; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; + {- + 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 } };--: NP -> VP -> Cl ; -- John walks / John does not walk diff --git a/src/rukiga/VerbCgg.gf b/src/rukiga/VerbCgg.gf index 44e778ff..dcaad500 100755 --- a/src/rukiga/VerbCgg.gf +++ b/src/rukiga/VerbCgg.gf @@ -20,7 +20,9 @@ lin adv =[]; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = False; + containsComp2 = False }; --: V -> VP; -- sleep --ignoring object agreement -- UseComp : Comp -> VP ; -- be warm means complement of a copula especially adjectival Phrase @@ -45,7 +47,9 @@ lin adv = []; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = False }; _ => { s = mkBecome.s ++ BIND ++mkBecome.pres++ comp.s; --Assuming there is no AP which is prepositional @@ -63,7 +67,9 @@ lin adv = []; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = False } }; --its not generating any sentence @@ -97,7 +103,9 @@ lin adv=[]; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = False; + containsComp2 =False }; --Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her) Slash2V3 v3 np ={ @@ -114,7 +122,9 @@ lin adv = []; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 =False }; --Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her @@ -132,7 +142,9 @@ lin adv = []; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = True }; --SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy SlashVV vv vpslash ={ @@ -152,7 +164,9 @@ lin adv = []; containsAdv = False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = False; + containsComp2 = False }; --SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go @@ -176,7 +190,9 @@ lin adv = []; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = vpslash.containsComp2 }; -- AdvVP : VP -> Adv -> VP ; -- sleep here -- VerbPhrase: Type = {s:Str; morphs: VMorphs ; comp:Str ; isCompApStem : Bool; agr : AgrExist}; @@ -189,7 +205,7 @@ lin isPresBlank = vp.isPresBlank; isPerfBlank = vp.isPerfBlank; comp = adv.s; - comp2 = []; + comp2 = vp.comp2; ap =[]; isCompApStem = False; agr = AgrNo; @@ -197,7 +213,9 @@ lin adv = adv.s; containsAdv =True; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = vp.containsComp2 }; -- AdVVP : AdV -> VP -> VP ; -- always sleep @@ -217,7 +235,9 @@ lin adv = []; containsAdv =False; adV =adV.s; - containsAdV = True + containsAdV = True; + containsComp = vp.containsComp; + containsComp2 = vp.containsComp2 }; --AdvVPSlash : VPSlash -> Adv -> VPSlash ; -- use (it) here @@ -240,7 +260,9 @@ lin adv = adv.s; containsAdv =True; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = vpslash.containsComp; + containsComp2 = vpslash.containsComp2 }; -- Adverb directly attached to verb --AdVVPSlash : AdV -> VPSlash -> VPSlash ; -- always use (it) @@ -262,7 +284,9 @@ lin adv = []; containsAdv =False; adV =adV.s; - containsAdV = True + containsAdV = True; + containsComp = vpslash.containsComp; + containsComp2 = vpslash.containsComp2 }; -- Verb phrases are constructed from verbs by providing their -- complements. There is one rule for each verb category. @@ -272,9 +296,14 @@ lin --This function requires the remodelling of VP to accomodate two Verbs. -- -} - ComplVV vv vp = let vpPres = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres; - in case vv.whenUsed of { - VVPerf => { + ComplVV vv vp = let + -- restofVerbPres = case vp.isPresBlank of { + -- True => "a"; + -- False => vp.pres; + -- }; + vpPres = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres; + in case of { + => { s= vv.s ++ BIND ++ vv.perf ++ vpPres; pres = [];--vv.pres; perf= []; -- vv.perf; @@ -289,9 +318,11 @@ lin adv =[]; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = True }; - _ => { + <_,True,True> => { s= vv.s ++ BIND ++ vv.pres ++ vpPres; pres = [];--vv.pres; perf= [];--vv.perf; @@ -307,7 +338,49 @@ lin adv =[]; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = True + }; + <_,True,_> => { + s= vv.s ++ BIND ++ vv.pres ++ vpPres; + pres = [];--vv.pres; + perf= [];--vv.perf; + --morphs = vv.morphs; + isPresBlank = True; + isPerfBlank = True; + comp=vp.comp ; + comp2 = []; + ap = []; + isCompApStem = False; + agr = AgrNo; + isRegular = vv.isRegular; + adv =[]; + containsAdv =False; + adV =[]; + containsAdV = False; + containsComp = True; + containsComp2 = False + }; + <_,_,_> => { + s= vv.s ++ BIND ++ vv.pres ++ vpPres; + pres = [];--vv.pres; + perf= [];--vv.perf; + --morphs = vv.morphs; + isPresBlank = True; + isPerfBlank = True; + comp=[] ; + comp2 = []; + ap = []; + isCompApStem = False; + agr = AgrNo; + isRegular = vv.isRegular; + adv =[]; + containsAdv =False; + adV =[]; + containsAdV = False; + containsComp = False; + containsComp2 = False } }; @@ -328,7 +401,9 @@ lin adv =[]; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = False }; {- @@ -351,7 +426,9 @@ lin adv =[]; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = True; + containsComp2 = False }; {- @@ -379,7 +456,9 @@ lin adv =[]; containsAdv =False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = False; + containsComp2 = False }; -- Copula alone @@ -393,7 +472,9 @@ lin adv = []; containsAdv = False; adV =[]; - containsAdV = False + containsAdV = False; + containsComp = False; + containsComp2 = False }; {- --1 The construction of verb phrases From 9ba407f05152c4c0835dfff2a0255f5fa701a029 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 26 Oct 2020 16:21:20 +0300 Subject: [PATCH 09/18] =Implemented the abstract function fun --- src/rukiga/PhraseCgg.gf | 1 + src/rukiga/SentenceCgg.gf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rukiga/PhraseCgg.gf b/src/rukiga/PhraseCgg.gf index 92b6e3fb..9c8f7e70 100755 --- a/src/rukiga/PhraseCgg.gf +++ b/src/rukiga/PhraseCgg.gf @@ -10,6 +10,7 @@ lin NoPConj = {s = ""} ; NoVoc = {s = ""} ; + VocNP np = {s=np.s !Nom} ; -- Utterances are formed from sentences, questions, and imperatives. UttNP np = {s= np.s!Acc}; --: NP -> Utt ; diff --git a/src/rukiga/SentenceCgg.gf b/src/rukiga/SentenceCgg.gf index 4365fed7..dbbd2a75 100755 --- a/src/rukiga/SentenceCgg.gf +++ b/src/rukiga/SentenceCgg.gf @@ -338,7 +338,7 @@ lin pastPart = mkVerbPastPart vp.root; -- subject -} --root = vp.root ; - compl = mkSubjClitic np.agr ++ vp.comp ++ vp.comp2--mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp + compl = mkSubjClitic np.agr ++ vp.comp ++ vp.comp2 --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp }; <_, _,_, _> => { s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk From 24d3d2abaaab25801583c8f50a7e7bb2e15c9c25 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 26 Oct 2020 16:41:58 +0300 Subject: [PATCH 10/18] =Implemented the abstract function VocNP and PConjConj in PhraseCgg.gf --- src/rukiga/PhraseCgg.gf | 1 + src/rukiga/ResCgg.gf | 1 + 2 files changed, 2 insertions(+) diff --git a/src/rukiga/PhraseCgg.gf b/src/rukiga/PhraseCgg.gf index 9c8f7e70..d8b6eae0 100755 --- a/src/rukiga/PhraseCgg.gf +++ b/src/rukiga/PhraseCgg.gf @@ -9,6 +9,7 @@ lin PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; NoPConj = {s = ""} ; + PConjConj conj = {s = conj.s ! AConj Other} ; NoVoc = {s = ""} ; VocNP np = {s=np.s !Nom} ; diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index 551f7bec..718618f2 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -1626,6 +1626,7 @@ oper --Conjunctions + -- arguments to conjunctions determine which version is used Conjunction : Type = {s : AgrConj =>Str ;s2 : Str ; n : Number} ; -- For $Numeral$. From 02d92f6cc9a0646f188636bca466a2133c2f6807 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 26 Oct 2020 23:34:59 +0300 Subject: [PATCH 11/18] =Modified UseComp to correctly apply Adverbs, Adjectives and Nouns as proper complements when forming a VP based on the verb to be. However in Rukiga, sometimes the verb ba or ri are used. I have left the application of the right form to post-processing --- src/rukiga/CatCgg.gf | 2 +- src/rukiga/IdiomCgg.gf | 5 ++++- src/rukiga/ResCgg.gf | 2 +- src/rukiga/SentenceCgg.gf | 29 +++++++++++++++++++----- src/rukiga/VerbCgg.gf | 46 ++++++++++++++++++++++++++++++++++++--- 5 files changed, 73 insertions(+), 11 deletions(-) diff --git a/src/rukiga/CatCgg.gf b/src/rukiga/CatCgg.gf index e46cf623..419b3dd7 100755 --- a/src/rukiga/CatCgg.gf +++ b/src/rukiga/CatCgg.gf @@ -6,7 +6,7 @@ concrete CatCgg of Cat = CommonX -[Adv,IAdv, AdA]** lincat - Imp = {s : Res. ImpPol=> Str} ; + Imp = {s : Res.ImpPol=> Str} ; QS = {s : Str} ; -- Note: SS is a shorthand for {s:Str}, defined in Prelude.gf diff --git a/src/rukiga/IdiomCgg.gf b/src/rukiga/IdiomCgg.gf index ebc7b4d0..d2b32968 100755 --- a/src/rukiga/IdiomCgg.gf +++ b/src/rukiga/IdiomCgg.gf @@ -1,8 +1,11 @@ --# -path=.:../prelude:../abstract:../common concrete IdiomCgg of Idiom = CatCgg ** - open Prelude, ResCgg in { + open Prelude,Predef, ResCgg in { + +lin + ImpPl1 vp = {s="tu" ++ BIND ++ vp.s ++ BIND ++ vp.pres ++ BIND ++ "6e"}; -- let's go {- --1 Idiom: Idiomatic Expressions diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index 718618f2..eeeb4eba 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -1622,7 +1622,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { param CompSource = NounP | ADverb | AdjP | CommonNoun; oper - Comp : Type = {s:Str; source : CompSource }; + Comp : Type = {s:Str; source : CompSource}; --Conjunctions diff --git a/src/rukiga/SentenceCgg.gf b/src/rukiga/SentenceCgg.gf index dbbd2a75..93703dc3 100755 --- a/src/rukiga/SentenceCgg.gf +++ b/src/rukiga/SentenceCgg.gf @@ -281,8 +281,8 @@ lin - PredVP np vp = case of { - => { + PredVP np vp = case of { + => { s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk subjAgr = np.agr; pres = vp.pres; @@ -301,8 +301,27 @@ lin --root = vp.root ; compl = vp.adV }; + => { + s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk + subjAgr = np.agr; + pres = vp.pres; + perf = vp.perf; + root = vp.s; + --morphs = vp.morphs; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; + {- + 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.adv + }; - <_, _,True,False> => { + <_, _,_,True,False> => { s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk subjAgr = np.agr; pres = vp.pres; @@ -321,7 +340,7 @@ lin --root = vp.root ; compl = mkSubjClitic np.agr ++ vp.comp --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp }; - <_, _,True, True> => { + <_, _,_,True, True> => { s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk subjAgr = np.agr; pres = vp.pres; @@ -340,7 +359,7 @@ lin --root = vp.root ; compl = mkSubjClitic np.agr ++ vp.comp ++ vp.comp2 --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp }; - <_, _,_, _> => { + <_, _,_,_, _> => { s = np.s ! Nom; --: NP -> VP -> Cl ; -- John walks / John does not walk subjAgr = np.agr; pres = vp.pres; diff --git a/src/rukiga/VerbCgg.gf b/src/rukiga/VerbCgg.gf index dcaad500..7fec967b 100755 --- a/src/rukiga/VerbCgg.gf +++ b/src/rukiga/VerbCgg.gf @@ -32,7 +32,7 @@ lin --in case comp.source of{ AdjP => { - s = mkBecome.s ++ BIND ++ mkBecome.pres; --Assuming there is no AP which is prepositional + s = mkBecome.s ; --Assuming there is no AP which is prepositional pres =[]; perf = []; isPresBlank = True; @@ -51,8 +51,8 @@ lin containsComp = True; containsComp2 = False }; - _ => { - s = mkBecome.s ++ BIND ++mkBecome.pres++ comp.s; --Assuming there is no AP which is prepositional + ADverb => { + s = mkBecome.s ; --Assuming there is no AP which is prepositional pres =[]; perf = []; --morphs=\\form,morphs=>[]; @@ -64,6 +64,46 @@ lin isCompApStem = False; agr = AgrNo; isRegular = False; + adv = comp.s; + containsAdv =True; + adV =[]; + containsAdV = False; + containsComp = False; + containsComp2 = False + }; + NounP => { + s = mkBecome.s ; --Assuming there is no AP which is prepositional + pres =[]; + perf = []; + --morphs=\\form,morphs=>[]; + isPresBlank = True; + isPerfBlank = True; + comp = comp.s; + comp2 = []; + ap = []; + isCompApStem = False; + agr = AgrNo; + isRegular = False; + adv = []; + containsAdv =False; + adV =[]; + containsAdV = False; + containsComp = True; + containsComp2 = False + }; + _ => { + s = mkBecome.s ; --Assuming there is no AP which is prepositional + pres =[]; + perf = []; + --morphs=\\form,morphs=>[]; + isPresBlank = True; + isPerfBlank = True; + comp = comp.s; + comp2 = []; + ap = []; + isCompApStem = False; + agr = AgrNo; + isRegular = False; adv = []; containsAdv =False; adV =[]; From 0c5d685d8adab92b920cbeaa5b362b3f514a5bb3 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Mon, 26 Oct 2020 23:37:18 +0300 Subject: [PATCH 12/18] =corrections to languages.csv made. However, my files do not have Korean --- languages.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.csv b/languages.csv index 9030c3d8..e87fef32 100644 --- a/languages.csv +++ b/languages.csv @@ -1,3 +1,4 @@ +Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis Afr,Afrikaans,afrikaans,,,,,,n,,y Amh,Amharic,amharic,,,,,n,n,,n Ara,Arabic,arabic,,,,,,y,,y @@ -5,7 +6,6 @@ Bul,Bulgarian,bulgarian,,,y,,,,,y Cat,Catalan,catalan,Romance,,y,,,,y,y Cgg,Rukiga,rukiga,,,y,y,n,n,y,y Chi,Chinese (simplified),chinese,,,,,,,,y -Code,Name,Directory,Functor,Unlexer,Present,All,Try,Symbolic,Compatibility,Synopsis Dan,Danish,danish,Scand,,y,,,,,y Dut,Dutch,dutch,,,y,,,,,y Eng,English,english,,,y,,,,y,y From 2ef7fed0d217d97441795eefb5f06c8d2db6065c Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Tue, 27 Oct 2020 00:20:51 +0300 Subject: [PATCH 13/18] =there is a bug with CompNP because we cannot fix Number agreement for the Noun. A hack can be to include the Noun info into the nounphrase --- src/rukiga/LexiconCgg.gf | 2 +- src/rukiga/SentenceCgg.gf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rukiga/LexiconCgg.gf b/src/rukiga/LexiconCgg.gf index 08b1f2c1..a7e03527 100755 --- a/src/rukiga/LexiconCgg.gf +++ b/src/rukiga/LexiconCgg.gf @@ -161,7 +161,7 @@ lin television_N = mkN "TV" N_N; doctor_N = mkN "omushaho" MU_BA; clever_A =mkAdjective "amagyezi" Post False True False; - laugh_V = mkV "sheka"; + laugh_V = mkV "shek"; beautiful_A = mkAdjective "rungi" Post False False False; airplane_N = mkN "endegye" N_N; year_N = mkN "omwaka" "emyaka" MU_MI; diff --git a/src/rukiga/SentenceCgg.gf b/src/rukiga/SentenceCgg.gf index 93703dc3..e63ab5bf 100755 --- a/src/rukiga/SentenceCgg.gf +++ b/src/rukiga/SentenceCgg.gf @@ -51,9 +51,9 @@ lin }; {-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-} => case cl.isPerfBlank of { - True => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ Predef.BIND ++ "ra" ++ + True => {s = subj ++ "ta" ++ Predef.BIND ++ clitic ++ Predef.BIND ++ "ra" ++ Predef.BIND ++ root ++ Predef.BIND ++ "ire" ++ compl}; - False => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "ra" ++ Predef.BIND ++ + False => {s = subj ++ "ta" ++ Predef.BIND ++ clitic ++ "ra" ++ Predef.BIND ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl} }; From e14cdf99e3099927de45625254cc87304fe67f3e Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Tue, 27 Oct 2020 01:17:53 +0300 Subject: [PATCH 14/18] modifeid mkThis in ResCgg to remove unnecessary bind --- src/rukiga/ResCgg.gf | 60 +++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index eeeb4eba..3766eca2 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -703,35 +703,35 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { -- TThis is for demonstrative pronouns which can also be use as Quantifiers -- How can it be done without code repeation? mkThis = table{ - AgMUBAP1 Sg => mkClitic "ogu"; - AgMUBAP1 Pl => mkClitic "aba" ; - AgMUBAP2 Sg => mkClitic "ogu"; --probably an error check your grammar book - AgMUBAP2 Pl => mkClitic "aba" ; - AgP3 Sg MU_BA => mkClitic "ogu"; - AgP3 Pl MU_BA => mkClitic "aba" ; - AgP3 Pl ZERO_BU => mkClitic "obu" ; - AgP3 Sg BU_MA => mkClitic "obu" ; - AgP3 Pl (KA_BU | RU_BU) => mkClitic "obu" ; - AgP3 Pl (KI_BI | ZERO_BI) => mkClitic "ebi" ; - AgP3 Pl (ZERO_MA | KU_MA | RI_MA | I_MA | BU_MA) => mkClitic "aga"; - AgP3 Sg ZERO_MA => mkClitic "aga"; - AgP3 ( Pl) HA => mkClitic "aha" ; -- of place HA - AgP3 ( Pl) MU => mkClitic "omu" ; -- of place MU - AgP3 ( Pl) KU => mkClitic "oku" ; -- of place KU - AgP3 Sg (I_ZERO | I_MA | RI_MA) =>mkClitic "eri" ; - AgP3 Sg (KA_ZERO | KA_BU) =>mkClitic "aka" ; - AgP3 Sg KI_BI => mkClitic "eki" ; - AgP3 Sg (KU_ZERO | KU_MA) => mkClitic "oku" ; - AgP3 Sg (MU_MI | MU_ZERO) => mkClitic "ogu" ; - AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => mkClitic "oru" ; - AgP3 Pl (ZERO_TU | KA_TU) =>mkClitic "otu" ; - AgP3 Sg (ZERO_ZERO | N_N) =>mkClitic "egi" ; - AgP3 Pl ZERO_MI =>mkClitic "egi" ; - AgP3 Pl MU_MI => mkClitic "egi"; - AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) =>mkClitic "ezi" ; - AgP3 Sg GU_GA => mkClitic "ogu" ; - AgP3 Pl GU_GA => mkClitic "aga" ; - _ => mkClitic "XXXThisThese" -- error checking for any case not catered for + AgMUBAP1 Sg => "ogu"; + AgMUBAP1 Pl => "aba" ; + AgMUBAP2 Sg => "ogu"; --probably an error check your grammar book + AgMUBAP2 Pl => "aba" ; + AgP3 Sg MU_BA => "ogu"; + 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) => "aga"; + AgP3 Sg ZERO_MA => "aga"; + AgP3 ( Pl) HA => "aha" ; -- of place HA + AgP3 ( Pl) MU => "omu" ; -- of place MU + AgP3 ( Pl) KU => "oku" ; -- 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) => "ogu" ; + AgP3 Sg (RU_ZERO | RU_BU | RU_MA| RU_N) => "oru" ; + AgP3 Pl (ZERO_TU | KA_TU) => "otu" ; + AgP3 Sg (ZERO_ZERO | N_N) => "egi" ; + AgP3 Pl ZERO_MI => "egi" ; + AgP3 Pl MU_MI => "egi"; + AgP3 Pl (ZERO_ZERO | ZERO_N | N_N | RU_N) => "ezi" ; + AgP3 Sg GU_GA => "ogu" ; + AgP3 Pl GU_GA => "aga" ; + _ => "XXXThisThese" -- error checking for any case not catered for }; @@ -1283,6 +1283,8 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { Preposition : Type = {s : Str; other : Str; isGenPrep : Bool}; NounPhrase : Type = {s :Case => Str; agr : Agreement}; + + --NounPhrase : Type = {s : Number=> NounState => Str; agr : Agreement}; {- Operation to create Noun Phrases from a Determiner and Nouns. From fc7bede5633056f5a9f715e9b5bb8cd6a39a13e7 Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Tue, 27 Oct 2020 01:35:41 +0300 Subject: [PATCH 15/18] modified the fun UttVP in PhraseCgg.gf to allow formation of Verb Phrase Utterances with various complements e.g to sleep == kugwenjegyera --- src/rukiga/PhraseCgg.gf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rukiga/PhraseCgg.gf b/src/rukiga/PhraseCgg.gf index d8b6eae0..72f19571 100755 --- a/src/rukiga/PhraseCgg.gf +++ b/src/rukiga/PhraseCgg.gf @@ -33,8 +33,14 @@ lin --UttAdv : Adv -> Utt ; -- here UttAdv adv = {s= adv.s}; - --can be improved upon - UttVP vp = {s = vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2 ++ vp.ap }; + -- better but can be improved upon + UttVP vp = case of { + => {s = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres ++ vp.adV}; + =>{s = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres ++ vp.adv}; + <_, _,_,True,False> => {s = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres ++ vp.comp}; + <_, _,_,True, True> => {s = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++ vp.comp2}; + <_, _,_,_, _> => {s = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres} + }; UttAP ap = {s=ap.s!(AgP3 Sg KI_BI)}; From c4bffc32f18f499b455dee384849ac48894c819c Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 27 Oct 2020 10:10:24 +0100 Subject: [PATCH 16/18] Merge languages.csv to the latest --- languages.csv | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/languages.csv b/languages.csv index e87fef32..50a77eaa 100644 --- a/languages.csv +++ b/languages.csv @@ -6,6 +6,7 @@ Bul,Bulgarian,bulgarian,,,y,,,,,y Cat,Catalan,catalan,Romance,,y,,,,y,y Cgg,Rukiga,rukiga,,,y,y,n,n,y,y Chi,Chinese (simplified),chinese,,,,,,,,y +Cze,Czech,czech,,,,,,n,,y Dan,Danish,danish,Scand,,y,,,,,y Dut,Dutch,dutch,,,y,,,,,y Eng,English,english,,,y,,,,y,y @@ -13,17 +14,18 @@ Est,Estonian,estonian,,,,,,,,y Eus,Basque,basque,,,,,,,,y Fin,Finnish,finnish,,,y,,,,y,y Fre,French,french,Romance,,y,,,,y,y -Ger,German,german,,,,,,,,y +Ger,German,german,,,y,,,,,y Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n Gre,Greek,greek,,,,,,,,y Heb,Hebrew,hebrew,,,,,n,n,,n Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y -Hun,Hungarian,hungarian,,,y,n,n,n,,n +Hun,Hungarian,hungarian,,,n,y,y,y,n,n Ice,Icelandic,icelandic,,,,,,n,,y Ina,Interlingua,interlingua,,,y,,n,n,,n Ita,Italian,italian,Romance,,y,,,,y,y Jpn,Japanese,japanese,,,,,,,,y -Lat,Latin,latin,,,y,,n,n,,n +Kor,Korean,korean,,,n,y,y,y,n,n +Lat,Latin,latin,,,,,y,y,n,y Lav,Latvian,latvian,,,,,,,y,y Mlt,Maltese,maltese,,,,,,,,y Mon,Mongolian,mongolian,,,,,,n,,y @@ -34,13 +36,15 @@ Pes,Persian,persian,,,,,,,,y Pnb,Punjabi,punjabi,,,y,,,,,y Pol,Polish,polish,,,,,,,,y Por,Portuguese,portuguese,Romance,,y,,,,y,y -Ron,Pomanian,romanian,,,y,,,,,y +Ron,Romanian,romanian,,,y,,,,,y Rus,Russian,russian,,,y,,,,,y +Slo,Slovak,slovak,,,,,,n,,y +Slv,Slovenian,slovenian,,,,,n,n,,n Snd,Sindhi,sindhi,,,,,,,,y Spa,Spanish,spanish,Romance,,y,,,,y,y -Swa,Swahili,swahili,,,,n,n,n,y,n +Swa,Swahili,swahili,Bantu,,,n,n,n,n,n Swe,Swedish,swedish,Scand,,y,,,,y,y Tel,Telugu,telugu,,,y,n,n,n,,n Tha,Thai,thai,,to_thai,,,,,,y -Tur,Turkish,turkish,,,,,n,n,,n -Urd,Urdu,urdu,Hindustani,,,,,,,y \ No newline at end of file +Tur,Turkish,turkish,,,y,,,n,,n +Urd,Urdu,urdu,Hindustani,,,,,,,y From 0875fde0e7a32f779f0d61f1f3a5d10ff39cd8b3 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 27 Oct 2020 10:18:49 +0100 Subject: [PATCH 17/18] Add comments to Coordination.gf --- src/prelude/Coordination.gf | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/prelude/Coordination.gf b/src/prelude/Coordination.gf index 53d664f6..706bc547 100644 --- a/src/prelude/Coordination.gf +++ b/src/prelude/Coordination.gf @@ -3,25 +3,43 @@ resource Coordination = open Prelude in { param ListSize = TwoElem | ManyElem ; -oper +oper + -- Type of [X] for any X whose lincat is {s : Str}. + -- example : ListX = {s1 = "a , b" ; s2 = "c"} ListX = {s1,s2 : Str} ; - twoStr : (x,y : Str) -> ListX = \x,y -> --stores two strings in a record + -- Helper funs for twoSS and conjSS + twoStr : (x,y : Str) -> ListX = \x,y -> {s1 = x ; s2 = y} ; consStr : Str -> ListX -> Str -> ListX = \comma,xs,x -> {s1 = xs.s1 ++ comma ++ xs.s2 ; s2 = x } ; - twoSS : (_,_ : SS) -> ListX = \x,y -> --stores two string records into one record + -- Create a ListX from two Xs. Example: + -- x = {s = "here"} ; + -- y = {s = "there"} ; + -- twoSS x y ==> {s1 = "here" ; s2 = "there"} + twoSS : (_,_ : SS) -> ListX = \x,y -> twoStr x.s y.s ; - consSS : Str -> ListX -> SS -> ListX = \comma,xs,x -> -- Combines and a record into a record separated by a comma. + + -- Add new X to a ListX, along with a separator. Example: + -- comma = "," + -- xs = {s1 = "here" ; s2 = "there"} + -- x = {s = "everywhere"} + -- consSS comma xs x ==> {s1 = "here , there" ; s2 = "everywhere"} + consSS : Str -> ListX -> SS -> ListX = \comma,xs,x -> consStr comma xs x.s ; Conjunction : Type = SS ; ConjunctionDistr : Type = {s1 : Str ; s2 : Str} ; + -- Form an X from Conjunction and ListX. Example: + -- or = {s = "and"} + -- xs = {s1 = "here , there" ; s2 = "everywhere"} + -- conjunctX or xs = {s = "here, there and everywhere"} conjunctX : Conjunction -> ListX -> Str = \or,xs -> xs.s1 ++ or.s ++ xs.s2 ; - + + -- Like conjunctX, but conjunction has two parts: "both here and there" conjunctDistrX : ConjunctionDistr -> ListX -> Str = \or,xs -> or.s1 ++ xs.s1 ++ or.s2 ++ xs.s2 ; @@ -33,7 +51,10 @@ oper -- all this lifted to tables - ListTable : PType -> Type = \P -> {s1,s2 : P => Str} ; --Type family for tables + -- Type for a table with the given parameter P on the LHS. + -- For example, if the lincat for X is {s : Number => Str}, + -- then the lincat for [X] should be ListTable Number, which expands to {s1, s2 : Number => Str}. + ListTable : PType -> Type = \P -> {s1,s2 : P => Str} ; twoTable : (P : PType) -> (_,_ : {s : P => Str}) -> ListTable P = \_,x,y -> {s1 = x.s ; s2 = y.s} ; From 43e39af33a8999ac0d0e81f0aa1b00fd873c909f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 27 Oct 2020 10:24:12 +0100 Subject: [PATCH 18/18] (Cgg) Remove the extra -path line Removed --# -path=.:../abstract:../../prelude:../common --- src/rukiga/ParadigmsCgg.gf | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rukiga/ParadigmsCgg.gf b/src/rukiga/ParadigmsCgg.gf index 5eed44d3..278b01ec 100755 --- a/src/rukiga/ParadigmsCgg.gf +++ b/src/rukiga/ParadigmsCgg.gf @@ -1,5 +1,4 @@ --# -path=.:../prelude:../abstract:../common ---# -path=.:../abstract:../../prelude:../common --1 Rukiga Lexical Paradigms --