mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
Merge pull request #341 from inariksit/swahili
Rename Kiswahili -> Swahili
This commit is contained in:
@@ -41,7 +41,7 @@ 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
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
incomplete concrete CatBantu of Cat =
|
||||
CommonX - [Pol]
|
||||
CommonX
|
||||
** open ResBantu, Prelude, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
@@ -7,8 +7,6 @@ incomplete concrete CatBantu of Cat =
|
||||
|
||||
lincat
|
||||
|
||||
Pol = {s : Str ; b : Bool} ;
|
||||
|
||||
S = {s : Str} ;
|
||||
QS = {s : QForm => Str} ;
|
||||
RS = {s : Agr => Str ; c : NPCase} ; -- c for it clefts
|
||||
@@ -16,7 +14,7 @@ incomplete concrete CatBantu of Cat =
|
||||
|
||||
-- Sentence
|
||||
|
||||
-- Cl = {s : Tense => Anteriority => Bool => Str} ;
|
||||
Cl = {s : Tense => Anteriority => Bool => Str} ;
|
||||
-- ClSlash = {
|
||||
-- s : ResKam.Tense => Anteriority => Bool => Str ;
|
||||
-- } ;
|
||||
|
||||
@@ -11,6 +11,7 @@ flags
|
||||
oper
|
||||
npNom : NPCase = NCase Nom ;
|
||||
npLoc : NPCase = NCase Loc ;
|
||||
NPAcc : NPCase = NCase Nom ; -- Added this so that swahili compiles. /IL2020
|
||||
npcase2case : NPCase -> Case = \nc -> case nc of {NCase c => c ; _ => Nom} ;
|
||||
|
||||
|
||||
@@ -81,14 +82,3 @@ oper
|
||||
finalComma : Str = pre {"," | "." => []; "" => SOFT_BIND ++ ","; _ => []} ;
|
||||
frontComma : Str = SOFT_BIND ++ "," ;
|
||||
}
|
||||
|
||||
-- insertObject:
|
||||
-- p -cat=Cl -tr "la femme te l' envoie"
|
||||
-- PredVP (DetCN (DetSg DefSg NoOrd) (UseN woman_N))
|
||||
-- (ComplV3 send_V3 (UsePron he_Pron) (UsePron thou_Pron))
|
||||
-- la femme te l' a envoyé
|
||||
--
|
||||
-- p -cat=Cl -tr "la femme te lui envoie"
|
||||
-- PredVP (DetCN (DetSg DefSg NoOrd) (UseN woman_N))
|
||||
-- (ComplV3 send_V3 (UsePron thou_Pron) (UsePron he_Pron))
|
||||
-- la femme te lui a envoyée
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
incomplete concrete SentenceBantu of Sentence =
|
||||
CatBantu ** open Prelude, CommonBantu, ResBantu in {
|
||||
{-
|
||||
flags optimize=all_subs ;
|
||||
coding=utf8 ;
|
||||
|
||||
lin
|
||||
|
||||
|
||||
PredVP np vp = mkClause (np.s ! npNom) np.a vp ;
|
||||
|
||||
PredVP np vp = mkClause (np.s ! npNom) (agrFeatures np.a) vp ;
|
||||
{-
|
||||
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
|
||||
|
||||
ImpVP vp = {
|
||||
@@ -43,11 +39,12 @@ incomplete concrete SentenceBantu of Sentence =
|
||||
EmbedS s = {s = conjThat ++ s.s} ;
|
||||
EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||
EmbedVP vp = {s = infVP VVInf vp Simul CPos (agrP3 Sg)} ; --- agr
|
||||
UseCl t p cl = {
|
||||
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.b } ;
|
||||
-}
|
||||
UseCl t p cl =
|
||||
let b : Bool = case p.p of {Pos => True ; _ => False}
|
||||
in {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! b} ;
|
||||
|
||||
-- UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! p.b} ;
|
||||
UseQCl t p cl = {
|
||||
{- UseQCl t p cl = {
|
||||
s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! q
|
||||
} ;
|
||||
UseRCl t p cl = {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
incomplete concrete VerbBantu of Verb =
|
||||
CatBantu ** open Prelude, CommonBantu, ResBantu in {
|
||||
{-
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV = predV ;
|
||||
|
||||
{-
|
||||
SlashV2a v = predV v ** {c2 = v.c2 ; gapInMiddle = False} ;
|
||||
Slash2V3 v np =
|
||||
insertObjc (\\_ => v.c2 ++ np.s ! NPAcc) (predV v ** {c2 = v.c3 ; gapInMiddle = False}) ;
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
concrete AdjectiveKis of Adjective = CatKis **AdjectiveBantu-[ComparA,UseComparA,ComplA2]
|
||||
with (ResBantu = ResKis)** open DiffKis in
|
||||
{
|
||||
flags coding=utf8;
|
||||
lin
|
||||
ComparA a np = {
|
||||
s = \\g,n => a.s !AAdj g n ++ conjThan ++ np.s ! npNom ;
|
||||
isPre = False} ;
|
||||
|
||||
UseComparA a = {s = \\g,n=> a.s !AAdj g n;isPre = True};
|
||||
|
||||
ComplA2 a np = {
|
||||
s = \\g,n => a.s !AAdj g n ++ a.c2 ++ np.s ! NPAcc;
|
||||
isPre = False
|
||||
} ;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
concrete AdverbKis of Adverb = CatKis **AdverbBantu -[ComparAdvAdj,ComparAdvAdjS] with
|
||||
(ResBantu = ResKis)** open DiffKis in
|
||||
{
|
||||
flags coding=utf8;
|
||||
lin
|
||||
ComparAdvAdj cadv a np =let agr = complAgr np.a
|
||||
in {
|
||||
s = cadv.s ++ a.s !AAdj agr.g agr.n ++ cadv.p ++ np.s ! npNom
|
||||
} ;
|
||||
ComparAdvAdjS cadv a s = {
|
||||
s = cadv.s ++ a.s !AAdj G1 Sg ++ cadv.p ++ s.s
|
||||
} ;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
concrete CatKis of Cat = CommonX - [Pol]
|
||||
** CatBantu with (ResBantu = ResKis);
|
||||
@@ -1,2 +0,0 @@
|
||||
concrete ConjunctionKis of Conjunction = CatKis ** ConjunctionBantu with
|
||||
(ResBantu = ResKis);
|
||||
@@ -1,30 +0,0 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarKis of Grammar =
|
||||
NounKis,
|
||||
VerbKis,
|
||||
AdjectiveKis,
|
||||
AdverbKis,
|
||||
NumeralKis,
|
||||
SentenceKis,
|
||||
QuestionKis,
|
||||
RelativeKis,
|
||||
ConjunctionKis,
|
||||
PhraseKis,
|
||||
TextX - [Pol,PPos,PNeg,Pres],
|
||||
StructuralKis,
|
||||
IdiomKis,
|
||||
TenseX - [Pol,PPos,PNeg,Pres]
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text;
|
||||
|
||||
--lin
|
||||
--PPos = {s = [] ; p = CPos} ;
|
||||
-- PNeg = {s = [] ; p = CNeg True} ; -- contracted: don't
|
||||
--PPos = {s = [] ; b = True} ;
|
||||
-- PNeg = {s = [] ; b = False} ;
|
||||
-- TPres = {s = [] ; t = ResKis.Pres} ;
|
||||
-- TPast = {s = [] ; t = ResKis.Past };
|
||||
-- TFut = {s = [] ; t = ResKis.Fut };
|
||||
} ;
|
||||
@@ -1,48 +0,0 @@
|
||||
concrete IdiomKis of Idiom = CatKis ** open Prelude, ResKis in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
{-
|
||||
lin
|
||||
ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
|
||||
GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
|
||||
|
||||
CleftNP np rs = mkClause "it" (agrP3 Sg)
|
||||
(insertObj (\\_ => rs.s ! np.a)
|
||||
(insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ;
|
||||
|
||||
CleftAdv ad s = mkClause "it" (agrP3 Sg)
|
||||
(insertObj (\\_ => conjThat ++ s.s)
|
||||
(insertObj (\\_ => ad.s) (predAux auxBe))) ;
|
||||
|
||||
ExistNP np =
|
||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
(insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ;
|
||||
|
||||
ExistIP ip =
|
||||
mkQuestion (ss (ip.s ! npNom))
|
||||
(mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
|
||||
|
||||
ExistNPAdv np adv =
|
||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
(insertObj (\\_ => np.s ! NPAcc ++ adv.s) (predAux auxBe)) ;
|
||||
|
||||
ExistIPAdv ip adv =
|
||||
mkQuestion (ss (ip.s ! npNom))
|
||||
(mkClause "there" (agrP3 ip.n) (insertObj (\\_ => adv.s) (predAux auxBe))) ;
|
||||
|
||||
ProgrVP vp = insertObj (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a) (predAux auxBe) ;
|
||||
|
||||
ImpPl1 vp = {s = "let's" ++ infVP VVAux vp Simul CPos (AgP1 Pl)} ;
|
||||
|
||||
ImpP3 np vp = {s = "let" ++ np.s ! NPAcc ++ infVP VVAux vp Simul CPos np.a} ;
|
||||
|
||||
SelfAdvVP vp = insertObj reflPron vp ;
|
||||
SelfAdVVP vp = insertAdVAgr reflPron vp ;
|
||||
SelfNP np = {
|
||||
s = \\c => np.s ! c ++ reflPron ! np.a ;
|
||||
a = np.a
|
||||
} ;
|
||||
} -}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
--# -path=.:../abstract:../common:../api
|
||||
|
||||
concrete LangKis of Lang =
|
||||
GrammarKis,
|
||||
LexiconKis
|
||||
-- ,ConstructionSwa
|
||||
** {
|
||||
} ;
|
||||
@@ -1,373 +0,0 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete LexiconKis of Lexicon = CatKis **
|
||||
open ParadigmsKis,StructuralKis, Prelude in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
person_N =regN "mtu" a_wa ;
|
||||
woman_N =iregN "mwanamke" "wanwake" a_wa ;
|
||||
house_N =regN "nyumba" i_zi ;
|
||||
tree_N = regN "mti" u_i ;
|
||||
big_A =regA "kubwa" ;
|
||||
beautiful_A = regA "rembo" ;
|
||||
black_A =regA "eusi" ;
|
||||
blue_A =cregA "buluu" ;
|
||||
broad_A = regA "pana" ;
|
||||
brown_A =regA "hudhurungi" ;
|
||||
clean_A = regA "safi" ;
|
||||
clever_A = regA "hodari" ;
|
||||
cold_A = regA "baridi" ;
|
||||
correct_A =regA "sahihi" ;
|
||||
dirty_A =regA "chafu" ;
|
||||
dry_A = regA "kavu" ;
|
||||
full_A =regA "tele" ;
|
||||
good_A =regA "zuri" ;
|
||||
green_A =cregA "kijani" ;
|
||||
heavy_A = regA "zito" ;
|
||||
hot_A =regA "moto" ;
|
||||
important_A = regA "muhimu" ;
|
||||
long_A = regA "refu" ;
|
||||
narrow_A = regA "embamba" ;
|
||||
near_A = regA "karibu" ;
|
||||
new_A =regA "pya" ;
|
||||
old_A =regA "zee" ;
|
||||
red_A =regA "ekundu" ;
|
||||
rotten_A = regA "oza" ;
|
||||
round_A = regA "virgo" ;
|
||||
sharp_A = regA "kali" ;
|
||||
short_A = regA "fupi" ;
|
||||
smooth_A = regA "lai" ;
|
||||
straight_A =regA "nyofu" ;
|
||||
stupid_A =regA "jiga" ;
|
||||
thick_A =regA "nene" ;
|
||||
thin_A = regA "embamba" ;
|
||||
ugly_A =regA "baya";
|
||||
warm_A =regA "fufutende" ;
|
||||
wet_A =regA "nyevu" ;
|
||||
white_A =regA "eupe" ;
|
||||
yellow_A =regA "njano" ;
|
||||
young_A = regA "bichi" ;
|
||||
small_A = regA "dogo" ;
|
||||
cow_N = regN "ngombe" i_zi ;
|
||||
doctor_N =iregN "daktari" "daktari" a_wa ;
|
||||
dog_N =iregN "mbwa" "mbwa" a_wa ;
|
||||
door_N =regN "mlango" u_i ;
|
||||
enemy_N =regN "adui" a_wa ;
|
||||
fish_N = regN "samaki" a_wa ;
|
||||
friend_N =iregN "rafiki" "rafiki" a_wa ;
|
||||
garden_N = iregN "bustani" "bustani" li_ya ;
|
||||
girl_N = regN "msichana" a_wa ;
|
||||
lamp_N = regN "taa" li_ya ;
|
||||
man_N = iregN "mwanaume" "wanaume" a_wa ;
|
||||
eye_N = iregN "jicho" "macho" li_ya ;
|
||||
tooth_N = regN "jino" li_ya ;
|
||||
wife_N = iregN "bibi" "bibi"a_wa ;
|
||||
bird_N = regN "ndege" a_wa ;
|
||||
country_N = regN "nchi" i_zi ;
|
||||
cousin_N = iregN "binamu" "Binami" a_wa;
|
||||
father_N = regN "baba" "baba" a_wa ;
|
||||
water_N = iregN "maji" "maji" ya_ya ;
|
||||
ear_N = regN "sikio" li_ya ;
|
||||
fingernail_N = regN "ukucha" u_zi ;
|
||||
nose_N = regN "pua" li_ya ;
|
||||
road_N = iregN "barabara" "barabara" i_zi ;
|
||||
river_N = regN "mto" u_i ;
|
||||
come_V = regV "kuja";
|
||||
walk_V = regV "tembea";
|
||||
sleep_V = regV "lala";
|
||||
smell_V = regV "nuka";
|
||||
stand_V = regV "simama";
|
||||
stop_V = regV "simama";
|
||||
swell_V = regV "fura";
|
||||
swim_V = regV "ogelea";
|
||||
think_V = regV "waza";
|
||||
travel_V = regV "safiri";
|
||||
big_A = regA "kubwa";
|
||||
paris_PN = regPN "Paris" ku_ku ; -- this is alreay name of place avoid kwa
|
||||
john_PN = regPN "Yoana" a_wa ;
|
||||
question_N = regN "swali" i_zi ;
|
||||
-- ready_A = regA "ready" ;
|
||||
reason_N = regN "sababu" i_zi ;
|
||||
today_Adv = mkAdv "today" ;
|
||||
--uncertain_A = regA "uncertain" ;
|
||||
distance_N3 = mkN3 (mkN "umbali" "umbali" i_zi ) fromP toP ;
|
||||
add_V3= regV "ongeza";
|
||||
airplane_N=iregN "ndege" "ndege" i_zi ;
|
||||
alas_Interj= ss "ala";
|
||||
animal_N=regN "mnyama" a_wa;
|
||||
ask_V2Q=regV "uliza" ;
|
||||
baby_N=regN "mtoto" a_wa;
|
||||
belly_N=regN "tumbo" i_zi ;
|
||||
blood_N=iregN "damu" "damu" i_zi ;
|
||||
book_N=regN "kitabu" ki_vi;
|
||||
boss_N=iregN "bosi" "bosi"a_wa;
|
||||
boy_N=regN "kijana" a_wa;
|
||||
bread_N=regN " mkate" u_i;
|
||||
breast_N=regN "titi" li_ya;
|
||||
brother_N2= mkN2(mkN "kaka" "kaka" a_wa) mkPrepof ;
|
||||
burn_V=regV "choma";
|
||||
buy_V2=regV "nunua";
|
||||
car_N=regN "gari" li_ya;
|
||||
cat_N=iregN "paka" "paka" a_wa;
|
||||
chair_N=regN "kiti" ki_vi;
|
||||
child_N=regN "mtoto" a_wa;
|
||||
church_N=regN "mtoto" a_wa;
|
||||
city_N=regN "mji" u_i;
|
||||
close_V2=regV "karibu";
|
||||
coat_N=regN "koti" li_ya;
|
||||
computer_N=iregN "kompyuta" "kompyuta" li_ya;
|
||||
cut_V2=regV "kata";
|
||||
day_N=regN "siku" li_ya;
|
||||
die_V=regV "kufa";
|
||||
dig_V=regV "kulima";
|
||||
do_V2=regV " fanya";
|
||||
drink_V2=regV " kunywa";
|
||||
earth_N=iregN "ardhi" "ardhi" i_zi;
|
||||
eat_V2=regV " kula" ;
|
||||
egg_N=regN " yai" li_ya;
|
||||
fall_V=regV "anguka" ;
|
||||
far_Adv=mkAdv"mbali";
|
||||
fat_N=regN "mafuta" li_ya;
|
||||
father_N2=mkN2 ( mkN "baba" "baba"a_wa) mkPrepof ;
|
||||
fear_V2=regV "ongopa" ;
|
||||
find_V2=regV "tafuta";
|
||||
fire_N=iregN "moto" "moto" u_i;
|
||||
foot_N=regN" mguu" u_i;
|
||||
forest_N=regN "msitu" u_i;
|
||||
go_V=regV "enda" ;
|
||||
gold_N=iregN "dhahabu" "dhahabu" li_ya;
|
||||
grass_N=regN "nyasi" i_zi;
|
||||
hair_N=iregN "nywele" "Nywele" i_zi;
|
||||
hand_N=regN "mkono" u_i;
|
||||
hat_N=iregN "kofia" "kofia" i_zi;
|
||||
head_N=regN "kichwa" ki_vi;
|
||||
hear_V2=regV " sikia";
|
||||
heart_N=regN "moyo" u_i;
|
||||
hill_N=regN " kilima" ki_vi;
|
||||
husband_N=regN" mume" a_wa;
|
||||
ice_N=iregN "barafu" "barafu" i_zi;
|
||||
jump_V=regV "ruka";
|
||||
kill_V2=regV "ua";
|
||||
king_N=regN "mfalame" a_wa;
|
||||
knee_N=regN "goti" li_ya;
|
||||
know_V2=regV "jua";
|
||||
laugh_V=regV "cheka";
|
||||
leaf_N=regN "jani" li_ya;
|
||||
learn_V2=regV "soma";
|
||||
leg_N=regN " mguu" u_i;
|
||||
listen_V2=regV " sikiza";
|
||||
love_N=regN "upendo" u_zi;
|
||||
married_A2= mkA2(regA "oa") "ni";
|
||||
meat_N=regN "nyama" i_zi;
|
||||
milk_N=regN "maziwa" i_zi;
|
||||
moon_N=regN "mwezi" u_i;
|
||||
mother_N2=mkN2( mkN "mama""mama" a_wa) mkPrepof ;
|
||||
mountain_N=regN "mlima" u_i;
|
||||
mouth_N=regN "mdomo" u_i;
|
||||
name_N=regN " jina" li_ya;
|
||||
neck_N=regN "shingo" li_ya;
|
||||
night_N=regN "usiku" u_zi;
|
||||
number_N=regN "namba" li_ya;
|
||||
oil_N=regN "mafuta" ya_ya;
|
||||
open_V2=regV " fungua";
|
||||
paper_N=regN " karatasi" li_ya;
|
||||
peace_N=regN "amani" ya_ya;
|
||||
play_V=regV " cheza";
|
||||
policeman_N=regN "askari" a_wa;
|
||||
priest_N=regN "kasisi" a_wa;
|
||||
rain_N=regN "mvua" i_zi;
|
||||
rock_N=regN "jabali" li_ya;
|
||||
root_N=regN "mzizi" u_i;
|
||||
rope_N=regN "kamba" li_ya;
|
||||
run_V=regV "imbia";
|
||||
salt_N=iregN "chumvi" "chumvi" i_zi;
|
||||
sand_N=iregN "changarawe" "changarawe" ki_vi;
|
||||
school_N=iregN " shule" "shule" i_zi;
|
||||
sea_N=iregN "bahari" "Bahari" li_ya;
|
||||
see_V2=regV "angalia";
|
||||
seed_N=regN "mbengu" i_zi;
|
||||
seek_V2=regV " tafuta";
|
||||
sell_V3=regV "uza";
|
||||
send_V3=regV "tuma";
|
||||
sheep_N=iregN "Kondoo" "Kondoo" li_ya;
|
||||
shoe_N=regN "kiatu" ki_vi;
|
||||
shop_N=iregN "duka" "duka" li_ya;
|
||||
sing_V=regV "imba";
|
||||
sister_N=iregN "dada" "dada" a_wa;
|
||||
sit_V=regV"keti";
|
||||
snake_N=iregN "nyoka" "nyoka" a_wa;
|
||||
song_N=regN "wimbo" u_zi;
|
||||
speak_V2=regV "ongea";
|
||||
star_N=regN "nyota" i_zi;
|
||||
student_N=regN "mwanafunzi" a_wa;
|
||||
sun_N=regN "jua" li_ya;
|
||||
table_N=regN "meza" i_zi;
|
||||
teach_V2=regV "somesha";
|
||||
teacher_N=regN "mwalimu" a_wa;
|
||||
tongue_N=regN "ulimi" u_zi;
|
||||
understand_V2=regV" elewa";
|
||||
wait_V2=regV "gojea";
|
||||
war_N=iregN "vita" "vita" u_zi;
|
||||
wash_V2=regV "osha";
|
||||
win_V2=regV "shinda";
|
||||
wind_N=regN " upepo" u_zi;
|
||||
window_N=regN "dirisha" li_ya;
|
||||
write_V2=regV " andika";
|
||||
year_N=regN "mwaka" u_i;
|
||||
already_Adv=mkAdv "zamani";
|
||||
answer_V2S=regV" jibu";
|
||||
apartment_N=iregN " nyumba ya ghorofa" "nyumba za ghorofa" i_zi;
|
||||
apple_N=iregN "tofaa" "tofaa" li_ya;
|
||||
art_N=iregN "weledi" "weledi" u_zi;
|
||||
ashes_N=regN "jivu" li_ya;
|
||||
back_N=regN "mgongo" u_i;
|
||||
bad_A=regA"ovu" ;
|
||||
bank_N=iregN "benki" "benki" i_zi;
|
||||
bark_N=regN "gamba" li_ya;
|
||||
become_VA=regV "ingia";
|
||||
beer_N=regN "mtindi" u_i;
|
||||
beg_V2V=regV "omba";
|
||||
bike_N=iregN " baisikeli" "basikeli" i_zi;
|
||||
bite_V2=regV "donoa";
|
||||
blow_V=regV"puliza";
|
||||
boat_N=regN "shua" li_ya;
|
||||
bone_N=regN "mfupa" u_i;
|
||||
boot_N=regN "buti" li_ya;
|
||||
break_V2=regV "goboa";
|
||||
breathe_V=regV "pumua";
|
||||
butter_N=iregN "siagi" "siagi" i_zi;
|
||||
camera_N=iregN "kamera" "kamera" i_zi;
|
||||
cap_N=iregN "heti" "heti" i_zi;
|
||||
carpet_N=regN "zulia" li_ya;
|
||||
ceiling_N=regN "dari" li_ya;
|
||||
cheese_N=regN " chisi" li_ya;
|
||||
cloud_N=regN "wingu" li_ya;
|
||||
count_V2=regV "hesabu";
|
||||
dull_A=iregA "butu" "butu" ;
|
||||
dust_N=regN "fumbi" li_ya;
|
||||
--easy_A2V= regA "epesi";
|
||||
empty_A=regA "tupu" ;
|
||||
factory_N=regN "banda" i_zi;
|
||||
fear_VS=regV "ogopa";
|
||||
feather_N=regN "unyoya" u_ya;
|
||||
fight_V2=regV "pigana";
|
||||
float_V=regV "elea";
|
||||
floor_N=iregN "sakafu" "sakafu" i_zi;
|
||||
flow_V=regV "tiririk";
|
||||
flower_N=regN "ua" li_ya;
|
||||
fly_V=regV"pepea";
|
||||
fog_N=regN "ukungu" u_ya;
|
||||
forget_V2=regV "sahau";
|
||||
freeze_V=regV"ganda";
|
||||
fridge_N=iregN "friji" "friji" i_zi;
|
||||
fruit_N=regN "zao" u_ya;
|
||||
fun_AV=regA "kejeli";
|
||||
give_V3=regV "patiana";
|
||||
glove_N=iregN "glavu" "glavu" i_zi;
|
||||
grammar_N=iregN "sarafi" "sarafi" i_zi;
|
||||
guts_N= regN "tumbo" li_ya; --confirm the tranlation
|
||||
harbour_N=regN"bandari" li_ya;
|
||||
hate_V2=regV"chukia";
|
||||
hit_V2=regV "gonga";
|
||||
hold_V2=regV "shika";
|
||||
hope_VS=regV "tumai";
|
||||
horn_N=iregN "pembe" " Pembe" i_zi;
|
||||
horse_N=iregN "farasi" "farasi" a_wa;
|
||||
hunt_V2=regV "saka";
|
||||
industry_N=regN "kiwanda" ki_vi;
|
||||
iron_N=regN "chuma" ki_vi;
|
||||
know_VQ=regV "fahamu";
|
||||
know_VS=regV "jua";
|
||||
lake_N=regN "ziwa" li_ya;
|
||||
language_N=regN "lugha" u_zi;
|
||||
leather_N=iregN "ngozi" "ngozi" i_zi;
|
||||
leave_V2=regV "achwa";
|
||||
left_Ord= mkOrd "kushoto"; --what is the translation
|
||||
lie_V=regV "daganya";
|
||||
like_V2=regV "pendea";
|
||||
live_V=regV "penda";
|
||||
liver_N=regN "ini" li_ya;
|
||||
lose_V2=regV "poteza";
|
||||
louse_N=iregN "chawa" "chawa" i_zi;
|
||||
love_V2=regV "pendwa";
|
||||
music_N=regN "muziki" u_i;
|
||||
newspaper_N=regN "jarida" li_ya;
|
||||
now_Adv=mkAdv "sasa";
|
||||
paint_V2A=regV "paka";
|
||||
pen_N=iregN " kalamu" "kalamu" i_zi;
|
||||
planet_N=iregN "sayari" "sayari" i_zi;
|
||||
plastic_N=iregN "plastiki" "plastiki" i_zi;
|
||||
play_V2=regV "cheza";
|
||||
probable_AS=regA"kini";
|
||||
pull_V2=regV "vuta";
|
||||
push_V2=regV "sukuma";
|
||||
put_V2=regV "tia";
|
||||
queen_N=iregN "malkia" "malkia" a_wa;
|
||||
radio_N=iregN "redio" "redio" i_zi;
|
||||
rain_V0=regV "nyesha";
|
||||
read_V2=regV "soma";
|
||||
ready_A=iregA "tayari" "tayari";
|
||||
religion_N=regN "dini" li_ya;
|
||||
restaurant_N=regN "mkahawa" u_i;
|
||||
right_Ord= mkOrd"kulia";
|
||||
roof_N=regN "paa" li_ya;
|
||||
rub_V2=regV "sugua";
|
||||
rubber_N=regN "mpira" u_i;
|
||||
rule_N=regN "utawala" u_zi;
|
||||
say_VS=regV "tamka";
|
||||
science_N=iregN "sayansi" "sayansi" i_zi;
|
||||
scratch_V2=regV "kwaruza";
|
||||
sew_V=regV "shona";
|
||||
ship_N=iregN "meli" "meli" i_zi;
|
||||
shirt_N=regN "shati" li_ya;
|
||||
silver_N=iregN "fedha" "fedha" i_zi;
|
||||
skin_N=iregN "ngozi" "ngozi" i_zi;
|
||||
sky_N=regN "anga" li_ya;
|
||||
smoke_N=iregN "moshi" "moshi" u_zi;
|
||||
snow_N=iregN "theluji" "theluji" i_zi;
|
||||
sock_N=iregN "soksi" "soksi" i_zi;
|
||||
spit_V=regV"tema";
|
||||
split_V2=regV"pasua";
|
||||
squeeze_V2=regV "finya";
|
||||
stab_V2=regV" tofua";
|
||||
steel_N=regN "chuma" ki_vi;
|
||||
stick_N=regN "kijiti" ki_vi;
|
||||
stone_N=iregN " jiwe" "mawe" li_ya;
|
||||
stove_N=iregN "jiko" "meko" li_ya;
|
||||
suck_V2=regV "fyonza";
|
||||
switch8off_V2=regV "poesha";
|
||||
switch8on_V2=regV "akisha";
|
||||
tail_N=regN "mkia" u_i;
|
||||
talk_V3=regV "ongea";
|
||||
television_N=iregN "televisheni" " televisheni" i_zi;
|
||||
throw_V2=regV "tupa";
|
||||
tie_V2=regV "funga";
|
||||
train_N=iregN "gari ya moshi" "magari ya moshi" li_ya;
|
||||
turn_V=regV "geuka";
|
||||
uncertain_A=iregA "geugeu" "geugeu";
|
||||
university_N=iregN "chuo kikuu" "vyuo vikuu" ki_vi;
|
||||
village_N=regN "kitongoji" ki_vi;
|
||||
vomit_V=regV "tapika";
|
||||
watch_V2=regV "dhibiti";
|
||||
wide_A=iregA "panapana" "panapana";
|
||||
wine_N=regN "mvinyo" u_i;
|
||||
wing_N=regN"bawa" li_ya;
|
||||
wipe_V2=regV"futa";
|
||||
wonder_VQ=regV "shangaa";
|
||||
wood_N=regN "mti" u_i;
|
||||
worm_N=regN "funza" li_ya;
|
||||
|
||||
|
||||
oper
|
||||
aboutP = mkPrep "juu ya" ;
|
||||
atP = mkPrep "vala ve" ;
|
||||
forP = mkPrep "for" ;
|
||||
fromP = mkPrep "kutoka" ;
|
||||
inP = mkPrep "ndani" ;
|
||||
onP = mkPrep "juu" ;
|
||||
toP = mkPrep "hadi" ;
|
||||
|
||||
} ;
|
||||
@@ -1,351 +0,0 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
--1 Kiswahili morphology Resource Morphology
|
||||
--
|
||||
-- Benson Kituku 2017-2018
|
||||
|
||||
|
||||
resource MorphoKis = CommonBantu ,ResKis
|
||||
** open Prelude, Predef
|
||||
in {
|
||||
|
||||
flags optimize=all ;
|
||||
oper
|
||||
|
||||
Many_prefix : Gender -> Str = \g ->
|
||||
case <g> of {
|
||||
<G1> => "we" ;
|
||||
<G2> => "mi" ;
|
||||
<G10> => "nyi" ;
|
||||
<G11> => "pe" ;
|
||||
<G12> => "kwi" ;
|
||||
<G4> => "vi" ;
|
||||
<G5>|<G6> => "nyi" ;
|
||||
<G7> |<G13> => "mwi" ;
|
||||
<G3>|<G8> |<G9> => "me"
|
||||
} ;
|
||||
|
||||
|
||||
Few_prefix : Gender -> Str = \g ->
|
||||
case <g> of {
|
||||
<G1> => "wa" ;
|
||||
<G2> => "mi" ;
|
||||
<G10> => "" ;
|
||||
<G11> => "pa" ;
|
||||
<G12> => "ku" ;
|
||||
<G4> => "vi" ;
|
||||
<G5>|<G6> => "" ;
|
||||
<G7> |<G13> => "m" ;
|
||||
<G3>|<G8> |<G9> => "ma"
|
||||
} ;
|
||||
|
||||
Detsomesgprefix : Gender -> Str = \g ->
|
||||
case <g> of {
|
||||
<G3> => "li" ;
|
||||
<G4> => "ki" ;
|
||||
<G9> => "me";
|
||||
<G11> => "pe" ;
|
||||
<G12> => "kwi" ;
|
||||
<G5>|<G10> => "nyi" ;
|
||||
<G1> |<G6>|<G2>|<G7>|<G8> |<G13> => "mwi"
|
||||
|
||||
} ;
|
||||
|
||||
Detsomeplprefix : Gender -> Str = \g ->
|
||||
case <g> of {
|
||||
<G1> => "we" ;
|
||||
<G2> => "mi" ;
|
||||
<G10> => "nyi" ;
|
||||
<G11> => "pe" ;
|
||||
<G12> => "kwi" ;
|
||||
<G4> => "vi" ;
|
||||
<G5>|<G6> => "nye" ;
|
||||
<G7> |<G13> => "mwi" ;
|
||||
<G3>|<G8> |<G9> => "me"
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
mkNum : Str -> Str -> {s : DForm => CardOrd => Gender => Str} =
|
||||
\two, second ->
|
||||
{s = table {
|
||||
unit => table {NCard =>\\g => Cardprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ two} ;
|
||||
teen => table {NCard =>\\g =>"kumi na" ++ Cardprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi na" ++ Cardprefix g + two} ;
|
||||
ten => table {NCard =>\\g =>second ++"na" ++ Cardprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ second ++"na" ++ Cardprefix g + two};
|
||||
hund => table {NCard =>\\g =>"mia " ++ two ;
|
||||
NOrd => \\g => Ordprefix g ++ "mia " ++ two }
|
||||
}
|
||||
} ;
|
||||
|
||||
mkNumn : Str -> Str -> Str -> {s : DForm => CardOrd => Gender => Str} =
|
||||
\two, twelve, second ->
|
||||
{s = table {
|
||||
unit => table {NCard =>\\g => Cardtwoprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ second} ;
|
||||
teen => table {NCard =>\\g =>"kumi na" ++ Cardtwoprefix g + two;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi na" ++ Cardtwoprefix g + two} ;
|
||||
ten => table {NCard =>\\g =>twelve ;
|
||||
NOrd => \\g => Ordprefix g ++ twelve};
|
||||
hund => table {NCard =>\\g =>"mia mb " + two ;
|
||||
NOrd => \\g => Ordprefix g ++ "mia mb" + two}
|
||||
}
|
||||
} ;
|
||||
|
||||
mkNume : Str -> Str -> {s : DForm => CardOrd => Gender => Str} =
|
||||
\two, second ->
|
||||
{s = table {
|
||||
unit => table {NCard =>\\g => Cardoneprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ second} ;
|
||||
teen => table {NCard =>\\g =>"kumi na" ++ Cardoneprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi na" ++ Cardoneprefix g + two} ;
|
||||
ten => table {NCard =>\\g =>"kumi" ;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi"};
|
||||
hund => table {NCard =>\\g =>"mia " ++ two ;
|
||||
NOrd => \\g => Ordprefix g ++ "mia" ++ two}
|
||||
}
|
||||
} ;
|
||||
|
||||
regNum : Str ->Str -> {s : DForm => CardOrd => Gender => Str} =
|
||||
\six,sixth -> {s = table {
|
||||
unit => table {NCard =>\\g => six ;
|
||||
NOrd => \\g => Ordprefix g ++ six} ;
|
||||
teen => table {NCard =>\\g =>"kumi na" ++ six ;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi na" ++ six} ;
|
||||
ten => table {NCard =>\\g =>sixth ++"na" ++ six ;
|
||||
NOrd => \\g => Ordprefix g ++ sixth ++"na" ++ six };
|
||||
hund => table {NCard =>\\g =>"mia " ++ six ;
|
||||
NOrd => \\g => Ordprefix g ++ "mia" ++ six}
|
||||
} } ;
|
||||
|
||||
|
||||
regCardOrd : Str -> {s : CardOrd => Gender => Str} = \ten ->
|
||||
{s = table {NCard => \\g => ten ;
|
||||
NOrd =>\\g => Ordprefix g ++ ten } } ;
|
||||
|
||||
regCardone : Str -> Str -> {s : CardOrd => Gender => Str} = \ten,one ->
|
||||
{s = table {NCard => \\g => ten ++ Cardoneprefix g + one ;
|
||||
NOrd =>\\g => Ordprefix g ++ ten ++ Cardoneprefix g + one } } ;
|
||||
|
||||
mkCard : CardOrd -> Str -> Gender => Str = \o,ten ->
|
||||
(regCardOrd ten).s ! o ;
|
||||
|
||||
regN : Str ->Gender -> Noun = \w, g -> let wpl = case g of {
|
||||
G1=>case w of {
|
||||
"mwa" + _ => PrefixPlNom G1 + Predef.drop 3 w ;
|
||||
"mwi" + _ => "we" + Predef.drop 3 w ;
|
||||
"ki" + _ => PrefixPlNom G4 + Predef.drop 2 w ;
|
||||
"m" + _ => PrefixPlNom G1 + Predef.drop 1 w ;
|
||||
_ => w };
|
||||
G2=>case w of {
|
||||
"mw" + _ => PrefixPlNom G2 + Predef.drop 2 w ;
|
||||
"mu" + _ => PrefixPlNom G2 + Predef.drop 2 w ;
|
||||
_ => PrefixPlNom G2 + Predef.drop 1 w };
|
||||
G4=> case w of {
|
||||
"ki" + _ => PrefixPlNom G4 + Predef.drop 2 w ;
|
||||
"ch" + _ => "vy" + Predef.drop 2 w ;
|
||||
_ => w };
|
||||
G6 |G8 => PrefixPlNom g + Predef.drop 1 w;
|
||||
G11 |G12|G13 => "" ;
|
||||
_ => PrefixPlNom g + w };
|
||||
|
||||
in iregN w wpl g ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
iregN :Str-> Str ->Gender -> Noun= \man,men,g -> { -- for irregular noun
|
||||
s = table{Sg => table{Nom => man ;
|
||||
Loc=> man + "ni" | men + "ni" };
|
||||
Pl => table{Nom => men ; Loc=> ""}} ;
|
||||
g = g
|
||||
} ;
|
||||
|
||||
regA:Str -> {s : AForm => Str} = \seo -> {s = table {
|
||||
AAdj G1 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix G1 Sg + seo;
|
||||
_ => ConsonantAdjprefix G1 Sg + seo };
|
||||
AAdj G1 Pl =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G1 Pl + seo;
|
||||
"i" => VoweliAdjprefix G1 Pl + seo;
|
||||
_ => ConsonantAdjprefix G1 Pl + seo };
|
||||
|
||||
AAdj G2 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix G2 Sg + seo;
|
||||
_ => ConsonantAdjprefix G2 Sg + seo };
|
||||
AAdj G2 Pl =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G2 Pl + seo;
|
||||
"i" => VoweliAdjprefix G2 Pl + seo;
|
||||
_ => ConsonantAdjprefix G2 Pl + seo };
|
||||
AAdj G3 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix G3 Sg + seo;
|
||||
_ => ConsonantAdjprefix G3 Sg + seo };
|
||||
AAdj G3 Pl =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G3 Pl + seo;
|
||||
"i" => VoweliAdjprefix G3 Pl + seo;
|
||||
_ => ConsonantAdjprefix G3 Pl + seo };
|
||||
|
||||
AAdj G4 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G4 n + seo;
|
||||
"i" => VoweliAdjprefix G4 n + seo;
|
||||
_ => ConsonantAdjprefix G4 n + seo };
|
||||
AAdj G5 n => case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G5 n + seo;
|
||||
"i" => "ny" + Predef.drop 1 seo;
|
||||
"d"|"g"|"z" => "n" + seo;
|
||||
"b"|"p"|"v" => "m" + seo;
|
||||
_ => ConsonantAdjprefix G5 n + seo };
|
||||
|
||||
AAdj G6 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix G6 Sg + seo;
|
||||
_ => ConsonantAdjprefix G6 Sg + seo };
|
||||
AAdj G6 Pl =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G6 Pl + seo;
|
||||
"i" => "ny" + Predef.drop 1 seo;
|
||||
"d"|"g"|"z" => "n" + seo;
|
||||
"b"|"p"|"v" => "m" + seo;
|
||||
_ => ConsonantAdjprefix G6 Pl + seo };
|
||||
|
||||
AAdj G7 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G7 n + seo;
|
||||
"i" => VoweliAdjprefix G7 n + seo;
|
||||
_ => ConsonantAdjprefix G7 n + seo };
|
||||
AAdj G8 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G8 n + seo;
|
||||
"i" => VoweliAdjprefix G8 n + seo;
|
||||
_ => ConsonantAdjprefix G8 n + seo };
|
||||
AAdj G9 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G9 n + seo;
|
||||
"i" => VoweliAdjprefix G9 n + seo;
|
||||
_ => ConsonantAdjprefix G9 n + seo };
|
||||
AAdj G10 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G9 n + seo;
|
||||
"i" => VoweliAdjprefix G9 n + seo;
|
||||
_ => ConsonantAdjprefix G9 n + seo };
|
||||
|
||||
AAdj G11 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G11 Sg + seo;
|
||||
"i" => VoweliAdjprefix G11 Sg + seo;
|
||||
_ => ConsonantAdjprefix G11 Sg + seo };
|
||||
|
||||
AAdj G12 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G12 Sg + seo;
|
||||
"i" => VoweliAdjprefix G12 Sg + seo;
|
||||
_ => ConsonantAdjprefix G12 Sg + seo };
|
||||
AAdj G13 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G13 Sg + seo;
|
||||
"i" => VoweliAdjprefix G13 Sg + seo;
|
||||
_ => ConsonantAdjprefix G13 Sg + seo };
|
||||
AAdj _ Pl =>[] }};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
iregA : Str-> Str -> {s : AForm => Str} = \seo,seoo -> {
|
||||
s = table {
|
||||
AAdj g Sg=> seo;
|
||||
AAdj g Pl => seoo} };
|
||||
|
||||
|
||||
cregA : Str-> {s : AForm => Str} = \seo -> {
|
||||
s = table {
|
||||
AAdj g Sg => ProunSgprefix g + "a" ++"rangi" ++"ya" ++ seo;
|
||||
AAdj g Pl=> ProunPlprefix g + "a" ++"rangi" ++"ya" ++ seo} } ;
|
||||
|
||||
regV : Str -> Verb =
|
||||
\vika -> {
|
||||
s = table{ True => table{
|
||||
VInf => vika;
|
||||
VPres g n p => Verbprefix g n p + vika;
|
||||
VPast g n p => Verbprefix g n p + init vika + "ie" ;
|
||||
VFut g n p => Verbfutureprefix g n p + vika
|
||||
} ;
|
||||
False =>table {
|
||||
VInf => "ndi" + vika;
|
||||
VPres g n p => neg (Ag g n p) False Pres + "na" + vika ;
|
||||
VPast g n p => neg (Ag g n p) False Past + "ne" + vika ;
|
||||
VFut g n p => neg (Ag g n p) False Fut + "ka" + vika
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
neg : Agr -> Bool ->Tense -> Str = \a,b,t -> let
|
||||
g = getGender a;
|
||||
n=getNumber a;
|
||||
p=getPerson a
|
||||
in case b of {True => [] ; False => negprefix g n t p} ;
|
||||
|
||||
negprefix : Gender -> Number -> Tense -> Person -> Str =\g,n,t,p-> case <g,n,t,p> of {
|
||||
<G1,Sg,_,P1> => "ndi";
|
||||
<G1,Sg,_,P2> => "ndu";
|
||||
<G1,Sg,_,P3> => "ndu";
|
||||
<G1,Pl,_,P1> => "twi";
|
||||
<G1,Pl,_,P2> => "mwi";
|
||||
<G1,Pl,_,P3> => "mai";
|
||||
<G2,Sg,_,_> => "ndu";
|
||||
<G2,Pl,_,_> => "i";
|
||||
<G3,Sg,_,_> => "i";
|
||||
<G3,Pl,_,_> => "mai";
|
||||
<G4,Sg,_,_> => "ki";
|
||||
<G4,Pl,_,_> => "i";
|
||||
<G5,Sg,_,_> => "kai";
|
||||
<G5,Pl,_,_> => "tui";
|
||||
<G6,Sg,_,_> => "vai";
|
||||
<G6,Pl,_,_> => "kui";
|
||||
<G7,Sg,_,_> => "i";
|
||||
<_,_,_,_> => "syi"
|
||||
|
||||
};
|
||||
|
||||
|
||||
Verbprefix : Gender -> Number -> Person -> Str = \g, n, p ->
|
||||
case <g,n,p> of {
|
||||
<G1,Sg,P1> => "na" ;
|
||||
<G1,Sg,P2> => "wa" ;
|
||||
<G1,Sg,P3> => "wa" ;
|
||||
<G1,Pl,P1> => "twa" ;
|
||||
<G1,Pl,P2> => "mwa" ;
|
||||
<G1,Pl,P3> => "ma" ;
|
||||
<G2,Sg,_> => "wa" ;
|
||||
<G2,Pl, _> => "ya" ;
|
||||
<G4,Sg,_> => "kya" ;
|
||||
<G4,Pl,_> => "sya" ;
|
||||
<G3,Sg,_> => "ya" ;
|
||||
<G3,Pl,_> => "ma" ;
|
||||
<G5,Sg,_> => "ka" ;
|
||||
<G5,Pl,_> => "twa" ;
|
||||
<G6,Sg,_> => "va" ;
|
||||
<G6,Pl,_> => "kwa" ;
|
||||
<G7,Sg,_> => "ya" ;
|
||||
<_,_,_> => "sya"
|
||||
} ;
|
||||
|
||||
Verbfutureprefix : Gender -> Number -> Person -> Str = \g, n, p ->
|
||||
case <g,n,p> of {
|
||||
<G1,Sg,P1> => "nga" ;
|
||||
<G1,Sg,P2> => "uka" ;
|
||||
<G1,Sg,P3> => "uka" ;
|
||||
<G1,Pl,P1> => "tuka" ;
|
||||
<G1,Pl,P2> => "muka" ;
|
||||
<G1,Pl,P3> => "maka" ;
|
||||
<G2,Sg,_> => "uka" ;
|
||||
<G2,Pl, _> => "ika" ;
|
||||
<G4,Sg,_> => "kika" ;
|
||||
<G4,Pl,_> => "ika" ;
|
||||
<G3,Sg,_> => "ika" ;
|
||||
<G3,Pl,_> => "maka" ;
|
||||
<G5,Sg,_> => "kaka" ;
|
||||
<G5,Pl,_> => "tuka" ;
|
||||
<G6,Sg,_> => "vaka" ;
|
||||
<G6,Pl,_> => "kuka" ;
|
||||
<G7,Sg,_> => "ika" ;
|
||||
<_,_,_> => "ika"
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
concrete NounKis of Noun =
|
||||
CatKis ** NounBantu with (Structural = StructuralKis), (ResBantu = ResKis);
|
||||
@@ -1,87 +0,0 @@
|
||||
concrete NumeralKis of Numeral = CatKis [Numeral,Digits] **
|
||||
open Prelude,DiffKis,MorphoKis in {
|
||||
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Gender => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Gender => Str ; n : Number} ;
|
||||
Sub100 = {s : CardOrd => Gender => Str ; n : Number} ;
|
||||
Sub1000 = {s : CardOrd => Gender => Str ; n : Number} ;
|
||||
Sub1000000 = {s : CardOrd => Gender => Str ; n : Number} ;
|
||||
|
||||
lin num x = x ;
|
||||
lin n2 = mkNumn "ili" "ishirini" "pili" ;
|
||||
lin n3 = mkNum "tatu" "thelathini" ;
|
||||
lin n4 = mkNum "nne" "arobaini" ;
|
||||
lin n5 = mkNum "tano" "hamsini" ;
|
||||
lin n6 = regNum "sita" "sitini";
|
||||
lin n7 = regNum "saba" "sabini";
|
||||
lin n8 = regNum "nane" "themanini";
|
||||
lin n9 = regNum "tisa" "tisini" ;
|
||||
|
||||
lin pot01 = mkNume "moja" "kwanza" ** {n = Sg} ;
|
||||
lin pot0 d = d ** {n = Pl} ;
|
||||
lin pot110 = regCardOrd "kumi" ** {n = Pl} ;
|
||||
lin pot111 = regCardone "kumi na" "moja" ** {n = Pl} ; -- creat another function to be gender specific
|
||||
lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ;
|
||||
lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ;
|
||||
lin pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
||||
lin pot1plus d e = { s = table {
|
||||
NCard => \\g => d.s ! ten ! NCard ! g ++ "na"++ e.s ! unit ! NCard ! g ;
|
||||
NOrd => \\g =>Ordprefix g++ d.s ! ten ! NCard ! g ++ "na"++ e.s ! unit ! NCard ! g } ;
|
||||
n = Pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ! hund} ** {n = Pl} ;
|
||||
lin pot2plus d e = {s = table {
|
||||
NCard => \\g => d.s ! hund ! NCard ! g ++ "na" ++ e.s !NCard ! g ;
|
||||
NOrd => \\g =>Ordprefix g++ d.s ! hund ! NCard ! g ++ "na" ++ e.s ! NCard ! g } ;
|
||||
n = Pl} ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = { s = table {
|
||||
NCard => \\g => mkCard NCard "elfu" ! g ++ n.s ! NCard ! g ;
|
||||
NOrd => \\g =>Ordprefix g++ mkCard NCard "elfu" ! g ++ n.s ! NCard ! g } ;
|
||||
n = Pl} ;
|
||||
lin pot3plus n m = { s = table {
|
||||
NCard => \\g => "elfu" ++ n.s ! NCard !g ++ m.s ! NCard ! g ;
|
||||
NOrd => \\g =>Ordprefix g++ "elfu" ++ n.s ! NCard !g ++ m.s ! NCard ! g} ;
|
||||
n = Pl} ;
|
||||
|
||||
-- numerals as sequences of digits0'
|
||||
|
||||
lincat
|
||||
Dig = TDigit ;
|
||||
|
||||
lin
|
||||
IDig d = d ;
|
||||
|
||||
IIDig d i = {
|
||||
--s = \\o,g => d.s ! NCard ! g ++ i.s ! o ! g ;
|
||||
s = table {NCard => \\g => d.s! NCard ! g ++ BIND ++ i.s ! NCard ! g ;
|
||||
NOrd => \\g => d.s! NOrd! g ++ BIND ++ i.s !NCard! g } ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mk3Dig "1" "1" Sg ;
|
||||
D_2 = mkDig "2" ;
|
||||
D_3 = mkDig "3" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
oper
|
||||
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c ) ;
|
||||
|
||||
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||
s = table {NCard => \\g => c ; NOrd => \\g =>Ordprefix g ++ o} ; --Ordprefix g ++
|
||||
n = n} ;
|
||||
|
||||
TDigit = {
|
||||
n : Number ;
|
||||
s : CardOrd => Gender => Str
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -1,437 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
|
||||
resource ParadigmsKis = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoKis,
|
||||
ResKis,
|
||||
CatKis
|
||||
in {
|
||||
|
||||
oper
|
||||
Gender : Type ;
|
||||
a_wa : Gender ; --m-wa
|
||||
u_i : Gender ; --m-mi
|
||||
li_ya : Gender ; --ji-ma
|
||||
ki_vi : Gender ; --kivi
|
||||
i_zi : Gender ; -- nn
|
||||
u_zi : Gender ; --uu
|
||||
u_u : Gender ; --uu
|
||||
u_ya : Gender;
|
||||
ya_ya : Gender;
|
||||
i_i : Gender;
|
||||
ku_ku : Gender ; --uu
|
||||
pa_pa : Gender ; --uu
|
||||
mu_mu : Gender ; --uu
|
||||
|
||||
-- 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 ; --%
|
||||
|
||||
|
||||
|
||||
npNumber : NP -> Number ; -- exctract the number of a noun phrase
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Nouns are constructed by the function $mkN$, which takes a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkN : overload {
|
||||
mkN : (flash : Str) -> Gender -> N ; --regular plural
|
||||
mkN : (man,men : Str) ->Gender -> N ; -- irregular plural
|
||||
mkN : Str -> N -> N -- e.g. chuo + kikuu compound noun
|
||||
} ;
|
||||
|
||||
--3 Relational nouns
|
||||
mkN2 : overload {
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
mkN2 : N -> Str -> N2 ;
|
||||
mkN2 : N -> N2 ;
|
||||
mkN2 : N -> (Gender => Number => Str)-> N2 ;
|
||||
} ;
|
||||
|
||||
oper dfltGender : Gender = G1 ;
|
||||
dfltNumber : Number = Sg ;
|
||||
|
||||
-- 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
|
||||
|
||||
|
||||
|
||||
--3 Proper names and noun phrases
|
||||
--
|
||||
-- Proper names, with a regular genitive, are formed from strings.
|
||||
|
||||
mkPN : overload {
|
||||
|
||||
mkPN : Str ->Gender -> PN ;
|
||||
|
||||
-- Sometimes a common noun can be reused as a proper name, e.g. "Bank"
|
||||
|
||||
mkPN : N -> PN --%
|
||||
} ;
|
||||
|
||||
--3 Determiners and quantifiers
|
||||
|
||||
mkOrd : Str -> Ord ; --%
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA : overload {
|
||||
mkA : (happy : Str) -> A ;
|
||||
mkA : (fat,fatter : Str) -> A ; -- irreg.
|
||||
} ;
|
||||
|
||||
|
||||
--3 Two-place adjectives
|
||||
|
||||
mkA2 : overload {
|
||||
mkA2 : A -> Prep -> A2 ; -- absent from
|
||||
mkA2 : A -> Str -> A2 ; -- absent from --%
|
||||
mkA2 : Str -> Prep -> A2 ; -- absent from --%
|
||||
mkA2 : Str -> Str -> A2 -- absent from --%
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
--2 Adverbs
|
||||
|
||||
-- Adverbs are not inflected. Most lexical ones have position
|
||||
-- after the verb. Some can be preverbal (e.g. "always").
|
||||
|
||||
mkAdv : Str -> Adv ; -- e.g. today
|
||||
mkAdV : Str -> AdV ; -- e.g. always
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ; -- e.g. quite
|
||||
|
||||
-- Adverbs modifying numerals
|
||||
|
||||
mkAdN : Str -> AdN ; -- e.g. approximately
|
||||
|
||||
--2 Prepositions
|
||||
|
||||
mkPrep : overload {
|
||||
mkPrep : Str -> Prep ;
|
||||
mkPrep : (Gender => Number => Str) -> Prep ;
|
||||
} ;
|
||||
|
||||
noPrep : Prep ; -- no preposition
|
||||
|
||||
-- (These two functions are synonyms.)
|
||||
|
||||
--2 Conjunctions
|
||||
--
|
||||
|
||||
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) --%
|
||||
} ;
|
||||
|
||||
--2 Verbs
|
||||
--
|
||||
|
||||
-- Verbs are constructed by the function $mkV$, which takes a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkV : overload {
|
||||
mkV : (cry : Str) -> V ; -- regular, incl. cry-cries, kiss-kisses etc
|
||||
mkV : Str -> V -> V ; -- fix compound, e.g. under+take
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs). Notice that a particle comes from the $V$.-}
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ; -- kill --%
|
||||
mkV2 : V -> V2 ; -- transitive, e.g. hit
|
||||
mkV2 : V -> Prep -> V2 ; -- with preposiiton, e.g. believe in
|
||||
mkV2 : V -> Str -> V2 ; -- believe in --%
|
||||
mkV2 : Str -> Prep -> V2 ; -- believe in --%
|
||||
mkV2 : Str -> Str -> V2 -- believe in --%
|
||||
};
|
||||
|
||||
--3 Three-place verbs
|
||||
--
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 : overload {
|
||||
mkV3 : V -> V3 ; -- ditransitive, e.g. give,_,_
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- two prepositions, e.g. speak, with, about
|
||||
mkV3 : V -> Prep -> V3 ; -- give,_,to --%
|
||||
mkV3 : V -> Str -> V3 ; -- give,_,to --%
|
||||
mkV3 : Str -> Str -> V3 ; -- give,_,to --%
|
||||
mkV3 : Str -> V3 ; -- give,_,_ --%
|
||||
};
|
||||
|
||||
|
||||
--2 Other categories
|
||||
|
||||
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.
|
||||
|
||||
Gender = MorphoKis.Gender ;
|
||||
Number = MorphoKis.Number ;
|
||||
Case = MorphoKis.NPCase ;
|
||||
a_wa = G1 ;--%
|
||||
u_i = G2 ;
|
||||
li_ya = G3 ;
|
||||
ki_vi = G4 ;
|
||||
i_zi = G5 ;
|
||||
u_zi = G6 ;
|
||||
u_u = G7 ;
|
||||
u_ya = G8 ;
|
||||
ya_ya = G9 ;
|
||||
i_i =G10 ;
|
||||
ku_ku = G11;
|
||||
pa_pa =G12 ;
|
||||
mu_mu =G13;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
nominative = npNom ;
|
||||
locative = npLoc ;
|
||||
|
||||
npNumber np = (agrFeatures np.a).n ;
|
||||
|
||||
|
||||
regN = MorphoKis.regN ;
|
||||
iregN = MorphoKis.iregN ;
|
||||
|
||||
|
||||
compoundN s n = lin N {s = \\x,y => s ++ n.s ! x ! y ; g=n.g} ;
|
||||
|
||||
mkPN = overload {
|
||||
-- mkPN : Str -> PN = regPN ;
|
||||
mkPN : Str -> Gender -> PN = regPN;
|
||||
mkPN : N -> PN = nounPN
|
||||
} ;
|
||||
|
||||
|
||||
mkN2 = overload {
|
||||
mkN2 : N -> Prep -> N2 = prepN2 ;
|
||||
mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPrep s);
|
||||
mkN2 : N -> N2 = \n -> prepN2 n (mkPrep mkPrepof ) ;
|
||||
mkN2 : N -> (Number =>Gender => Str)-> N2= \n,s -> prepN2 n (mkPrep mkPrepof) ;
|
||||
} ;
|
||||
|
||||
prepN2 = \n,p -> lin N2 (n ** {c2 = p}) ;
|
||||
regN2 = \n -> (prepN2 n (mkPrep mkPrepof )) ;
|
||||
mkN3 = \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ;
|
||||
mkPrepof : Number => Gender => Str =
|
||||
table Number { Sg => table { G1 |G2|G6|G7 |G8 => "wa" ;
|
||||
G3=> "la" ;
|
||||
G4 => "cha" ;
|
||||
G5 => "ya" ;
|
||||
G11 => "pa";
|
||||
G12 => "kwa";
|
||||
G13 => "mwa";
|
||||
_ => ""} ;
|
||||
|
||||
Pl => table { G1 => "wa" ;
|
||||
G2|G3 |G8 |G9 |G10 => "ya" ;
|
||||
G4 => "vya" ;
|
||||
G5|G6 => "za" ;
|
||||
_ => ""} } ;
|
||||
|
||||
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
cnN2 : CN -> Prep -> N2 ;
|
||||
cnN3 : CN -> Prep -> Prep -> N3 ;
|
||||
|
||||
|
||||
cnN2 = \n,p -> lin N2 (n ** {c2 = p}) ;
|
||||
cnN3 = \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ;
|
||||
|
||||
|
||||
regPN n g = lin PN {s = table {Loc => "" ; _ => n} ; g = g} ;
|
||||
|
||||
|
||||
nounPN n = lin PN {s = n.s ! singular ; g = n.g} ;
|
||||
|
||||
mkOrd : Str -> Ord = \x -> lin Ord { s =\\g => x};
|
||||
|
||||
|
||||
prepA2 a p = lin A2 (a ** {c2 = p.s!Sg!G1}) ;
|
||||
|
||||
mkAdv x = lin Adv (ss x) ;
|
||||
mkAdV x = lin AdV (ss x) ;
|
||||
mkAdA x = lin AdA (ss x) ;
|
||||
mkAdN x = lin AdN (ss x) ;
|
||||
|
||||
mkPrep = overload {
|
||||
mkPrep : Str -> Prep = \str -> lin Prep {s = \\n,g => str } ;
|
||||
mkPrep : (Number => Gender => Str) -> Prep = \t ->lin Prep {s = t} ;
|
||||
} ;
|
||||
|
||||
noPrep = mkPrep [] ;
|
||||
{-} mkPrep : Str -> Str -> Prep = \p,q -> lin Prep
|
||||
{s = table{Sg => table{G1 => p; _=> "" };
|
||||
Pl => table{G1 => q; _=> ""}}} ;
|
||||
prepV2 : V -> Prep -> V2 ;
|
||||
prepV2 = \v,p -> lin V2 (v ** {c2 = p.s!Sg!G1}) ;
|
||||
dirV2 : V -> V2 = \v -> prepV2 v noPrep ;
|
||||
|
||||
prepPrepV3 v p q = lin V3 (v ** {c2 = p ; c3 = q}) ;
|
||||
dirV3 v p = prepPrepV3 v noPrep p ;
|
||||
dirdirV3 v = dirV3 v noPrep ;
|
||||
|
||||
|
||||
mkA2V : A -> Prep -> Prep -> A2V;
|
||||
A2S, A2V : Type = A2 ;
|
||||
mkA2V v p q = mkA2 v p ** {s3 = q.p2 ; c3 = q.p1 ; lock_A2V = <>} ;
|
||||
|
||||
|
||||
mkAV v = v ** { lock_AV = <>} ;
|
||||
mkAV : A -> AV ;
|
||||
AS, AV : Type = A ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkAS v = v ** {lock_AS = <>} ;
|
||||
|
||||
mkVS : V -> VS ;
|
||||
mkVS v = v ** { lock_VS = <>} ;
|
||||
|
||||
mkVQ : V -> VQ ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
|
||||
|
||||
-- mkVV : V -> VV ;
|
||||
-- mkVV v = v ** { lock_VV = <>} ;
|
||||
|
||||
mkVA : V -> VA ;
|
||||
mkVA v = v ** {lock_VA = <>} ;
|
||||
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkV2V v p q = prepPrepV3 v p q ** {lock_V2V = <>} ;
|
||||
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkV2S v p = prepV2 v p ** { lock_V2S = <>} ;
|
||||
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
mkV2Q v p = prepV2 v p ** {lock_V2Q = <>} ;
|
||||
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkV2A v p q = prepPrepV3 v p q ** {lock_V2A = <>} ;
|
||||
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
V0 : Type ;
|
||||
V0 : Type = V;
|
||||
mkV0 v = v ** {lock_V0 = <>} ;
|
||||
-}
|
||||
-- pre-overload API and overload definitions
|
||||
|
||||
-- regN : Str ->Gender -> N ;
|
||||
--iregN : (man,men : Str) ->Gender -> N ;
|
||||
compoundN : Str -> N -> N ;
|
||||
|
||||
mkN = overload {
|
||||
mkN : Str ->Gender -> N = \n, g -> lin N (regN n g );
|
||||
mkN : (man,men : Str) ->Gender -> N = \s,p,g -> lin N ( iregN s p g) ;
|
||||
} ;
|
||||
--mkN : Str -> N -> N = compoundN taken from mkN can be added later if need be
|
||||
-- Relational nouns ("daughter of x") need a preposition.
|
||||
|
||||
prepN2 : N -> Prep -> N2 ;
|
||||
|
||||
-- The most common preposition is "of", and the following is a
|
||||
-- shortcut for regular relational nouns with "of".
|
||||
|
||||
regN2 : N -> N2 ;
|
||||
|
||||
regA : Str -> A = \s -> lin A (MorphoKis.regA s) ;
|
||||
cregA : Str -> A = \s -> lin A (MorphoKis.cregA s) ;
|
||||
iregA : (fat,fatter : Str) -> A =\a,b -> lin A (MorphoKis.iregA a b);
|
||||
mkA = overload {
|
||||
mkA : Str -> A = \a -> lin A (regA a |cregA a);
|
||||
mkA : (fat,fatter : Str) -> A =\a,b -> lin A (iregA a b);
|
||||
} ;
|
||||
|
||||
prepA2 : A -> Prep -> A2 ;
|
||||
|
||||
mkA2 = overload {
|
||||
mkA2 : A -> Prep -> A2 = prepA2 ;
|
||||
mkA2 : A -> Str -> A2 = \a,p -> prepA2 a (mkPrep p) ;
|
||||
mkA2 : Str -> Prep -> A2 = \a,p -> prepA2 (regA a) p;
|
||||
mkA2 : Str -> Str -> A2 = \a,p -> prepA2 (regA a) (mkPrep p);
|
||||
} ;
|
||||
|
||||
|
||||
regV=MorphoKis.regV ;
|
||||
{-
|
||||
mkV = overload {
|
||||
mkV : Str -> V =\v ->lin V(regV v) ;
|
||||
mkV : Str -> V -> V = prefixV
|
||||
};
|
||||
|
||||
|
||||
prefixV : Str -> V -> V = \p,v -> lin V { s = \\b,vform => p + v.s! b ! vform } ;
|
||||
mkV2 = overload {
|
||||
mkV2 : V -> V2 = dirV2 ;
|
||||
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
|
||||
mkV2 : V -> Prep -> V2 = prepV2;
|
||||
mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPrep p) ;
|
||||
mkV2 : Str -> Prep -> V2 = \v,p -> prepV2 (regV v) p ;
|
||||
mkV2 : Str -> Str -> V2 = \v,p -> prepV2 (regV v) (mkPrep p)
|
||||
};
|
||||
|
||||
prepPrepV3 : V -> Prep -> Prep -> V3 ;
|
||||
dirV3 : V -> Prep -> V3 ;
|
||||
dirdirV3 : V -> V3 ;
|
||||
|
||||
mkV3 = overload {
|
||||
mkV3 : V -> Prep -> Prep -> V3 = prepPrepV3 ;
|
||||
mkV3 : V -> Prep -> V3 = dirV3 ;
|
||||
mkV3 : V -> Str -> V3 = \v,s -> dirV3 v (mkPrep s);
|
||||
mkV3 : Str -> Str -> V3 = \v,s -> dirV3 (regV v) (mkPrep s);
|
||||
mkV3 : V -> V3 = dirdirV3 ;
|
||||
mkV3 : Str -> V3 = \v -> dirdirV3 (regV v) ;
|
||||
} ;
|
||||
-}
|
||||
mkConj = overload {
|
||||
mkConj : Str -> Conj = \y -> mk2Conj [] y plural ;
|
||||
mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ;
|
||||
mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ;
|
||||
mkConj : Str -> Str -> Number -> Conj = mk2Conj ;
|
||||
} ;
|
||||
|
||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
lin Conj (sd2 x y ** {n = n}) ;
|
||||
|
||||
regPN : Str ->Gender -> PN ;
|
||||
nounPN : N -> PN ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
concrete PhraseKis of Phrase = CatKis ** PhraseBantu with
|
||||
(ResBantu = ResKis);
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
concrete QuestionKis of Question = CatKis ** QuestionBantu with
|
||||
(ResBantu = ResKis);
|
||||
@@ -1,2 +0,0 @@
|
||||
concrete RelativeKis of Relative = CatKis ** RelativeBantu with
|
||||
(ResBantu = ResKis);
|
||||
@@ -1,8 +0,0 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
|
||||
--1 Swalish auxiliary operations.
|
||||
|
||||
instance ResKis of ResBantu = DiffKis, CommonBantu ** open Prelude in {
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
concrete SentenceKis of Sentence = CatKis ** SentenceBantu with
|
||||
(ResBantu = ResKis);
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
concrete StructuralKis of Structural = CatKis **
|
||||
open MorphoKis, ParadigmsKis,
|
||||
(C = ConstructX), Prelude in {
|
||||
flags optimize=all ;
|
||||
lin
|
||||
above_Prep = mkPrep "juu ya" ;
|
||||
after_Prep = mkPrep "baada ya" ;
|
||||
all_Predet = {s = \\g => Allpredetprefix g + "ote"} ;
|
||||
almost_AdA = mkAdA "karibu " ;
|
||||
almost_AdN = mkAdN "nusura " ;
|
||||
although_Subj = ss "ingawa" ;
|
||||
always_AdV = mkAdV "dawama" ;
|
||||
and_Conj = mkConj "na" ;
|
||||
because_Subj = ss "maana" ;
|
||||
before_Prep = mkPrep "kabla ya" ;
|
||||
behind_Prep = mkPrep "baada" ;
|
||||
between_Prep = mkPrep "katikati" ;
|
||||
both7and_DConj = mkConj "eli" "na";
|
||||
but_PConj = ss "ila" ;
|
||||
by8agent_Prep = mkPrep "kwa" ;
|
||||
by8means_Prep = mkPrep "kwa" ;
|
||||
-- can8know_VV, can_VV = {
|
||||
during_Prep = mkPrep "katika" ;
|
||||
either7or_DConj = mkConj "ama" singular ;
|
||||
everybody_NP = regNP "kila mtu" a_wa singular ;
|
||||
every_Det = { s = table {Sub => "kila"; Obj g =>[]} ;n = Sg} ;
|
||||
everything_NP = regNP "kila kitu" ki_vi singular ;
|
||||
everywhere_Adv = mkAdv "kila sehemu" ;
|
||||
few_Det = {s = table {Obj g => Few_prefix g + "chache" ;
|
||||
Sub => [] };
|
||||
n= Pl
|
||||
} ;
|
||||
for_Prep = mkPrep nonExist ;
|
||||
from_Prep = mkPrep "tokea" ;
|
||||
he_Pron = mkPron "yeye" "ake" G1 Sg P3 ;
|
||||
here_Adv = mkAdv "hapa" ;
|
||||
here7to_Adv = mkAdv ["huko"] ;
|
||||
here7from_Adv = mkAdv ["hapa"] ;
|
||||
how_IAdv = ss "upi" ;
|
||||
how8much_IAdv = ss "ngapi" ;
|
||||
if_Subj = ss "Kama" ;
|
||||
in8front_Prep = mkPrep ["umbele "] ;
|
||||
i_Pron =mkPron "mimi" "angu" G1 Sg P1 ;
|
||||
in_Prep = mkPrep "ndani" ;
|
||||
it_Pron ={ s=\\c=>nonExist; poss=\\n,g=> nonExist; a=Ag G4 Sg P3};
|
||||
--less_CAdv = C.mkCAdv "kasoro" ;
|
||||
much_Det, many_Det = { s = table {
|
||||
Obj g => Many_prefix g + "ngi" ;
|
||||
Sub => []} ;
|
||||
n= Pl
|
||||
} ;
|
||||
more_Adv = mkAdv "zaidi" ;
|
||||
most_Predet = {s = \\g => MorphoKis.Mostpredetprefix g + "ngi"} ;
|
||||
-- must_VV = {
|
||||
---b no_Phr = ss "no" ;
|
||||
no_Utt = ss "hapana" ;
|
||||
on_Prep = mkPrep "juu ya" ;
|
||||
one_Quant = {s = \\n,g => "moja" } ;
|
||||
only_Predet = {s = \\g => "tu" } ;
|
||||
or_Conj = mkConj "kana" singular ;
|
||||
otherwise_PConj = ss "ila" ;
|
||||
please_Voc = ss "tafadhari" ;
|
||||
part_Prep, possess_Prep = let
|
||||
questo : ParadigmsKis.Number => MorphoKis.Gender => Str = table {
|
||||
Sg => \\g=> case <g> of { <G3> => "la" ;
|
||||
<G4> => "cha" ;
|
||||
<G5> => "ya" ;
|
||||
<G11> => "pa";
|
||||
<G12> => "kwa";
|
||||
<G13> => "mwa";
|
||||
<G1> |<G2>|<G6>|<G7> |<G8> => "wa" ;
|
||||
_ => ""};
|
||||
|
||||
Pl => \\g=> case <g> of{<G1> => "wa" ;
|
||||
<G4> => "vya" ;
|
||||
<G5>|<G6> => "za" ;
|
||||
<G2>|<G3> |<G8> |<G9> |<G10> => "ya";
|
||||
_ => ""}}
|
||||
in { s= questo};
|
||||
quite_Adv = mkAdv "kabisa" ;
|
||||
she_Pron = mkPron "yeye" "ake" G1 Sg P3;
|
||||
so_AdA = mkAdA "so" ;
|
||||
somebody_NP = regNP "mtu fulani" a_wa singular;
|
||||
someSg_Det = { s = table {
|
||||
Obj g => Detsomesgprefix g + "ngi";
|
||||
Sub => []} ;
|
||||
n= Sg
|
||||
} ;
|
||||
somePl_Det = { s = table {
|
||||
Obj g => Detsomeplprefix g + "ngi" ;
|
||||
Sub => []} ;
|
||||
n= Pl
|
||||
} ;
|
||||
something_NP = regNP "kitu fulani" ki_vi singular ;
|
||||
somewhere_Adv = mkAdv "seheme fulani" ;
|
||||
that_Quant = let
|
||||
questo : ParadigmsKis.Number => MorphoKis.Gender => Str = table {
|
||||
Sg => \\g=> case <g> of {
|
||||
<G1> => "huyo" ;
|
||||
<G2 > => "huo";
|
||||
<G3 > => "hilo";
|
||||
<G4 > => "hicho";
|
||||
<G5 > => "hiyo";
|
||||
<G6 > => "huo";
|
||||
<G7> => "huo";
|
||||
<G8> => "huo" ;
|
||||
<G11 > => "hapo";
|
||||
<G12 > => "huko";
|
||||
<G13 > => "humo";
|
||||
<G9 > | <G10 >=> ""
|
||||
};
|
||||
|
||||
Pl => \\g=> case <g> of{
|
||||
<G1> => "hao" ;
|
||||
<G2 > => "hiyo";
|
||||
<G3 > => "hayo";
|
||||
<G4 > => "hivyo";
|
||||
<G5 > => "hizo";
|
||||
<G6 > => "hizo";
|
||||
<G8> => "hayo" ;
|
||||
<G10 > => "hiyo";
|
||||
<G12 > => "huko";
|
||||
<G13 > => "humo";
|
||||
_ => ""
|
||||
}
|
||||
|
||||
};
|
||||
in {
|
||||
s = questo ;
|
||||
} ;
|
||||
there_Adv = mkAdv "hapo" ;
|
||||
there7to_Adv = mkAdv "hapa kuvika" ;
|
||||
there7from_Adv = mkAdv ["hapa kutoka"] ;
|
||||
therefore_PConj = ss "kwa ajili" ;
|
||||
they_Pron =mkPron "wao" "ao" G1 Pl P3 ;
|
||||
this_Quant = let
|
||||
questo : ParadigmsKis.Number => MorphoKis.Gender => Str = table {
|
||||
Sg => \\g=> case <g> of {
|
||||
<G1> => "huyu" ;
|
||||
<G11> => "hapa" ;
|
||||
<G12> => "huku" ;
|
||||
<G13> => "humu" ;
|
||||
<G4 > => "hiki";
|
||||
<G3 > => "hili";
|
||||
<G5 > => "hii";
|
||||
<G9 > |<G10 >=> "";
|
||||
<G2 > |<G8>|<G7> |<G6> => "huu"
|
||||
};
|
||||
|
||||
Pl => \\g=> case <g> of{
|
||||
<G1> => "hawa" ;
|
||||
<G4 > => "hivi";
|
||||
<G5 > |<G6 > => "hizi";
|
||||
<G2 > |<G10> => "hii";
|
||||
<G3 > |<G8 >|<G9 > => "haya";
|
||||
_=> ""
|
||||
}
|
||||
|
||||
}
|
||||
in {
|
||||
s = questo ;
|
||||
} ;
|
||||
through_Prep = mkPrep "kuvitila" ;
|
||||
too_AdA = mkAdA "vile" ;
|
||||
to_Prep = mkPrep "kuvika" ;
|
||||
under_Prep = mkPrep "chini ya" ;
|
||||
very_AdA = mkAdA "mno" ;
|
||||
-- want_VV = mkVV (regV "enda") ;
|
||||
we_Pron =mkPron "sisi" "etu" G1 Pl P1 ;
|
||||
--whatPl_IP = mkIP "ata" "ata" plural ;
|
||||
-- whatSg_IP = mkIP "ata" "ata" singular ;
|
||||
when_IAdv = ss "madhali" ;
|
||||
when_Subj = ss "madhali" ;
|
||||
where_IAdv = ss "wapi" ;
|
||||
which_IQuant = {s = \\_ => "wapi"} ;
|
||||
---b whichPl_IDet = mkDeterminer plural ["which"] ;
|
||||
---b whichSg_IDet = mkDeterminer singular ["which"] ;
|
||||
-- whoPl_IP = mkIP "uu" "whom" "whose" plural ;
|
||||
-- whoSg_IP = mkIP "who" "whom" "whose" singular ;
|
||||
why_IAdv = ss "kwa nini" ;
|
||||
without_Prep = mkPrep "bila" ;
|
||||
with_Prep = mkPrep "pamoja na" ;
|
||||
--yes_Phr = ss "ii" ;
|
||||
yes_Utt = ss "ndio" ;
|
||||
youSg_Pron = mkPron "wewe" "ako" G1 Sg P2 ;
|
||||
youPol_Pron,youPl_Pron = mkPron "nyinyi" "enyu" G1 Pl P3 ;
|
||||
not_Predet = {s = \\g => "nongi"} ;
|
||||
no_Quant = {s = \\g,n => "hakuna"} ;
|
||||
if_then_Conj = mkConj "kama" "basi" singular ;
|
||||
nobody_NP = regNP "hakuna mtu" a_wa singular ;
|
||||
nothing_NP = regNP "hukuna kitu" ki_vi singular ;
|
||||
at_least_AdN = mkAdN "" ;
|
||||
at_most_AdN = mkAdN "kuvika" ;
|
||||
except_Prep = mkPrep "kasoro" ;
|
||||
-- as_CAdv = C.mkCAdv "kama" ;
|
||||
-- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ;
|
||||
that_Subj = ss "hio" ;
|
||||
lin language_title_Utt = ss "kiswahili" ;
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
concrete VerbKis of Verb = CatKis ** VerbBantu with
|
||||
(ResBantu = ResKis);
|
||||
@@ -1,11 +1,16 @@
|
||||
concrete AdjectiveSwa of Adjective = CatSwa ** open ResSwa, Prelude , ParamX in {
|
||||
|
||||
concrete AdjectiveSwa of Adjective = CatSwa **AdjectiveBantu-[ComparA,UseComparA,ComplA2]
|
||||
with (ResBantu = ResSwa)** open DiffSwa in
|
||||
{
|
||||
flags coding=utf8;
|
||||
lin
|
||||
ComparA a np = {
|
||||
s = \\g,n => a.s !AAdj g n ++ conjThan ++ np.s ! npNom ;
|
||||
isPre = False} ;
|
||||
|
||||
PositA a = {
|
||||
s = a.s ! Posit ;
|
||||
UseComparA a = {s = \\g,n=> a.s !AAdj g n;isPre = True};
|
||||
|
||||
ComplA2 a np = {
|
||||
s = \\g,n => a.s !AAdj g n ++ a.c2 ++ np.s ! NPAcc;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
-- PositA a = a;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
concrete AdverbSwa of Adverb = CatSwa ** open ResSwa, Prelude in {
|
||||
|
||||
concrete AdverbSwa of Adverb = CatSwa **AdverbBantu -[ComparAdvAdj,ComparAdvAdjS] with
|
||||
(ResBantu = ResSwa)** open DiffSwa in
|
||||
{
|
||||
flags coding=utf8;
|
||||
lin
|
||||
|
||||
-- PositAdvAdj : A -> Adv ; -- vizuri
|
||||
|
||||
PositAdvAdj a = {
|
||||
s = a.s ! Posit ! AA
|
||||
ComparAdvAdj cadv a np =let agr = complAgr np.a
|
||||
in {
|
||||
s = cadv.s ++ a.s !AAdj agr.g agr.n ++ cadv.p ++ np.s ! npNom
|
||||
} ;
|
||||
ComparAdvAdjS cadv a s = {
|
||||
s = cadv.s ++ a.s !AAdj G1 Sg ++ cadv.p ++ s.s
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,45 +1,2 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
concrete CatSwa of Cat = CommonX ** open ResSwa, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
CN = {s,s1,s2 : Number => Str; g : Gender ; anim : Animacy ; hasAdj : Bool } ;
|
||||
N = {s : Number => Str; g : Gender ; anim : Animacy } ;
|
||||
N2 = {s : Number => Str; g : Gender ; anim : Animacy } ** {c2 : Str} ;
|
||||
N3 = {s : Number => Str; g : Gender ; anim : Animacy } ** {c2,c3 : Str} ;
|
||||
Pron = {s :Number => Str ; p : Person};
|
||||
V,VA = Verb ; -- = {s : VForm => Str} ;
|
||||
V2 = Verb ** {c2 : Str} ;
|
||||
NP = {s : Case => Str ; a : Agr} ;
|
||||
A = {s : Degree => AForm => Str} ;
|
||||
AP = {s : AForm => Str} ;
|
||||
Det = {s : Gender => Case => Animacy => Str ; n : Number } ;
|
||||
Quant = {s : Number => Gender => Animacy => Case => Str} ;
|
||||
Predet,Ord = {s : Str} ;
|
||||
|
||||
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
-- Verb
|
||||
|
||||
VP = ResSwa.VP ;
|
||||
|
||||
-- Numeral
|
||||
Num = {s : Gender => Str ; n : Number} ;
|
||||
|
||||
{--
|
||||
Num = {s : Gender => Animacy => Str ; n : Number} ;
|
||||
Card = {s : Gender => Animacy => Str ; n : Number} ;
|
||||
Digits = {s : Str ; n : Number} ;
|
||||
--}
|
||||
--Prepositions
|
||||
Prep = {s : Str} ;
|
||||
|
||||
-- Sentence
|
||||
|
||||
Cl = Clause ;
|
||||
|
||||
}
|
||||
concrete CatSwa of Cat = CommonX
|
||||
** CatBantu with (ResBantu = ResSwa);
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
concrete ConjunctionSwa of Conjunction =
|
||||
CatSwa ** open ResSwa, Coordination, Prelude in {
|
||||
|
||||
|
||||
|
||||
}
|
||||
concrete ConjunctionSwa of Conjunction = CatSwa ** ConjunctionBantu with
|
||||
(ResBantu = ResSwa);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
instance DiffKis of DiffBantu = open CommonBantu, Prelude in {
|
||||
instance DiffSwa of DiffBantu = open CommonBantu, Prelude in {
|
||||
|
||||
param
|
||||
GenderKis = G1|G2|G3|G4|G5|G6|G7|G8|G9|G10|G11|G12|G13 ;
|
||||
GenderSwa = G1|G2|G3|G4|G5|G6|G7|G8|G9|G10|G11|G12|G13 ;
|
||||
oper
|
||||
Gender = GenderKis ;
|
||||
Gender = GenderSwa ;
|
||||
firstGender = G1 ; secondGender = G2 ;
|
||||
conjThan = "kuliko" ;
|
||||
conjThat = "kuvita" ;
|
||||
@@ -1,9 +1,21 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarSwa of Grammar =NounSwa , AdjectiveSwa , StructuralSwa ,VerbSwa , SentenceSwa , AdverbSwa
|
||||
--# -path=.:../abstract:../common:../bantu:prelude
|
||||
|
||||
concrete GrammarSwa of Grammar =
|
||||
NounSwa,
|
||||
VerbSwa,
|
||||
AdjectiveSwa,
|
||||
AdverbSwa,
|
||||
NumeralSwa,
|
||||
SentenceSwa,
|
||||
QuestionSwa,
|
||||
RelativeSwa,
|
||||
ConjunctionSwa,
|
||||
PhraseSwa,
|
||||
TextX,
|
||||
StructuralSwa,
|
||||
IdiomSwa,
|
||||
TenseX
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
flags startcat = Phr ;
|
||||
} ;
|
||||
|
||||
@@ -1,7 +1,48 @@
|
||||
concrete IdiomSwa of Idiom = CatSwa ** open Prelude, ResSwa in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
{-
|
||||
lin
|
||||
ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
|
||||
GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
|
||||
|
||||
CleftNP np rs = mkClause "it" (agrP3 Sg)
|
||||
(insertObj (\\_ => rs.s ! np.a)
|
||||
(insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ;
|
||||
|
||||
CleftAdv ad s = mkClause "it" (agrP3 Sg)
|
||||
(insertObj (\\_ => conjThat ++ s.s)
|
||||
(insertObj (\\_ => ad.s) (predAux auxBe))) ;
|
||||
|
||||
ExistNP np =
|
||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
(insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ;
|
||||
|
||||
ExistIP ip =
|
||||
mkQuestion (ss (ip.s ! npNom))
|
||||
(mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
|
||||
|
||||
ExistNPAdv np adv =
|
||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
(insertObj (\\_ => np.s ! NPAcc ++ adv.s) (predAux auxBe)) ;
|
||||
|
||||
ExistIPAdv ip adv =
|
||||
mkQuestion (ss (ip.s ! npNom))
|
||||
(mkClause "there" (agrP3 ip.n) (insertObj (\\_ => adv.s) (predAux auxBe))) ;
|
||||
|
||||
ProgrVP vp = insertObj (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a) (predAux auxBe) ;
|
||||
|
||||
ImpPl1 vp = {s = "let's" ++ infVP VVAux vp Simul CPos (AgP1 Pl)} ;
|
||||
|
||||
ImpP3 np vp = {s = "let" ++ np.s ! NPAcc ++ infVP VVAux vp Simul CPos np.a} ;
|
||||
|
||||
SelfAdvVP vp = insertObj reflPron vp ;
|
||||
SelfAdVVP vp = insertAdVAgr reflPron vp ;
|
||||
SelfNP np = {
|
||||
s = \\c => np.s ! c ++ reflPron ! np.a ;
|
||||
a = np.a
|
||||
} ;
|
||||
} -}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
--# -path=.:../abstract:../bantu:../common:../api
|
||||
|
||||
concrete LangSwa of Lang =
|
||||
GrammarSwa,
|
||||
LexiconSwa
|
||||
-- ,ConstructionSwa
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,40 +1,80 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete LexiconSwa of Lexicon = CatSwa **
|
||||
open ParadigmsSwa, Prelude in {
|
||||
open ParadigmsSwa,StructuralSwa, Prelude in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
|
||||
bird_N = regN "ndege" e_e animate;
|
||||
country_N = regN "nchi" e_e inanimate ;
|
||||
cousin_N = regN "binamu" e_ma animate;
|
||||
cow_N = regN "ngombe" e_e animate;
|
||||
doctor_N = regN "daktari" e_ma animate ;
|
||||
dog_N = regN "mbwa" e_e animate ;
|
||||
door_N = regN "mlango" m_mi inanimate;
|
||||
enemy_N = regN "adui" e_ma animate;
|
||||
father_N = regN "baba" e_e animate;
|
||||
fish_N = regN "samaki" e_e animate;
|
||||
friend_N = regN "rafiki" e_ma animate;
|
||||
garden_N = regN "shamba" e_ma inanimate;
|
||||
girl_N = regN "msichana" m_wa animate ;
|
||||
lamp_N = regN "taa" e_e inanimate ;
|
||||
man_N = regN "mwanaume" m_wa animate ;
|
||||
tree_N = regN "mti" m_mi inanimate ;
|
||||
water_N = regN "maji" ma_ma inanimate ;
|
||||
woman_N = regN "mwanamke" m_wa animate ;
|
||||
ear_N = regN "sikio" e_ma inanimate ;
|
||||
eye_N = mkN "jicho" "macho" ji_ma inanimate ;
|
||||
fingernail_N = regN "ukucha" u_e inanimate ;
|
||||
nose_N = regN "pua" e_ma inanimate;
|
||||
person_N = regN "mtu" m_wa animate ;
|
||||
road_N = regN "barabara" e_e inanimate;
|
||||
tooth_N = regN "jino" ji_ma inanimate ;
|
||||
wife_N = regN "bibi" e_ma animate ;
|
||||
river_N = regN "mto" m_mi inanimate ;
|
||||
|
||||
person_N =regN "mtu" a_wa ;
|
||||
woman_N =iregN "mwanamke" "wanwake" a_wa ;
|
||||
house_N =regN "nyumba" i_zi ;
|
||||
tree_N = regN "mti" u_i ;
|
||||
big_A =regA "kubwa" ;
|
||||
beautiful_A = regA "rembo" ;
|
||||
black_A =regA "eusi" ;
|
||||
blue_A =cregA "buluu" ;
|
||||
broad_A = regA "pana" ;
|
||||
brown_A =regA "hudhurungi" ;
|
||||
clean_A = regA "safi" ;
|
||||
clever_A = regA "hodari" ;
|
||||
cold_A = regA "baridi" ;
|
||||
correct_A =regA "sahihi" ;
|
||||
dirty_A =regA "chafu" ;
|
||||
dry_A = regA "kavu" ;
|
||||
full_A =regA "tele" ;
|
||||
good_A =regA "zuri" ;
|
||||
green_A =cregA "kijani" ;
|
||||
heavy_A = regA "zito" ;
|
||||
hot_A =regA "moto" ;
|
||||
important_A = regA "muhimu" ;
|
||||
long_A = regA "refu" ;
|
||||
narrow_A = regA "embamba" ;
|
||||
near_A = regA "karibu" ;
|
||||
new_A =regA "pya" ;
|
||||
old_A =regA "zee" ;
|
||||
red_A =regA "ekundu" ;
|
||||
rotten_A = regA "oza" ;
|
||||
round_A = regA "virgo" ;
|
||||
sharp_A = regA "kali" ;
|
||||
short_A = regA "fupi" ;
|
||||
smooth_A = regA "lai" ;
|
||||
straight_A =regA "nyofu" ;
|
||||
stupid_A =regA "jiga" ;
|
||||
thick_A =regA "nene" ;
|
||||
thin_A = regA "embamba" ;
|
||||
ugly_A =regA "baya";
|
||||
warm_A =regA "fufutende" ;
|
||||
wet_A =regA "nyevu" ;
|
||||
white_A =regA "eupe" ;
|
||||
yellow_A =regA "njano" ;
|
||||
young_A = regA "bichi" ;
|
||||
small_A = regA "dogo" ;
|
||||
cow_N = regN "ngombe" i_zi ;
|
||||
doctor_N =iregN "daktari" "daktari" a_wa ;
|
||||
dog_N =iregN "mbwa" "mbwa" a_wa ;
|
||||
door_N =regN "mlango" u_i ;
|
||||
enemy_N =regN "adui" a_wa ;
|
||||
fish_N = regN "samaki" a_wa ;
|
||||
friend_N =iregN "rafiki" "rafiki" a_wa ;
|
||||
garden_N = iregN "bustani" "bustani" li_ya ;
|
||||
girl_N = regN "msichana" a_wa ;
|
||||
lamp_N = regN "taa" li_ya ;
|
||||
man_N = iregN "mwanaume" "wanaume" a_wa ;
|
||||
eye_N = iregN "jicho" "macho" li_ya ;
|
||||
tooth_N = regN "jino" li_ya ;
|
||||
wife_N = iregN "bibi" "bibi"a_wa ;
|
||||
bird_N = regN "ndege" a_wa ;
|
||||
country_N = regN "nchi" i_zi ;
|
||||
cousin_N = iregN "binamu" "Binami" a_wa;
|
||||
father_N = regN "baba" "baba" a_wa ;
|
||||
water_N = iregN "maji" "maji" ya_ya ;
|
||||
ear_N = regN "sikio" li_ya ;
|
||||
fingernail_N = regN "ukucha" u_zi ;
|
||||
nose_N = regN "pua" li_ya ;
|
||||
road_N = iregN "barabara" "barabara" i_zi ;
|
||||
river_N = regN "mto" u_i ;
|
||||
come_V = regV "kuja";
|
||||
walk_V = regV "tembea";
|
||||
sleep_V = regV "lala";
|
||||
@@ -45,55 +85,289 @@ lin
|
||||
swim_V = regV "ogelea";
|
||||
think_V = regV "waza";
|
||||
travel_V = regV "safiri";
|
||||
|
||||
big_A = regA "kubwa";
|
||||
paris_PN = regPN "Paris" ku_ku ; -- this is alreay name of place avoid kwa
|
||||
john_PN = regPN "Yoana" a_wa ;
|
||||
question_N = regN "swali" i_zi ;
|
||||
-- ready_A = regA "ready" ;
|
||||
reason_N = regN "sababu" i_zi ;
|
||||
today_Adv = mkAdv "today" ;
|
||||
--uncertain_A = regA "uncertain" ;
|
||||
distance_N3 = mkN3 (mkN "umbali" "umbali" i_zi ) fromP toP ;
|
||||
add_V3= regV "ongeza";
|
||||
airplane_N=iregN "ndege" "ndege" i_zi ;
|
||||
alas_Interj= ss "ala";
|
||||
animal_N=regN "mnyama" a_wa;
|
||||
ask_V2Q=regV "uliza" ;
|
||||
baby_N=regN "mtoto" a_wa;
|
||||
belly_N=regN "tumbo" i_zi ;
|
||||
blood_N=iregN "damu" "damu" i_zi ;
|
||||
book_N=regN "kitabu" ki_vi;
|
||||
boss_N=iregN "bosi" "bosi"a_wa;
|
||||
boy_N=regN "kijana" a_wa;
|
||||
bread_N=regN " mkate" u_i;
|
||||
breast_N=regN "titi" li_ya;
|
||||
brother_N2= mkN2(mkN "kaka" "kaka" a_wa) mkPrepof ;
|
||||
burn_V=regV "choma";
|
||||
buy_V2=regV "nunua";
|
||||
car_N=regN "gari" li_ya;
|
||||
cat_N=iregN "paka" "paka" a_wa;
|
||||
chair_N=regN "kiti" ki_vi;
|
||||
child_N=regN "mtoto" a_wa;
|
||||
church_N=regN "mtoto" a_wa;
|
||||
city_N=regN "mji" u_i;
|
||||
close_V2=regV "karibu";
|
||||
coat_N=regN "koti" li_ya;
|
||||
computer_N=iregN "kompyuta" "kompyuta" li_ya;
|
||||
cut_V2=regV "kata";
|
||||
day_N=regN "siku" li_ya;
|
||||
die_V=regV "kufa";
|
||||
dig_V=regV "kulima";
|
||||
do_V2=regV " fanya";
|
||||
drink_V2=regV " kunywa";
|
||||
earth_N=iregN "ardhi" "ardhi" i_zi;
|
||||
eat_V2=regV " kula" ;
|
||||
egg_N=regN " yai" li_ya;
|
||||
fall_V=regV "anguka" ;
|
||||
far_Adv=mkAdv"mbali";
|
||||
fat_N=regN "mafuta" li_ya;
|
||||
father_N2=mkN2 ( mkN "baba" "baba"a_wa) mkPrepof ;
|
||||
fear_V2=regV "ongopa" ;
|
||||
find_V2=regV "tafuta";
|
||||
fire_N=iregN "moto" "moto" u_i;
|
||||
foot_N=regN" mguu" u_i;
|
||||
forest_N=regN "msitu" u_i;
|
||||
go_V=regV "enda" ;
|
||||
gold_N=iregN "dhahabu" "dhahabu" li_ya;
|
||||
grass_N=regN "nyasi" i_zi;
|
||||
hair_N=iregN "nywele" "Nywele" i_zi;
|
||||
hand_N=regN "mkono" u_i;
|
||||
hat_N=iregN "kofia" "kofia" i_zi;
|
||||
head_N=regN "kichwa" ki_vi;
|
||||
hear_V2=regV " sikia";
|
||||
heart_N=regN "moyo" u_i;
|
||||
hill_N=regN " kilima" ki_vi;
|
||||
husband_N=regN" mume" a_wa;
|
||||
ice_N=iregN "barafu" "barafu" i_zi;
|
||||
jump_V=regV "ruka";
|
||||
kill_V2=regV "ua";
|
||||
king_N=regN "mfalame" a_wa;
|
||||
knee_N=regN "goti" li_ya;
|
||||
know_V2=regV "jua";
|
||||
laugh_V=regV "cheka";
|
||||
leaf_N=regN "jani" li_ya;
|
||||
learn_V2=regV "soma";
|
||||
leg_N=regN " mguu" u_i;
|
||||
listen_V2=regV " sikiza";
|
||||
love_N=regN "upendo" u_zi;
|
||||
married_A2= mkA2(regA "oa") "ni";
|
||||
meat_N=regN "nyama" i_zi;
|
||||
milk_N=regN "maziwa" i_zi;
|
||||
moon_N=regN "mwezi" u_i;
|
||||
mother_N2=mkN2( mkN "mama""mama" a_wa) mkPrepof ;
|
||||
mountain_N=regN "mlima" u_i;
|
||||
mouth_N=regN "mdomo" u_i;
|
||||
name_N=regN " jina" li_ya;
|
||||
neck_N=regN "shingo" li_ya;
|
||||
night_N=regN "usiku" u_zi;
|
||||
number_N=regN "namba" li_ya;
|
||||
oil_N=regN "mafuta" ya_ya;
|
||||
open_V2=regV " fungua";
|
||||
paper_N=regN " karatasi" li_ya;
|
||||
peace_N=regN "amani" ya_ya;
|
||||
play_V=regV " cheza";
|
||||
policeman_N=regN "askari" a_wa;
|
||||
priest_N=regN "kasisi" a_wa;
|
||||
rain_N=regN "mvua" i_zi;
|
||||
rock_N=regN "jabali" li_ya;
|
||||
root_N=regN "mzizi" u_i;
|
||||
rope_N=regN "kamba" li_ya;
|
||||
run_V=regV "imbia";
|
||||
salt_N=iregN "chumvi" "chumvi" i_zi;
|
||||
sand_N=iregN "changarawe" "changarawe" ki_vi;
|
||||
school_N=iregN " shule" "shule" i_zi;
|
||||
sea_N=iregN "bahari" "Bahari" li_ya;
|
||||
see_V2=regV "angalia";
|
||||
seed_N=regN "mbengu" i_zi;
|
||||
seek_V2=regV " tafuta";
|
||||
sell_V3=regV "uza";
|
||||
send_V3=regV "tuma";
|
||||
sheep_N=iregN "Kondoo" "Kondoo" li_ya;
|
||||
shoe_N=regN "kiatu" ki_vi;
|
||||
shop_N=iregN "duka" "duka" li_ya;
|
||||
sing_V=regV "imba";
|
||||
sister_N=iregN "dada" "dada" a_wa;
|
||||
sit_V=regV"keti";
|
||||
snake_N=iregN "nyoka" "nyoka" a_wa;
|
||||
song_N=regN "wimbo" u_zi;
|
||||
speak_V2=regV "ongea";
|
||||
star_N=regN "nyota" i_zi;
|
||||
student_N=regN "mwanafunzi" a_wa;
|
||||
sun_N=regN "jua" li_ya;
|
||||
table_N=regN "meza" i_zi;
|
||||
teach_V2=regV "somesha";
|
||||
teacher_N=regN "mwalimu" a_wa;
|
||||
tongue_N=regN "ulimi" u_zi;
|
||||
understand_V2=regV" elewa";
|
||||
wait_V2=regV "gojea";
|
||||
war_N=iregN "vita" "vita" u_zi;
|
||||
wash_V2=regV "osha";
|
||||
win_V2=regV "shinda";
|
||||
wind_N=regN " upepo" u_zi;
|
||||
window_N=regN "dirisha" li_ya;
|
||||
write_V2=regV " andika";
|
||||
year_N=regN "mwaka" u_i;
|
||||
already_Adv=mkAdv "zamani";
|
||||
answer_V2S=regV" jibu";
|
||||
apartment_N=iregN " nyumba ya ghorofa" "nyumba za ghorofa" i_zi;
|
||||
apple_N=iregN "tofaa" "tofaa" li_ya;
|
||||
art_N=iregN "weledi" "weledi" u_zi;
|
||||
ashes_N=regN "jivu" li_ya;
|
||||
back_N=regN "mgongo" u_i;
|
||||
bad_A=regA"ovu" ;
|
||||
bank_N=iregN "benki" "benki" i_zi;
|
||||
bark_N=regN "gamba" li_ya;
|
||||
become_VA=regV "ingia";
|
||||
beer_N=regN "mtindi" u_i;
|
||||
beg_V2V=regV "omba";
|
||||
bike_N=iregN " baisikeli" "basikeli" i_zi;
|
||||
bite_V2=regV "donoa";
|
||||
blow_V=regV"puliza";
|
||||
boat_N=regN "shua" li_ya;
|
||||
bone_N=regN "mfupa" u_i;
|
||||
boot_N=regN "buti" li_ya;
|
||||
break_V2=regV "goboa";
|
||||
breathe_V=regV "pumua";
|
||||
butter_N=iregN "siagi" "siagi" i_zi;
|
||||
camera_N=iregN "kamera" "kamera" i_zi;
|
||||
cap_N=iregN "heti" "heti" i_zi;
|
||||
carpet_N=regN "zulia" li_ya;
|
||||
ceiling_N=regN "dari" li_ya;
|
||||
cheese_N=regN " chisi" li_ya;
|
||||
cloud_N=regN "wingu" li_ya;
|
||||
count_V2=regV "hesabu";
|
||||
dull_A=iregA "butu" "butu" ;
|
||||
dust_N=regN "fumbi" li_ya;
|
||||
--easy_A2V= regA "epesi";
|
||||
empty_A=regA "tupu" ;
|
||||
factory_N=regN "banda" i_zi;
|
||||
fear_VS=regV "ogopa";
|
||||
feather_N=regN "unyoya" u_ya;
|
||||
fight_V2=regV "pigana";
|
||||
float_V=regV "elea";
|
||||
floor_N=iregN "sakafu" "sakafu" i_zi;
|
||||
flow_V=regV "tiririk";
|
||||
flower_N=regN "ua" li_ya;
|
||||
fly_V=regV"pepea";
|
||||
fog_N=regN "ukungu" u_ya;
|
||||
forget_V2=regV "sahau";
|
||||
freeze_V=regV"ganda";
|
||||
fridge_N=iregN "friji" "friji" i_zi;
|
||||
fruit_N=regN "zao" u_ya;
|
||||
fun_AV=regA "kejeli";
|
||||
give_V3=regV "patiana";
|
||||
glove_N=iregN "glavu" "glavu" i_zi;
|
||||
grammar_N=iregN "sarafi" "sarafi" i_zi;
|
||||
guts_N= regN "tumbo" li_ya; --confirm the tranlation
|
||||
harbour_N=regN"bandari" li_ya;
|
||||
hate_V2=regV"chukia";
|
||||
hit_V2=regV "gonga";
|
||||
hold_V2=regV "shika";
|
||||
hope_VS=regV "tumai";
|
||||
horn_N=iregN "pembe" " Pembe" i_zi;
|
||||
horse_N=iregN "farasi" "farasi" a_wa;
|
||||
hunt_V2=regV "saka";
|
||||
industry_N=regN "kiwanda" ki_vi;
|
||||
iron_N=regN "chuma" ki_vi;
|
||||
know_VQ=regV "fahamu";
|
||||
know_VS=regV "jua";
|
||||
lake_N=regN "ziwa" li_ya;
|
||||
language_N=regN "lugha" u_zi;
|
||||
leather_N=iregN "ngozi" "ngozi" i_zi;
|
||||
leave_V2=regV "achwa";
|
||||
left_Ord= mkOrd "kushoto"; --what is the translation
|
||||
lie_V=regV "daganya";
|
||||
like_V2=regV "pendea";
|
||||
live_V=regV "penda";
|
||||
liver_N=regN "ini" li_ya;
|
||||
lose_V2=regV "poteza";
|
||||
louse_N=iregN "chawa" "chawa" i_zi;
|
||||
love_V2=regV "pendwa";
|
||||
music_N=regN "muziki" u_i;
|
||||
newspaper_N=regN "jarida" li_ya;
|
||||
now_Adv=mkAdv "sasa";
|
||||
paint_V2A=regV "paka";
|
||||
pen_N=iregN " kalamu" "kalamu" i_zi;
|
||||
planet_N=iregN "sayari" "sayari" i_zi;
|
||||
plastic_N=iregN "plastiki" "plastiki" i_zi;
|
||||
play_V2=regV "cheza";
|
||||
probable_AS=regA"kini";
|
||||
pull_V2=regV "vuta";
|
||||
push_V2=regV "sukuma";
|
||||
put_V2=regV "tia";
|
||||
queen_N=iregN "malkia" "malkia" a_wa;
|
||||
radio_N=iregN "redio" "redio" i_zi;
|
||||
rain_V0=regV "nyesha";
|
||||
read_V2=regV "soma";
|
||||
ready_A=iregA "tayari" "tayari";
|
||||
religion_N=regN "dini" li_ya;
|
||||
restaurant_N=regN "mkahawa" u_i;
|
||||
right_Ord= mkOrd"kulia";
|
||||
roof_N=regN "paa" li_ya;
|
||||
rub_V2=regV "sugua";
|
||||
rubber_N=regN "mpira" u_i;
|
||||
rule_N=regN "utawala" u_zi;
|
||||
say_VS=regV "tamka";
|
||||
science_N=iregN "sayansi" "sayansi" i_zi;
|
||||
scratch_V2=regV "kwaruza";
|
||||
sew_V=regV "shona";
|
||||
ship_N=iregN "meli" "meli" i_zi;
|
||||
shirt_N=regN "shati" li_ya;
|
||||
silver_N=iregN "fedha" "fedha" i_zi;
|
||||
skin_N=iregN "ngozi" "ngozi" i_zi;
|
||||
sky_N=regN "anga" li_ya;
|
||||
smoke_N=iregN "moshi" "moshi" u_zi;
|
||||
snow_N=iregN "theluji" "theluji" i_zi;
|
||||
sock_N=iregN "soksi" "soksi" i_zi;
|
||||
spit_V=regV"tema";
|
||||
split_V2=regV"pasua";
|
||||
squeeze_V2=regV "finya";
|
||||
stab_V2=regV" tofua";
|
||||
steel_N=regN "chuma" ki_vi;
|
||||
stick_N=regN "kijiti" ki_vi;
|
||||
stone_N=iregN " jiwe" "mawe" li_ya;
|
||||
stove_N=iregN "jiko" "meko" li_ya;
|
||||
suck_V2=regV "fyonza";
|
||||
switch8off_V2=regV "poesha";
|
||||
switch8on_V2=regV "akisha";
|
||||
tail_N=regN "mkia" u_i;
|
||||
talk_V3=regV "ongea";
|
||||
television_N=iregN "televisheni" " televisheni" i_zi;
|
||||
throw_V2=regV "tupa";
|
||||
tie_V2=regV "funga";
|
||||
train_N=iregN "gari ya moshi" "magari ya moshi" li_ya;
|
||||
turn_V=regV "geuka";
|
||||
uncertain_A=iregA "geugeu" "geugeu";
|
||||
university_N=iregN "chuo kikuu" "vyuo vikuu" ki_vi;
|
||||
village_N=regN "kitongoji" ki_vi;
|
||||
vomit_V=regV "tapika";
|
||||
watch_V2=regV "dhibiti";
|
||||
wide_A=iregA "panapana" "panapana";
|
||||
wine_N=regN "mvinyo" u_i;
|
||||
wing_N=regN"bawa" li_ya;
|
||||
wipe_V2=regV"futa";
|
||||
wonder_VQ=regV "shangaa";
|
||||
wood_N=regN "mti" u_i;
|
||||
worm_N=regN "funza" li_ya;
|
||||
|
||||
beautiful_A = regA "rembo" ;
|
||||
black_A = regA "eusi";
|
||||
blue_A = regA "buluu" ;
|
||||
broad_A = regA "pana" ;
|
||||
brown_A = regA "hudhurungi" ;
|
||||
clean_A = regA "safi" ;
|
||||
clever_A = regA "hodari" ;
|
||||
cold_A = regA "baridi";
|
||||
correct_A = regA "sahihi" ;
|
||||
dirty_A = regA "chafu" ;
|
||||
dry_A = regA "kavu" ;
|
||||
dull_A = regA "liofifia" ;
|
||||
full_A = regA "tele" ;
|
||||
good_A = regA "zuri" ;
|
||||
green_A = regA "kijani";
|
||||
heavy_A = regA "zito" ;
|
||||
hot_A = regA "moto" ;
|
||||
important_A = regA "muhimu" ;
|
||||
long_A = regA "refu" ;
|
||||
narrow_A = regA "embamba" ;
|
||||
near_A = regA "karibu" ;
|
||||
new_A = regA "pya" ;
|
||||
old_A = regA "zee" ;
|
||||
ready_A = regA "tayari" ;
|
||||
red_A = regA "ekundu" ;
|
||||
rotten_A = regA "oza" ;
|
||||
round_A = regA "viringo" ;
|
||||
sharp_A = regA "kali" ;
|
||||
short_A = regA "fupi" ;
|
||||
small_A = regA "dogo" ;
|
||||
smooth_A = regA "laini" ;
|
||||
straight_A = regA "nyofu" ;
|
||||
stupid_A = regA "jinga" ;
|
||||
thick_A = regA "nene" ;
|
||||
thin_A = regA "embamba" ;
|
||||
ugly_A = regA "baya";
|
||||
certain_A = regA "hakika" ;
|
||||
warm_A = regA "fufutende" ;
|
||||
wet_A = regA "nyevu" ;
|
||||
white_A = regA "eupe" ;
|
||||
wide_A = regA "pana" ;
|
||||
yellow_A = regA "njano" ;
|
||||
young_A = regA "bichi" ;
|
||||
|
||||
father_N2 = mkN2 (regN "baba" e_e animate) (mkPrep "ya") ;
|
||||
mother_N2 = mkN2 (regN "mama" e_e animate) (mkPrep "ya");
|
||||
brother_N2 = mkN2 (regN "ndugu" e_e animate) (mkPrep "ya") ;
|
||||
oper
|
||||
aboutP = mkPrep "juu ya" ;
|
||||
atP = mkPrep "vala ve" ;
|
||||
forP = mkPrep "for" ;
|
||||
fromP = mkPrep "kutoka" ;
|
||||
inP = mkPrep "ndani" ;
|
||||
onP = mkPrep "juu" ;
|
||||
toP = mkPrep "hadi" ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,229 +1,351 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
--# -path=.:../../prelude
|
||||
|
||||
--1 A Simple Swahili Resource Morphology
|
||||
--1 Kiswahili morphology Resource Morphology
|
||||
--
|
||||
-- This resource morphology contains definitions needed in the resource
|
||||
-- syntax. To build a lexicon, it is better to use $ParadigmsSwa$, which
|
||||
-- gives a higher-level access to this module.
|
||||
-- Benson Kituku 2017-2018
|
||||
|
||||
resource MorphoSwa = open Prelude, (Predef=Predef), ResSwa in {
|
||||
|
||||
resource MorphoSwa = CommonBantu ,ResSwa
|
||||
** open Prelude, Predef
|
||||
in {
|
||||
|
||||
flags optimize=all ;
|
||||
--$Nouns--
|
||||
oper
|
||||
|
||||
CommonNoun : Type = {s : Number => Str; g : Gender ; anim : Animacy } ;
|
||||
|
||||
numForms : Str -> Str -> Number => Str = \bon,bons ->
|
||||
table {Sg => bon ; Pl => bons} ;
|
||||
|
||||
mkNoun : (Number => Str) -> Gender -> Animacy -> CommonNoun = \mecmecs,gen,anim ->
|
||||
{s = mecmecs ; g = gen ; anim = anim} ;
|
||||
|
||||
mkNounIrreg : Str -> Str -> Gender -> Animacy -> CommonNoun = \mec,mecs,gen,anim ->
|
||||
mkNoun (numForms mec mecs) gen anim ;
|
||||
|
||||
mkNomReg : Str -> Gender -> Animacy -> CommonNoun = \mtu,gen,anim ->
|
||||
let watu = case gen of {
|
||||
g1_2 => case Predef.take 3 mtu of {
|
||||
"mwa" => Predef.drop 1 mtu ;
|
||||
"mwi" => "wa"+ Predef.drop 2 mtu ;
|
||||
_ => "wa" + Predef.drop 1 mtu
|
||||
}; -- mtu/watu
|
||||
g3_4 => "mi" + Predef.drop 1 mtu ; -- mti/miti
|
||||
g5_6 => "me" + Predef.drop 2 mtu ; -- jicho/macho
|
||||
g5a_6 => "ma" + mtu ; -- somo/masomo
|
||||
g7_8 => "vi" + Predef.drop 2 mtu ; -- kitabu/vitabu
|
||||
g11_6 => "ma" + Predef.drop 1 mtu ; -- ugonjwa/magonjwa
|
||||
g11_10 => Predef.drop 1 mtu ; -- ukuta/kuta
|
||||
_ => mtu -- ma_ma (maji/maji); e_e (taa/taa); u_u (uhuru/uhuru)
|
||||
Many_prefix : Gender -> Str = \g ->
|
||||
case <g> of {
|
||||
<G1> => "we" ;
|
||||
<G2> => "mi" ;
|
||||
<G10> => "nyi" ;
|
||||
<G11> => "pe" ;
|
||||
<G12> => "kwi" ;
|
||||
<G4> => "vi" ;
|
||||
<G5>|<G6> => "nyi" ;
|
||||
<G7> |<G13> => "mwi" ;
|
||||
<G3>|<G8> |<G9> => "me"
|
||||
} ;
|
||||
in mkNounIrreg mtu watu gen anim ;
|
||||
|
||||
mkNn : Str -> Str -> Gender -> Animacy -> CommonNoun = \mec,mecs,gen,anim ->
|
||||
mkNoun (numForms mec mecs) gen anim ;
|
||||
|
||||
--Autonomous Personal Pronoun
|
||||
mkPronoun :Number -> Person-> Str= \n,p ->
|
||||
case <n,p> of {
|
||||
<Sg,P1> => "mimi" ;
|
||||
<Sg,P2> => "wewe" ;
|
||||
<Sg,P3> => "yeye" ;
|
||||
<Pl,P1> => "sisi" ;
|
||||
<Pl,P2> => "nyinyi" ;
|
||||
<Pl,P3> => "wao"
|
||||
Few_prefix : Gender -> Str = \g ->
|
||||
case <g> of {
|
||||
<G1> => "wa" ;
|
||||
<G2> => "mi" ;
|
||||
<G10> => "" ;
|
||||
<G11> => "pa" ;
|
||||
<G12> => "ku" ;
|
||||
<G4> => "vi" ;
|
||||
<G5>|<G6> => "" ;
|
||||
<G7> |<G13> => "m" ;
|
||||
<G3>|<G8> |<G9> => "ma"
|
||||
} ;
|
||||
|
||||
Detsomesgprefix : Gender -> Str = \g ->
|
||||
case <g> of {
|
||||
<G3> => "li" ;
|
||||
<G4> => "ki" ;
|
||||
<G9> => "me";
|
||||
<G11> => "pe" ;
|
||||
<G12> => "kwi" ;
|
||||
<G5>|<G10> => "nyi" ;
|
||||
<G1> |<G6>|<G2>|<G7>|<G8> |<G13> => "mwi"
|
||||
|
||||
} ;
|
||||
|
||||
Detsomeplprefix : Gender -> Str = \g ->
|
||||
case <g> of {
|
||||
<G1> => "we" ;
|
||||
<G2> => "mi" ;
|
||||
<G10> => "nyi" ;
|
||||
<G11> => "pe" ;
|
||||
<G12> => "kwi" ;
|
||||
<G4> => "vi" ;
|
||||
<G5>|<G6> => "nye" ;
|
||||
<G7> |<G13> => "mwi" ;
|
||||
<G3>|<G8> |<G9> => "me"
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
--$Verbs
|
||||
{--
|
||||
VerbprefixR : Agr -> Str = \a -> Verbprefix a.n a.g a.anim a.p ;
|
||||
|
||||
|
||||
|
||||
Verbprefix : Number -> Gender -> Animacy -> Person -> Str = \n,g,anim,p ->
|
||||
case <anim,n,g,p> of {
|
||||
<_,Sg,_,P1> => "ni" ;
|
||||
<_,Sg,_,P2> => "u" ;
|
||||
<_,Pl,_,P1> => "tu" ;
|
||||
<_,Pl,_,P2> => "m" ;
|
||||
<AN,Sg,_,_> => "a" ;
|
||||
<AN,Pl,_,_> => "wa" ;
|
||||
<_,Sg,g1_2,_> => "a" ;
|
||||
<_,Pl,g1_2,_> => "wa" ;
|
||||
<_,Sg,g3_4,_> => "u" ;
|
||||
<_,Pl,g3_4,_> => "i" ;
|
||||
<_,Sg,g5_6,_> => "li" ;
|
||||
<_,Pl,g5_6,_> => "ya" ;
|
||||
<_,Sg,g5a_6,_> => "li" ;
|
||||
<_,Pl,g5a_6,_> => "ya" ;
|
||||
<AN,Sg,g6,_> => "a" ;
|
||||
<AN,Pl,g6,_> => "wa" ;
|
||||
<_,Sg,g6,_> => "ya" ;
|
||||
<_,Pl,g6,_> => "ya" ;
|
||||
<_,Sg,g7_8,_> => "ki" ;
|
||||
<_,Pl,g7_8,_> => "vi" ;
|
||||
<_,Sg,g9_10,_> => "i" ;
|
||||
<_,Pl,g9_10,_> => "zi" ;
|
||||
<_,_,g11,_> => "u" ;
|
||||
<_,Sg,g11_6,_> => "u" ;
|
||||
<_,Pl,g11_6,_> => "ya" ;
|
||||
<_,Sg,g11_10,_> => "u" ;
|
||||
<_,Pl,g11_10,_> => "zi"
|
||||
} ;
|
||||
|
||||
|
||||
Verbprefix : Number -> Gender -> Animacy -> Person -> Str = \n,g,anim,p ->
|
||||
case <anim,n,g,p> of {
|
||||
<AN,Sg,_,P1> => "ni" ;
|
||||
<AN,Pl,_,P1> => "tu" ;
|
||||
<_,_,_,_> => ""
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
mkV : Str -> {s : VForm => Str} =
|
||||
\cheza -> {
|
||||
s = table {
|
||||
--VInf => "ku"+cheza ;
|
||||
VInf => case Predef.take 2 cheza of {
|
||||
"ku" => cheza;
|
||||
_ => "ku"+cheza
|
||||
};
|
||||
VImper n p => case <n,p> of {<Sg,P2> => init cheza + "eni";<_,_> => cheza};
|
||||
VPres n g anim p => Verbprefix n g anim p ++ "na" ++ cheza;
|
||||
VPast n g anim p => Verbprefix n g anim p ++ "li" ++ cheza ;
|
||||
VFut n g anim p => Verbprefix n g anim p ++ "ta" ++ cheza
|
||||
mkNum : Str -> Str -> {s : DForm => CardOrd => Gender => Str} =
|
||||
\two, second ->
|
||||
{s = table {
|
||||
unit => table {NCard =>\\g => Cardprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ two} ;
|
||||
teen => table {NCard =>\\g =>"kumi na" ++ Cardprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi na" ++ Cardprefix g + two} ;
|
||||
ten => table {NCard =>\\g =>second ++"na" ++ Cardprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ second ++"na" ++ Cardprefix g + two};
|
||||
hund => table {NCard =>\\g =>"mia " ++ two ;
|
||||
NOrd => \\g => Ordprefix g ++ "mia " ++ two }
|
||||
}
|
||||
} ;
|
||||
|
||||
--}
|
||||
|
||||
--2 Adjectives
|
||||
-- To form the adjectival and the adverbial forms, two strings are needed
|
||||
-- in the worst case. (First without degrees.)
|
||||
|
||||
Adj = {s : AForm => Str} ;
|
||||
|
||||
VowelAdjprefix : Number -> Gender -> Animacy -> Str = \n,g,anim ->
|
||||
case <anim,n,g> of {
|
||||
<AN,Sg,_> => "mw" ;
|
||||
<AN,Pl,_> => "w" ;
|
||||
<_,Sg,g1_2> => "mw" ;
|
||||
<_,Pl,g1_2> => "w" ;
|
||||
<_,Sg,g3_4> => "mw" ;
|
||||
<_,Pl,g3_4> => "m" ;
|
||||
<_,Sg,g5_6> => "nj" ;
|
||||
<_,Pl,g5_6> => "m" ;
|
||||
<_,Sg,g5a_6> => "mw" ;
|
||||
<_,Pl,g5a_6> => "ny" ;
|
||||
<_,Sg,g6> => "m" ;
|
||||
<_,Pl,g6> => "m" ;
|
||||
<_,Sg,g7_8> => "ki" ;
|
||||
<_,Pl,g7_8> => "vi" ;
|
||||
<_,Sg,g9_10> => "ny" ;
|
||||
<_,Pl,g9_10> => "" ;
|
||||
<_,_,g11> => "m" ;
|
||||
<_,Sg,g11_6> => "m" ;
|
||||
<_,Pl,g11_6> => "ma" ;
|
||||
<_,Sg,g11_10> => "ny" ;
|
||||
<_,Pl,g11_10> => "m"
|
||||
} ;
|
||||
|
||||
|
||||
ConsonantAdjprefix : Number -> Gender -> Animacy -> Str = \n,g,anim ->
|
||||
case <anim,n,g> of {
|
||||
<AN,Sg,_> => "m" ;
|
||||
<AN,Pl,_> => "wa" ;
|
||||
<_,Sg,g1_2> => "m" ;
|
||||
<_,Pl,g1_2> => "wa" ;
|
||||
<_,Sg,g3_4> => "" ;
|
||||
<_,Pl,g3_4> => "" ;
|
||||
<_,Sg,g5_6> => "" ;
|
||||
<_,Pl,g5_6> => "ma" ;
|
||||
<_,Sg,g5a_6> => "" ;
|
||||
<_,Pl,g5a_6> => "ma" ;
|
||||
<_,Sg,g6> => "ma" ;
|
||||
<_,Pl,g6> => "ma" ;
|
||||
<_,Sg,g7_8> => "ki" ;
|
||||
<_,Pl,g7_8> => "vi" ;
|
||||
<_,Sg,g9_10> => "i" ;
|
||||
<_,Pl,g9_10> => "" ;
|
||||
<_,_,g11> => "m" ;
|
||||
<_,Sg,g11_6> => "m" ;
|
||||
<_,Pl,g11_6> => "ma" ;
|
||||
<_,Sg,g11_10> => "m" ;
|
||||
<_,Pl,g11_10> => "n"
|
||||
} ;
|
||||
|
||||
|
||||
mkAdjective : Str -> Adj = \zuri ->
|
||||
{
|
||||
s = table {
|
||||
AF n g anim => case Predef.take 1 zuri of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix n g anim + zuri;
|
||||
_ => ConsonantAdjprefix n g anim +zuri
|
||||
};
|
||||
AA => zuri
|
||||
mkNumn : Str -> Str -> Str -> {s : DForm => CardOrd => Gender => Str} =
|
||||
\two, twelve, second ->
|
||||
{s = table {
|
||||
unit => table {NCard =>\\g => Cardtwoprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ second} ;
|
||||
teen => table {NCard =>\\g =>"kumi na" ++ Cardtwoprefix g + two;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi na" ++ Cardtwoprefix g + two} ;
|
||||
ten => table {NCard =>\\g =>twelve ;
|
||||
NOrd => \\g => Ordprefix g ++ twelve};
|
||||
hund => table {NCard =>\\g =>"mia mb " + two ;
|
||||
NOrd => \\g => Ordprefix g ++ "mia mb" + two}
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
mkDeterminer : Number -> Str -> {s : Str ; n : Number} = \n,s ->
|
||||
{s = s ; n = n} ;
|
||||
|
||||
mkQuant : Spatial -> Number -> Gender -> Animacy -> Case -> Person -> Str = \sp,n,g,anim,c,p ->
|
||||
let
|
||||
pfx = "foo" ; ---- Verbprefix n g anim p ;
|
||||
in
|
||||
case <anim,n,c> of {
|
||||
<AN,Sg,Nom> => case <sp> of {
|
||||
<SpHrObj> => "huyu" ;
|
||||
<HrObj> => "huyo" ;
|
||||
<_> => "yule" } ;
|
||||
|
||||
<_,_,_> => case <sp> of {
|
||||
<SpHrObj> => "h" + Predef.dp 1 (Verbprefix n g anim p) + Verbprefix n g anim p ; --sphrobj ;
|
||||
-- <HrObj> => mkQuantEnd (Predef.tk 1 sphrobj) ;
|
||||
<HrObj> => mkQuantEnd (Predef.tk 1 ("h" + Predef.dp 1 (Verbprefix n g anim p) + Verbprefix n g anim p)) ;
|
||||
<_> => Verbprefix n g anim p + "le" }
|
||||
mkNume : Str -> Str -> {s : DForm => CardOrd => Gender => Str} =
|
||||
\two, second ->
|
||||
{s = table {
|
||||
unit => table {NCard =>\\g => Cardoneprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ second} ;
|
||||
teen => table {NCard =>\\g =>"kumi na" ++ Cardoneprefix g + two ;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi na" ++ Cardoneprefix g + two} ;
|
||||
ten => table {NCard =>\\g =>"kumi" ;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi"};
|
||||
hund => table {NCard =>\\g =>"mia " ++ two ;
|
||||
NOrd => \\g => Ordprefix g ++ "mia" ++ two}
|
||||
}
|
||||
} ;
|
||||
|
||||
mkQuantEnd : Str -> Str = \stem ->
|
||||
let
|
||||
suffix = Predef.dp 1 stem ;
|
||||
front = Predef.tk 1 stem
|
||||
in
|
||||
case <suffix> of {
|
||||
<"i"> => stem + "yo" ;
|
||||
<"k"> => front + "cho" ;
|
||||
<"v"> => front + "vyo" ;
|
||||
<"w"> => front + "o" ;
|
||||
<_> => stem + "o"
|
||||
regNum : Str ->Str -> {s : DForm => CardOrd => Gender => Str} =
|
||||
\six,sixth -> {s = table {
|
||||
unit => table {NCard =>\\g => six ;
|
||||
NOrd => \\g => Ordprefix g ++ six} ;
|
||||
teen => table {NCard =>\\g =>"kumi na" ++ six ;
|
||||
NOrd => \\g => Ordprefix g ++ "kumi na" ++ six} ;
|
||||
ten => table {NCard =>\\g =>sixth ++"na" ++ six ;
|
||||
NOrd => \\g => Ordprefix g ++ sixth ++"na" ++ six };
|
||||
hund => table {NCard =>\\g =>"mia " ++ six ;
|
||||
NOrd => \\g => Ordprefix g ++ "mia" ++ six}
|
||||
} } ;
|
||||
|
||||
|
||||
regCardOrd : Str -> {s : CardOrd => Gender => Str} = \ten ->
|
||||
{s = table {NCard => \\g => ten ;
|
||||
NOrd =>\\g => Ordprefix g ++ ten } } ;
|
||||
|
||||
regCardone : Str -> Str -> {s : CardOrd => Gender => Str} = \ten,one ->
|
||||
{s = table {NCard => \\g => ten ++ Cardoneprefix g + one ;
|
||||
NOrd =>\\g => Ordprefix g ++ ten ++ Cardoneprefix g + one } } ;
|
||||
|
||||
mkCard : CardOrd -> Str -> Gender => Str = \o,ten ->
|
||||
(regCardOrd ten).s ! o ;
|
||||
|
||||
regN : Str ->Gender -> Noun = \w, g -> let wpl = case g of {
|
||||
G1=>case w of {
|
||||
"mwa" + _ => PrefixPlNom G1 + Predef.drop 3 w ;
|
||||
"mwi" + _ => "we" + Predef.drop 3 w ;
|
||||
"ki" + _ => PrefixPlNom G4 + Predef.drop 2 w ;
|
||||
"m" + _ => PrefixPlNom G1 + Predef.drop 1 w ;
|
||||
_ => w };
|
||||
G2=>case w of {
|
||||
"mw" + _ => PrefixPlNom G2 + Predef.drop 2 w ;
|
||||
"mu" + _ => PrefixPlNom G2 + Predef.drop 2 w ;
|
||||
_ => PrefixPlNom G2 + Predef.drop 1 w };
|
||||
G4=> case w of {
|
||||
"ki" + _ => PrefixPlNom G4 + Predef.drop 2 w ;
|
||||
"ch" + _ => "vy" + Predef.drop 2 w ;
|
||||
_ => w };
|
||||
G6 |G8 => PrefixPlNom g + Predef.drop 1 w;
|
||||
G11 |G12|G13 => "" ;
|
||||
_ => PrefixPlNom g + w };
|
||||
|
||||
in iregN w wpl g ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
iregN :Str-> Str ->Gender -> Noun= \man,men,g -> { -- for irregular noun
|
||||
s = table{Sg => table{Nom => man ;
|
||||
Loc=> man + "ni" | men + "ni" };
|
||||
Pl => table{Nom => men ; Loc=> ""}} ;
|
||||
g = g
|
||||
} ;
|
||||
|
||||
regA:Str -> {s : AForm => Str} = \seo -> {s = table {
|
||||
AAdj G1 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix G1 Sg + seo;
|
||||
_ => ConsonantAdjprefix G1 Sg + seo };
|
||||
AAdj G1 Pl =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G1 Pl + seo;
|
||||
"i" => VoweliAdjprefix G1 Pl + seo;
|
||||
_ => ConsonantAdjprefix G1 Pl + seo };
|
||||
|
||||
AAdj G2 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix G2 Sg + seo;
|
||||
_ => ConsonantAdjprefix G2 Sg + seo };
|
||||
AAdj G2 Pl =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G2 Pl + seo;
|
||||
"i" => VoweliAdjprefix G2 Pl + seo;
|
||||
_ => ConsonantAdjprefix G2 Pl + seo };
|
||||
AAdj G3 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix G3 Sg + seo;
|
||||
_ => ConsonantAdjprefix G3 Sg + seo };
|
||||
AAdj G3 Pl =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G3 Pl + seo;
|
||||
"i" => VoweliAdjprefix G3 Pl + seo;
|
||||
_ => ConsonantAdjprefix G3 Pl + seo };
|
||||
|
||||
AAdj G4 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G4 n + seo;
|
||||
"i" => VoweliAdjprefix G4 n + seo;
|
||||
_ => ConsonantAdjprefix G4 n + seo };
|
||||
AAdj G5 n => case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G5 n + seo;
|
||||
"i" => "ny" + Predef.drop 1 seo;
|
||||
"d"|"g"|"z" => "n" + seo;
|
||||
"b"|"p"|"v" => "m" + seo;
|
||||
_ => ConsonantAdjprefix G5 n + seo };
|
||||
|
||||
AAdj G6 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix G6 Sg + seo;
|
||||
_ => ConsonantAdjprefix G6 Sg + seo };
|
||||
AAdj G6 Pl =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G6 Pl + seo;
|
||||
"i" => "ny" + Predef.drop 1 seo;
|
||||
"d"|"g"|"z" => "n" + seo;
|
||||
"b"|"p"|"v" => "m" + seo;
|
||||
_ => ConsonantAdjprefix G6 Pl + seo };
|
||||
|
||||
AAdj G7 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G7 n + seo;
|
||||
"i" => VoweliAdjprefix G7 n + seo;
|
||||
_ => ConsonantAdjprefix G7 n + seo };
|
||||
AAdj G8 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G8 n + seo;
|
||||
"i" => VoweliAdjprefix G8 n + seo;
|
||||
_ => ConsonantAdjprefix G8 n + seo };
|
||||
AAdj G9 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G9 n + seo;
|
||||
"i" => VoweliAdjprefix G9 n + seo;
|
||||
_ => ConsonantAdjprefix G9 n + seo };
|
||||
AAdj G10 n =>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G9 n + seo;
|
||||
"i" => VoweliAdjprefix G9 n + seo;
|
||||
_ => ConsonantAdjprefix G9 n + seo };
|
||||
|
||||
AAdj G11 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G11 Sg + seo;
|
||||
"i" => VoweliAdjprefix G11 Sg + seo;
|
||||
_ => ConsonantAdjprefix G11 Sg + seo };
|
||||
|
||||
AAdj G12 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G12 Sg + seo;
|
||||
"i" => VoweliAdjprefix G12 Sg + seo;
|
||||
_ => ConsonantAdjprefix G12 Sg + seo };
|
||||
AAdj G13 Sg=>case Predef.take 1 seo of {
|
||||
"a"|"e"|"o"|"u" => VowelAdjprefix G13 Sg + seo;
|
||||
"i" => VoweliAdjprefix G13 Sg + seo;
|
||||
_ => ConsonantAdjprefix G13 Sg + seo };
|
||||
AAdj _ Pl =>[] }};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
iregA : Str-> Str -> {s : AForm => Str} = \seo,seoo -> {
|
||||
s = table {
|
||||
AAdj g Sg=> seo;
|
||||
AAdj g Pl => seoo} };
|
||||
|
||||
|
||||
cregA : Str-> {s : AForm => Str} = \seo -> {
|
||||
s = table {
|
||||
AAdj g Sg => ProunSgprefix g + "a" ++"rangi" ++"ya" ++ seo;
|
||||
AAdj g Pl=> ProunPlprefix g + "a" ++"rangi" ++"ya" ++ seo} } ;
|
||||
|
||||
regV : Str -> Verb =
|
||||
\vika -> {
|
||||
s = table{ True => table{
|
||||
VInf => vika;
|
||||
VPres g n p => Verbprefix g n p + vika;
|
||||
VPast g n p => Verbprefix g n p + init vika + "ie" ;
|
||||
VFut g n p => Verbfutureprefix g n p + vika
|
||||
} ;
|
||||
False =>table {
|
||||
VInf => "ndi" + vika;
|
||||
VPres g n p => neg (Ag g n p) False Pres + "na" + vika ;
|
||||
VPast g n p => neg (Ag g n p) False Past + "ne" + vika ;
|
||||
VFut g n p => neg (Ag g n p) False Fut + "ka" + vika
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
neg : Agr -> Bool ->Tense -> Str = \a,b,t -> let
|
||||
g = getGender a;
|
||||
n=getNumber a;
|
||||
p=getPerson a
|
||||
in case b of {True => [] ; False => negprefix g n t p} ;
|
||||
|
||||
negprefix : Gender -> Number -> Tense -> Person -> Str =\g,n,t,p-> case <g,n,t,p> of {
|
||||
<G1,Sg,_,P1> => "ndi";
|
||||
<G1,Sg,_,P2> => "ndu";
|
||||
<G1,Sg,_,P3> => "ndu";
|
||||
<G1,Pl,_,P1> => "twi";
|
||||
<G1,Pl,_,P2> => "mwi";
|
||||
<G1,Pl,_,P3> => "mai";
|
||||
<G2,Sg,_,_> => "ndu";
|
||||
<G2,Pl,_,_> => "i";
|
||||
<G3,Sg,_,_> => "i";
|
||||
<G3,Pl,_,_> => "mai";
|
||||
<G4,Sg,_,_> => "ki";
|
||||
<G4,Pl,_,_> => "i";
|
||||
<G5,Sg,_,_> => "kai";
|
||||
<G5,Pl,_,_> => "tui";
|
||||
<G6,Sg,_,_> => "vai";
|
||||
<G6,Pl,_,_> => "kui";
|
||||
<G7,Sg,_,_> => "i";
|
||||
<_,_,_,_> => "syi"
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Verbprefix : Gender -> Number -> Person -> Str = \g, n, p ->
|
||||
case <g,n,p> of {
|
||||
<G1,Sg,P1> => "na" ;
|
||||
<G1,Sg,P2> => "wa" ;
|
||||
<G1,Sg,P3> => "wa" ;
|
||||
<G1,Pl,P1> => "twa" ;
|
||||
<G1,Pl,P2> => "mwa" ;
|
||||
<G1,Pl,P3> => "ma" ;
|
||||
<G2,Sg,_> => "wa" ;
|
||||
<G2,Pl, _> => "ya" ;
|
||||
<G4,Sg,_> => "kya" ;
|
||||
<G4,Pl,_> => "sya" ;
|
||||
<G3,Sg,_> => "ya" ;
|
||||
<G3,Pl,_> => "ma" ;
|
||||
<G5,Sg,_> => "ka" ;
|
||||
<G5,Pl,_> => "twa" ;
|
||||
<G6,Sg,_> => "va" ;
|
||||
<G6,Pl,_> => "kwa" ;
|
||||
<G7,Sg,_> => "ya" ;
|
||||
<_,_,_> => "sya"
|
||||
} ;
|
||||
|
||||
Verbfutureprefix : Gender -> Number -> Person -> Str = \g, n, p ->
|
||||
case <g,n,p> of {
|
||||
<G1,Sg,P1> => "nga" ;
|
||||
<G1,Sg,P2> => "uka" ;
|
||||
<G1,Sg,P3> => "uka" ;
|
||||
<G1,Pl,P1> => "tuka" ;
|
||||
<G1,Pl,P2> => "muka" ;
|
||||
<G1,Pl,P3> => "maka" ;
|
||||
<G2,Sg,_> => "uka" ;
|
||||
<G2,Pl, _> => "ika" ;
|
||||
<G4,Sg,_> => "kika" ;
|
||||
<G4,Pl,_> => "ika" ;
|
||||
<G3,Sg,_> => "ika" ;
|
||||
<G3,Pl,_> => "maka" ;
|
||||
<G5,Sg,_> => "kaka" ;
|
||||
<G5,Pl,_> => "tuka" ;
|
||||
<G6,Sg,_> => "vaka" ;
|
||||
<G6,Pl,_> => "kuka" ;
|
||||
<G7,Sg,_> => "ika" ;
|
||||
<_,_,_> => "ika"
|
||||
} ;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,83 +1,2 @@
|
||||
|
||||
concrete NounSwa of Noun = CatSwa ** open MorphoSwa, ResSwa, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
UseN noun = {
|
||||
s = noun.s ;
|
||||
s1 = noun.s ;
|
||||
s2 = noun.s ;
|
||||
g = noun.g ;
|
||||
anim = noun.anim ;
|
||||
hasAdj = False
|
||||
} ;
|
||||
|
||||
UseN2 noun = {
|
||||
s = noun.s ;
|
||||
s1 = noun.s ;
|
||||
s2 = noun.s ;
|
||||
g = noun.g ;
|
||||
anim = noun.anim ;
|
||||
hasAdj = False
|
||||
} ;
|
||||
|
||||
|
||||
-- Num
|
||||
|
||||
NumSg = {s = \\_ => [] ; n = Sg} ;
|
||||
NumPl = {s = \\_ => [] ; n = Pl} ;
|
||||
|
||||
|
||||
DetQuant quant num = {
|
||||
s = \\g,c,anim => quant.s ! num.n ! g ! anim ! c ++ num.s ! g;
|
||||
n = num.n
|
||||
};
|
||||
|
||||
AdjCN ap cn =
|
||||
let
|
||||
anim = cn.anim ;
|
||||
g = cn.g;
|
||||
mod = cn.hasAdj
|
||||
in{
|
||||
s = \\n => cn.s ! n ++ ap.s ! (AF n g anim) ;
|
||||
s1 = \\n => cn.s1 ! n;
|
||||
s2=case <mod> of {
|
||||
<False> => \\n => ap.s ! (AF n g anim);
|
||||
<True> => \\n => cn.s2 ! n ++ ap.s ! (AF n g anim)
|
||||
};
|
||||
g = g ;
|
||||
anim = anim ;
|
||||
hasAdj=True
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
--DetCN : Det -> CN -> NP ; -- mtu huyo
|
||||
|
||||
|
||||
DetCN det cn =
|
||||
let
|
||||
anim = cn.anim ;
|
||||
g = cn.g ;
|
||||
n = det.n ;
|
||||
mod = cn.hasAdj
|
||||
in case <mod> of {
|
||||
<False> => {
|
||||
s = \\c => cn.s ! n ++ det.s ! g ! c ! anim ;
|
||||
a = agr n g anim P3
|
||||
} ;
|
||||
<True> => {
|
||||
s = \\c => cn.s1 ! n ++ det.s ! g ! c ! anim ++ cn.s2 ! n ;
|
||||
a = agr n g anim P3
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
concrete NounSwa of Noun =
|
||||
CatSwa ** NounBantu with (Structural = StructuralSwa), (ResBantu = ResSwa);
|
||||
|
||||
@@ -1,4 +1,87 @@
|
||||
concrete NumeralSwa of Numeral = CatSwa [Numeral,Digits] ** open ResSwa in {
|
||||
concrete NumeralSwa of Numeral = CatSwa [Numeral,Digits] **
|
||||
open Prelude,DiffSwa,MorphoSwa in {
|
||||
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Gender => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Gender => Str ; n : Number} ;
|
||||
Sub100 = {s : CardOrd => Gender => Str ; n : Number} ;
|
||||
Sub1000 = {s : CardOrd => Gender => Str ; n : Number} ;
|
||||
Sub1000000 = {s : CardOrd => Gender => Str ; n : Number} ;
|
||||
|
||||
lin num x = x ;
|
||||
lin n2 = mkNumn "ili" "ishirini" "pili" ;
|
||||
lin n3 = mkNum "tatu" "thelathini" ;
|
||||
lin n4 = mkNum "nne" "arobaini" ;
|
||||
lin n5 = mkNum "tano" "hamsini" ;
|
||||
lin n6 = regNum "sita" "sitini";
|
||||
lin n7 = regNum "saba" "sabini";
|
||||
lin n8 = regNum "nane" "themanini";
|
||||
lin n9 = regNum "tisa" "tisini" ;
|
||||
|
||||
lin pot01 = mkNume "moja" "kwanza" ** {n = Sg} ;
|
||||
lin pot0 d = d ** {n = Pl} ;
|
||||
lin pot110 = regCardOrd "kumi" ** {n = Pl} ;
|
||||
lin pot111 = regCardone "kumi na" "moja" ** {n = Pl} ; -- creat another function to be gender specific
|
||||
lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ;
|
||||
lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ;
|
||||
lin pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
||||
lin pot1plus d e = { s = table {
|
||||
NCard => \\g => d.s ! ten ! NCard ! g ++ "na"++ e.s ! unit ! NCard ! g ;
|
||||
NOrd => \\g =>Ordprefix g++ d.s ! ten ! NCard ! g ++ "na"++ e.s ! unit ! NCard ! g } ;
|
||||
n = Pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ! hund} ** {n = Pl} ;
|
||||
lin pot2plus d e = {s = table {
|
||||
NCard => \\g => d.s ! hund ! NCard ! g ++ "na" ++ e.s !NCard ! g ;
|
||||
NOrd => \\g =>Ordprefix g++ d.s ! hund ! NCard ! g ++ "na" ++ e.s ! NCard ! g } ;
|
||||
n = Pl} ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = { s = table {
|
||||
NCard => \\g => mkCard NCard "elfu" ! g ++ n.s ! NCard ! g ;
|
||||
NOrd => \\g =>Ordprefix g++ mkCard NCard "elfu" ! g ++ n.s ! NCard ! g } ;
|
||||
n = Pl} ;
|
||||
lin pot3plus n m = { s = table {
|
||||
NCard => \\g => "elfu" ++ n.s ! NCard !g ++ m.s ! NCard ! g ;
|
||||
NOrd => \\g =>Ordprefix g++ "elfu" ++ n.s ! NCard !g ++ m.s ! NCard ! g} ;
|
||||
n = Pl} ;
|
||||
|
||||
-- numerals as sequences of digits0'
|
||||
|
||||
lincat
|
||||
Dig = TDigit ;
|
||||
|
||||
lin
|
||||
IDig d = d ;
|
||||
|
||||
IIDig d i = {
|
||||
--s = \\o,g => d.s ! NCard ! g ++ i.s ! o ! g ;
|
||||
s = table {NCard => \\g => d.s! NCard ! g ++ BIND ++ i.s ! NCard ! g ;
|
||||
NOrd => \\g => d.s! NOrd! g ++ BIND ++ i.s !NCard! g } ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mk3Dig "1" "1" Sg ;
|
||||
D_2 = mkDig "2" ;
|
||||
D_3 = mkDig "3" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
oper
|
||||
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c ) ;
|
||||
|
||||
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||
s = table {NCard => \\g => c ; NOrd => \\g =>Ordprefix g ++ o} ; --Ordprefix g ++
|
||||
n = n} ;
|
||||
|
||||
TDigit = {
|
||||
n : Number ;
|
||||
s : CardOrd => Gender => Str
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
|
||||
--1 Swahili Lexical Paradigms
|
||||
|
||||
|
||||
resource ParadigmsSwa = open(Predef=Predef), Prelude, MorphoSwa,ResSwa,CatSwa in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
resource ParadigmsSwa = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoSwa,
|
||||
ResSwa,
|
||||
CatSwa
|
||||
in {
|
||||
|
||||
oper
|
||||
Animacy : Type ;
|
||||
|
||||
animate : Animacy ;
|
||||
inanimate : Animacy ;
|
||||
Gender : Type ;
|
||||
a_wa : Gender ; --m-wa
|
||||
u_i : Gender ; --m-mi
|
||||
li_ya : Gender ; --ji-ma
|
||||
ki_vi : Gender ; --kivi
|
||||
i_zi : Gender ; -- nn
|
||||
u_zi : Gender ; --uu
|
||||
u_u : Gender ; --uu
|
||||
u_ya : Gender;
|
||||
ya_ya : Gender;
|
||||
i_i : Gender;
|
||||
ku_ku : Gender ; --uu
|
||||
pa_pa : Gender ; --uu
|
||||
mu_mu : Gender ; --uu
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
|
||||
@@ -26,146 +33,405 @@ oper
|
||||
|
||||
-- To abstract over case names, we define the following.
|
||||
|
||||
Case : Type ;
|
||||
Case : Type ; --%
|
||||
|
||||
nominative : Case ;
|
||||
locative : Case ;
|
||||
nominative : Case ; --%
|
||||
locative : Case ; --%
|
||||
|
||||
-- To abstract over nounclass names, we define the following.
|
||||
|
||||
Gender : Type ;
|
||||
|
||||
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 ;
|
||||
|
||||
npNumber : NP -> Number ; -- exctract the number of a noun phrase
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Worst case: give all four forms and the semantic gender.
|
||||
|
||||
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 = <>} ;
|
||||
-- Nouns are constructed by the function $mkN$, which takes a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkN : overload {
|
||||
mkN : (flash : Str) -> Gender -> N ; --regular plural
|
||||
mkN : (man,men : Str) ->Gender -> N ; -- irregular plural
|
||||
mkN : Str -> N -> N -- e.g. chuo + kikuu compound noun
|
||||
} ;
|
||||
|
||||
--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 ;
|
||||
|
||||
--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
|
||||
mkN2 : overload {
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
mkN2 : N -> Str -> N2 ;
|
||||
mkN2 : N -> N2 ;
|
||||
mkN2 : N -> (Gender => Number => Str)-> N2 ;
|
||||
} ;
|
||||
|
||||
oper dfltGender : Gender = G1 ;
|
||||
dfltNumber : Number = Sg ;
|
||||
|
||||
-- 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
|
||||
|
||||
|
||||
|
||||
--3 Proper names and noun phrases
|
||||
--
|
||||
-- Proper names, with a regular genitive, are formed from strings.
|
||||
|
||||
mkPN : overload {
|
||||
|
||||
mkPN : Str ->Gender -> PN ;
|
||||
|
||||
-- Sometimes a common noun can be reused as a proper name, e.g. "Bank"
|
||||
|
||||
mkPN : N -> PN --%
|
||||
} ;
|
||||
|
||||
--3 Determiners and quantifiers
|
||||
|
||||
mkOrd : Str -> Ord ; --%
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA : overload {
|
||||
mkA : (happy : Str) -> A ;
|
||||
mkA : (fat,fatter : Str) -> A ; -- irreg.
|
||||
} ;
|
||||
|
||||
|
||||
--3 Two-place adjectives
|
||||
|
||||
mkA2 : overload {
|
||||
mkA2 : A -> Prep -> A2 ; -- absent from
|
||||
mkA2 : A -> Str -> A2 ; -- absent from --%
|
||||
mkA2 : Str -> Prep -> A2 ; -- absent from --%
|
||||
mkA2 : Str -> Str -> A2 -- absent from --%
|
||||
|
||||
} ;
|
||||
|
||||
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.
|
||||
-- after the verb. Some can be preverbal (e.g. "always").
|
||||
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||
mkAdv : Str -> Adv ; -- e.g. today
|
||||
mkAdV : Str -> AdV ; -- e.g. always
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ; -- e.g. quite
|
||||
|
||||
-- Adverbs modifying numerals
|
||||
|
||||
mkAdN : Str -> AdN ; -- e.g. approximately
|
||||
|
||||
--2 Prepositions
|
||||
|
||||
mkPrep : overload {
|
||||
mkPrep : Str -> Prep ;
|
||||
mkPrep : (Gender => Number => Str) -> Prep ;
|
||||
} ;
|
||||
|
||||
noPrep : Prep ; -- no preposition
|
||||
|
||||
-- (These two functions are synonyms.)
|
||||
|
||||
--2 Conjunctions
|
||||
--
|
||||
|
||||
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) --%
|
||||
} ;
|
||||
|
||||
--2 Verbs
|
||||
--
|
||||
|
||||
-- Verbs are constructed by the function $mkV$, which takes a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkV : overload {
|
||||
mkV : (cry : Str) -> V ; -- regular, incl. cry-cries, kiss-kisses etc
|
||||
mkV : Str -> V -> V ; -- fix compound, e.g. under+take
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs). Notice that a particle comes from the $V$.-}
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ; -- kill --%
|
||||
mkV2 : V -> V2 ; -- transitive, e.g. hit
|
||||
mkV2 : V -> Prep -> V2 ; -- with preposiiton, e.g. believe in
|
||||
mkV2 : V -> Str -> V2 ; -- believe in --%
|
||||
mkV2 : Str -> Prep -> V2 ; -- believe in --%
|
||||
mkV2 : Str -> Str -> V2 -- believe in --%
|
||||
};
|
||||
|
||||
--3 Three-place verbs
|
||||
--
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 : overload {
|
||||
mkV3 : V -> V3 ; -- ditransitive, e.g. give,_,_
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- two prepositions, e.g. speak, with, about
|
||||
mkV3 : V -> Prep -> V3 ; -- give,_,to --%
|
||||
mkV3 : V -> Str -> V3 ; -- give,_,to --%
|
||||
mkV3 : Str -> Str -> V3 ; -- give,_,to --%
|
||||
mkV3 : Str -> V3 ; -- give,_,_ --%
|
||||
};
|
||||
|
||||
|
||||
--2 Other categories
|
||||
|
||||
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.
|
||||
|
||||
Gender = MorphoSwa.Gender ;
|
||||
Number = MorphoSwa.Number ;
|
||||
Case = MorphoSwa.NPCase ;
|
||||
a_wa = G1 ;--%
|
||||
u_i = G2 ;
|
||||
li_ya = G3 ;
|
||||
ki_vi = G4 ;
|
||||
i_zi = G5 ;
|
||||
u_zi = G6 ;
|
||||
u_u = G7 ;
|
||||
u_ya = G8 ;
|
||||
ya_ya = G9 ;
|
||||
i_i =G10 ;
|
||||
ku_ku = G11;
|
||||
pa_pa =G12 ;
|
||||
mu_mu =G13;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
nominative = npNom ;
|
||||
locative = npLoc ;
|
||||
|
||||
npNumber np = (agrFeatures np.a).n ;
|
||||
|
||||
|
||||
regN = MorphoSwa.regN ;
|
||||
iregN = MorphoSwa.iregN ;
|
||||
|
||||
|
||||
compoundN s n = lin N {s = \\x,y => s ++ n.s ! x ! y ; g=n.g} ;
|
||||
|
||||
mkPN = overload {
|
||||
-- mkPN : Str -> PN = regPN ;
|
||||
mkPN : Str -> Gender -> PN = regPN;
|
||||
mkPN : N -> PN = nounPN
|
||||
} ;
|
||||
|
||||
|
||||
mkN2 = overload {
|
||||
mkN2 : N -> Prep -> N2 = prepN2 ;
|
||||
mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPrep s);
|
||||
mkN2 : N -> N2 = \n -> prepN2 n (mkPrep mkPrepof ) ;
|
||||
mkN2 : N -> (Number =>Gender => Str)-> N2= \n,s -> prepN2 n (mkPrep mkPrepof) ;
|
||||
} ;
|
||||
|
||||
prepN2 = \n,p -> lin N2 (n ** {c2 = p}) ;
|
||||
regN2 = \n -> (prepN2 n (mkPrep mkPrepof )) ;
|
||||
mkN3 = \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ;
|
||||
mkPrepof : Number => Gender => Str =
|
||||
table Number { Sg => table { G1 |G2|G6|G7 |G8 => "wa" ;
|
||||
G3=> "la" ;
|
||||
G4 => "cha" ;
|
||||
G5 => "ya" ;
|
||||
G11 => "pa";
|
||||
G12 => "kwa";
|
||||
G13 => "mwa";
|
||||
_ => ""} ;
|
||||
|
||||
Pl => table { G1 => "wa" ;
|
||||
G2|G3 |G8 |G9 |G10 => "ya" ;
|
||||
G4 => "vya" ;
|
||||
G5|G6 => "za" ;
|
||||
_ => ""} } ;
|
||||
|
||||
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
cnN2 : CN -> Prep -> N2 ;
|
||||
cnN3 : CN -> Prep -> Prep -> N3 ;
|
||||
|
||||
|
||||
cnN2 = \n,p -> lin N2 (n ** {c2 = p}) ;
|
||||
cnN3 = \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ;
|
||||
|
||||
|
||||
regPN n g = lin PN {s = table {Loc => "" ; _ => n} ; g = g} ;
|
||||
|
||||
|
||||
nounPN n = lin PN {s = n.s ! singular ; g = n.g} ;
|
||||
|
||||
mkOrd : Str -> Ord = \x -> lin Ord { s =\\g => x};
|
||||
|
||||
|
||||
prepA2 a p = lin A2 (a ** {c2 = p.s!Sg!G1}) ;
|
||||
|
||||
mkAdv x = lin Adv (ss x) ;
|
||||
mkAdV x = lin AdV (ss x) ;
|
||||
mkAdA x = lin AdA (ss x) ;
|
||||
mkAdN x = lin AdN (ss x) ;
|
||||
|
||||
mkPrep = overload {
|
||||
mkPrep : Str -> Prep = \str -> lin Prep {s = \\n,g => str } ;
|
||||
mkPrep : (Number => Gender => Str) -> Prep = \t ->lin Prep {s = t} ;
|
||||
} ;
|
||||
|
||||
noPrep = mkPrep [] ;
|
||||
{-} mkPrep : Str -> Str -> Prep = \p,q -> lin Prep
|
||||
{s = table{Sg => table{G1 => p; _=> "" };
|
||||
Pl => table{G1 => q; _=> ""}}} ;
|
||||
prepV2 : V -> Prep -> V2 ;
|
||||
prepV2 = \v,p -> lin V2 (v ** {c2 = p.s!Sg!G1}) ;
|
||||
dirV2 : V -> V2 = \v -> prepV2 v noPrep ;
|
||||
|
||||
prepPrepV3 v p q = lin V3 (v ** {c2 = p ; c3 = q}) ;
|
||||
dirV3 v p = prepPrepV3 v noPrep p ;
|
||||
dirdirV3 v = dirV3 v noPrep ;
|
||||
|
||||
|
||||
mkA2V : A -> Prep -> Prep -> A2V;
|
||||
A2S, A2V : Type = A2 ;
|
||||
mkA2V v p q = mkA2 v p ** {s3 = q.p2 ; c3 = q.p1 ; lock_A2V = <>} ;
|
||||
|
||||
|
||||
mkAV v = v ** { lock_AV = <>} ;
|
||||
mkAV : A -> AV ;
|
||||
AS, AV : Type = A ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkAS v = v ** {lock_AS = <>} ;
|
||||
|
||||
mkVS : V -> VS ;
|
||||
mkVS v = v ** { lock_VS = <>} ;
|
||||
|
||||
mkVQ : V -> VQ ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
|
||||
|
||||
-- mkVV : V -> VV ;
|
||||
-- mkVV v = v ** { lock_VV = <>} ;
|
||||
|
||||
mkVA : V -> VA ;
|
||||
mkVA v = v ** {lock_VA = <>} ;
|
||||
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkV2V v p q = prepPrepV3 v p q ** {lock_V2V = <>} ;
|
||||
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkV2S v p = prepV2 v p ** { lock_V2S = <>} ;
|
||||
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
mkV2Q v p = prepV2 v p ** {lock_V2Q = <>} ;
|
||||
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkV2A v p q = prepPrepV3 v p q ** {lock_V2A = <>} ;
|
||||
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
V0 : Type ;
|
||||
V0 : Type = V;
|
||||
mkV0 v = v ** {lock_V0 = <>} ;
|
||||
-}
|
||||
-- pre-overload API and overload definitions
|
||||
|
||||
-- regN : Str ->Gender -> N ;
|
||||
--iregN : (man,men : Str) ->Gender -> N ;
|
||||
compoundN : Str -> N -> N ;
|
||||
|
||||
mkN = overload {
|
||||
mkN : Str ->Gender -> N = \n, g -> lin N (regN n g );
|
||||
mkN : (man,men : Str) ->Gender -> N = \s,p,g -> lin N ( iregN s p g) ;
|
||||
} ;
|
||||
--mkN : Str -> N -> N = compoundN taken from mkN can be added later if need be
|
||||
-- Relational nouns ("daughter of x") need a preposition.
|
||||
|
||||
prepN2 : N -> Prep -> N2 ;
|
||||
|
||||
-- The most common preposition is "of", and the following is a
|
||||
-- shortcut for regular relational nouns with "of".
|
||||
|
||||
regN2 : N -> N2 ;
|
||||
|
||||
regA : Str -> A = \s -> lin A (MorphoSwa.regA s) ;
|
||||
cregA : Str -> A = \s -> lin A (MorphoSwa.cregA s) ;
|
||||
iregA : (fat,fatter : Str) -> A =\a,b -> lin A (MorphoSwa.iregA a b);
|
||||
mkA = overload {
|
||||
mkA : Str -> A = \a -> lin A (regA a |cregA a);
|
||||
mkA : (fat,fatter : Str) -> A =\a,b -> lin A (iregA a b);
|
||||
} ;
|
||||
|
||||
prepA2 : A -> Prep -> A2 ;
|
||||
|
||||
mkA2 = overload {
|
||||
mkA2 : A -> Prep -> A2 = prepA2 ;
|
||||
mkA2 : A -> Str -> A2 = \a,p -> prepA2 a (mkPrep p) ;
|
||||
mkA2 : Str -> Prep -> A2 = \a,p -> prepA2 (regA a) p;
|
||||
mkA2 : Str -> Str -> A2 = \a,p -> prepA2 (regA a) (mkPrep p);
|
||||
} ;
|
||||
|
||||
|
||||
regV=MorphoSwa.regV ;
|
||||
{-
|
||||
mkV = overload {
|
||||
mkV : Str -> V =\v ->lin V(regV v) ;
|
||||
mkV : Str -> V -> V = prefixV
|
||||
};
|
||||
|
||||
|
||||
prefixV : Str -> V -> V = \p,v -> lin V { s = \\b,vform => p + v.s! b ! vform } ;
|
||||
mkV2 = overload {
|
||||
mkV2 : V -> V2 = dirV2 ;
|
||||
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
|
||||
mkV2 : V -> Prep -> V2 = prepV2;
|
||||
mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPrep p) ;
|
||||
mkV2 : Str -> Prep -> V2 = \v,p -> prepV2 (regV v) p ;
|
||||
mkV2 : Str -> Str -> V2 = \v,p -> prepV2 (regV v) (mkPrep p)
|
||||
};
|
||||
|
||||
prepPrepV3 : V -> Prep -> Prep -> V3 ;
|
||||
dirV3 : V -> Prep -> V3 ;
|
||||
dirdirV3 : V -> V3 ;
|
||||
|
||||
mkV3 = overload {
|
||||
mkV3 : V -> Prep -> Prep -> V3 = prepPrepV3 ;
|
||||
mkV3 : V -> Prep -> V3 = dirV3 ;
|
||||
mkV3 : V -> Str -> V3 = \v,s -> dirV3 v (mkPrep s);
|
||||
mkV3 : Str -> Str -> V3 = \v,s -> dirV3 (regV v) (mkPrep s);
|
||||
mkV3 : V -> V3 = dirdirV3 ;
|
||||
mkV3 : Str -> V3 = \v -> dirdirV3 (regV v) ;
|
||||
} ;
|
||||
-}
|
||||
mkConj = overload {
|
||||
mkConj : Str -> Conj = \y -> mk2Conj [] y plural ;
|
||||
mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ;
|
||||
mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ;
|
||||
mkConj : Str -> Str -> Number -> Conj = mk2Conj ;
|
||||
} ;
|
||||
|
||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
lin Conj (sd2 x y ** {n = n}) ;
|
||||
|
||||
regPN : Str ->Gender -> PN ;
|
||||
nounPN : N -> PN ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
concrete PhraseSwa of Phrase = CatSwa ** open Prelude, ResSwa in {
|
||||
concrete PhraseSwa of Phrase = CatSwa ** PhraseBantu with
|
||||
(ResBantu = ResSwa);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
concrete QuestionSwa of Question = CatSwa ** open ResSwa, Prelude in {
|
||||
|
||||
}
|
||||
concrete QuestionSwa of Question = CatSwa ** QuestionBantu with
|
||||
(ResBantu = ResSwa);
|
||||
|
||||
13
src/swahili/README.md
Normal file
13
src/swahili/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Swahili
|
||||
|
||||
## Language info
|
||||
|
||||
* English name: Swahili
|
||||
* Autonym: Kiswahili
|
||||
* ISO code: Swa
|
||||
|
||||
## Authors
|
||||
|
||||
2009: Initial work by Wanjiku Ng'ang'a and Juliet Mutahi. These files are in the subdirectory `old`.
|
||||
|
||||
2018: New version by Benson Kituku, using the [Bantu functor](https://github.com/GrammaticalFramework/gf-rgl/tree/master/src/bantu).
|
||||
@@ -1,4 +1,2 @@
|
||||
concrete RelativeSwa of Relative = CatSwa ** open ResSwa in {
|
||||
|
||||
|
||||
}
|
||||
concrete RelativeSwa of Relative = CatSwa ** RelativeBantu with
|
||||
(ResBantu = ResSwa);
|
||||
|
||||
@@ -1,171 +1,8 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
|
||||
--1 Swahili auxiliary operations.
|
||||
--1 Swalish auxiliary operations.
|
||||
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work. To define everything that is needed to
|
||||
-- implement $Test$, it moreover contains regular lexical
|
||||
-- patterns needed for $Lex$.
|
||||
|
||||
resource ResSwa = ParamX ** open Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--For $Noun$
|
||||
|
||||
-- This is the worst-case $Case$ needed for pronouns.
|
||||
|
||||
param Case = Nom | Loc ;
|
||||
|
||||
param Animacy = AN | IN ;
|
||||
|
||||
param Gender = g1_2 | g3_4 | g5_6 | g5a_6 | g6 | g7_8 | g9_10 | g11 | g11_6 | g11_10 ;
|
||||
|
||||
--2 For $Adjective$
|
||||
|
||||
AForm = AF Number Gender Animacy
|
||||
| AA ;
|
||||
|
||||
-- The order of sentence is needed already in $VP$.
|
||||
|
||||
Order = ODir | OQuest ;
|
||||
|
||||
--2 For $Verb$
|
||||
|
||||
-- Verbs will take one of the five forms
|
||||
|
||||
param
|
||||
VForm = VInf
|
||||
| VImper Number Person
|
||||
| VPres Number Gender Animacy Person
|
||||
| VPast Number Gender Animacy Person
|
||||
| VFut Number Gender Animacy Person;
|
||||
|
||||
|
||||
oper
|
||||
|
||||
Verb : Type = {s : VForm => Str} ;
|
||||
|
||||
|
||||
VerbForms : Type = Tense => Anteriority => Polarity => Agr => Str ;
|
||||
|
||||
VP : Type = {
|
||||
s : VerbForms ;
|
||||
s2 : Agr => Str
|
||||
} ;
|
||||
|
||||
|
||||
mkV : Str -> {s : VForm => Str} =
|
||||
\cheza -> {
|
||||
s = table {
|
||||
VInf => case Predef.take 2 cheza of {
|
||||
"ku" => cheza;
|
||||
_ => "ku"+cheza
|
||||
};
|
||||
VImper n p => case <n,p> of{
|
||||
<Sg,P2> => init cheza + "eni";
|
||||
<_,_> => cheza};
|
||||
VPres n g anim p => Verbprefix n g anim p + "na" + cheza;
|
||||
VPast n g anim p => Verbprefix n g anim p + "li" + cheza ;
|
||||
VFut n g anim p => Verbprefix n g anim p + "ta" + cheza
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
predV : Verb -> VP = \verb -> {
|
||||
s = \\t,ant,b,agr =>
|
||||
let
|
||||
inf = verb.s ! VInf ;
|
||||
imper = verb.s ! VImper agr.n agr.p;
|
||||
pres = verb.s ! VPres agr.n agr.g agr.anim agr.p ;
|
||||
past = verb.s ! VPast agr.n agr.g agr.anim agr.p ;
|
||||
fut = verb.s ! VFut agr.n agr.g agr.anim agr.p ;
|
||||
in
|
||||
case <t,ant,b> of {
|
||||
<_,Anter,Pos> => imper;
|
||||
<Pres,Simul,Pos> => pres ;
|
||||
<Past,Anter,Pos> => past ;
|
||||
<Fut, Anter,Pos> => fut ;
|
||||
<_,_,_> => inf
|
||||
instance ResSwa of ResBantu = DiffSwa, CommonBantu ** open Prelude in {
|
||||
|
||||
} ;
|
||||
s2 = \\_ => []
|
||||
} ;
|
||||
|
||||
|
||||
Verbprefix : Number -> Gender -> Animacy -> Person -> Str = \n,g,anim,p ->
|
||||
case <anim,n,g,p> of {
|
||||
<AN,Sg,_,P1> => "ni" ;
|
||||
<AN,Sg,_,P2> => "u" ;
|
||||
<AN,Pl,_,P1> => "tu" ;
|
||||
<AN,Pl,_,P2> => "m" ;
|
||||
<AN,Sg,_,_> => "a" ;
|
||||
<AN,Pl,_,_> => "wa" ;
|
||||
<_,Sg,g1_2,_> => "a" ;
|
||||
<_,Pl,g1_2,_> => "wa" ;
|
||||
<_,Sg,g3_4,_> => "u" ;
|
||||
<_,Pl,g3_4,_> => "i" ;
|
||||
<_,Sg,g5_6,_> => "li" ;
|
||||
<_,Pl,g5_6,_> => "ya" ;
|
||||
<_,Sg,g5a_6,_> => "li" ;
|
||||
<_,Pl,g5a_6,_> => "ya" ;
|
||||
<IN,_,g6,_> => "ya" ;
|
||||
<IN,Sg,g7_8,_> => "ki" ;
|
||||
<IN,Pl,g7_8,_> => "vi" ;
|
||||
<IN,Sg,g9_10,_> => "i" ;
|
||||
<IN,Pl,g9_10,_> => "zi" ;
|
||||
<IN,_,g11,_> => "u" ;
|
||||
<IN,Sg,g11_6,_> => "u" ;
|
||||
<IN,Pl,g11_6,_> => "ya" ;
|
||||
<IN,Sg,g11_10,_> => "u" ;
|
||||
<IN,Pl,g11_10,_> => "zi"
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Auxiliary verbs have special negative forms.
|
||||
param
|
||||
VVForm =
|
||||
VVF VForm
|
||||
| VVPresNeg
|
||||
| VVPastNeg --# notpresent
|
||||
;
|
||||
|
||||
--Adjectives
|
||||
|
||||
oper Adj = {s : AForm => Str} ;
|
||||
|
||||
--2 For $Quantifiers$
|
||||
-- A 3-dimensional system of quantifiers (demonstrative pronouns) based on position of object, hearer + speaker
|
||||
-- need to find linguistic term to express this
|
||||
|
||||
param Spatial = SpHrObj | SpHr | HrObj ; --w.r.t object
|
||||
|
||||
-- Agreement of adjectives, verb phrases, and relative pronouns.
|
||||
|
||||
oper
|
||||
AGR = {n : Number ; g : Gender ; anim : Animacy ; p : Person} ;
|
||||
Agr : Type = {n : Number ; g : Gender ; anim : Animacy ; p : Person} ;
|
||||
agr : Number -> Gender -> Animacy -> Person -> Agr = \n,g,anim,p -> {n = n ; g = g ; anim = anim ; p = p} ;
|
||||
|
||||
-- For $Sentence$.
|
||||
|
||||
Clause : Type = {
|
||||
s : Tense => Anteriority => Polarity => Str
|
||||
} ;
|
||||
|
||||
mkClause : Str -> Agr -> VP -> Clause =
|
||||
\subj,agr,vp -> {
|
||||
s = \\t,a,b =>
|
||||
let
|
||||
verb = vp.s ! t ! a ! b ! agr
|
||||
in
|
||||
subj ++ verb
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,2 @@
|
||||
concrete SentenceSwa of Sentence = CatSwa ** open Prelude, ResSwa in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
PredVP np vp = mkClause (np.s ! Nom) np.a vp ;
|
||||
|
||||
}
|
||||
|
||||
concrete SentenceSwa of Sentence = CatSwa ** SentenceBantu with
|
||||
(ResBantu = ResSwa);
|
||||
|
||||
@@ -1,15 +1,200 @@
|
||||
concrete StructuralSwa of Structural = CatSwa **
|
||||
open MorphoSwa, ResSwa, ParadigmsSwa,
|
||||
open MorphoSwa, ParadigmsSwa,
|
||||
(C = ConstructX), Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
lin
|
||||
above_Prep = mkPrep "juu ya" ;
|
||||
after_Prep = mkPrep "baada ya" ;
|
||||
all_Predet = {s = \\g => Allpredetprefix g + "ote"} ;
|
||||
almost_AdA = mkAdA "karibu " ;
|
||||
almost_AdN = mkAdN "nusura " ;
|
||||
although_Subj = ss "ingawa" ;
|
||||
always_AdV = mkAdV "dawama" ;
|
||||
and_Conj = mkConj "na" ;
|
||||
because_Subj = ss "maana" ;
|
||||
before_Prep = mkPrep "kabla ya" ;
|
||||
behind_Prep = mkPrep "baada" ;
|
||||
between_Prep = mkPrep "katikati" ;
|
||||
both7and_DConj = mkConj "eli" "na";
|
||||
but_PConj = ss "ila" ;
|
||||
by8agent_Prep = mkPrep "kwa" ;
|
||||
by8means_Prep = mkPrep "kwa" ;
|
||||
-- can8know_VV, can_VV = {
|
||||
during_Prep = mkPrep "katika" ;
|
||||
either7or_DConj = mkConj "ama" singular ;
|
||||
everybody_NP = regNP "kila mtu" a_wa singular ;
|
||||
every_Det = { s = table {Sub => "kila"; Obj g =>[]} ;n = Sg} ;
|
||||
everything_NP = regNP "kila kitu" ki_vi singular ;
|
||||
everywhere_Adv = mkAdv "kila sehemu" ;
|
||||
few_Det = {s = table {Obj g => Few_prefix g + "chache" ;
|
||||
Sub => [] };
|
||||
n= Pl
|
||||
} ;
|
||||
for_Prep = mkPrep nonExist ;
|
||||
from_Prep = mkPrep "tokea" ;
|
||||
he_Pron = mkPron "yeye" "ake" G1 Sg P3 ;
|
||||
here_Adv = mkAdv "hapa" ;
|
||||
here7to_Adv = mkAdv ["huko"] ;
|
||||
here7from_Adv = mkAdv ["hapa"] ;
|
||||
how_IAdv = ss "upi" ;
|
||||
how8much_IAdv = ss "ngapi" ;
|
||||
if_Subj = ss "Kama" ;
|
||||
in8front_Prep = mkPrep ["umbele "] ;
|
||||
i_Pron =mkPron "mimi" "angu" G1 Sg P1 ;
|
||||
in_Prep = mkPrep "ndani" ;
|
||||
it_Pron ={ s=\\c=>nonExist; poss=\\n,g=> nonExist; a=Ag G4 Sg P3};
|
||||
--less_CAdv = C.mkCAdv "kasoro" ;
|
||||
much_Det, many_Det = { s = table {
|
||||
Obj g => Many_prefix g + "ngi" ;
|
||||
Sub => []} ;
|
||||
n= Pl
|
||||
} ;
|
||||
more_Adv = mkAdv "zaidi" ;
|
||||
most_Predet = {s = \\g => MorphoSwa.Mostpredetprefix g + "ngi"} ;
|
||||
-- must_VV = {
|
||||
---b no_Phr = ss "no" ;
|
||||
no_Utt = ss "hapana" ;
|
||||
on_Prep = mkPrep "juu ya" ;
|
||||
one_Quant = {s = \\n,g => "moja" } ;
|
||||
only_Predet = {s = \\g => "tu" } ;
|
||||
or_Conj = mkConj "kana" singular ;
|
||||
otherwise_PConj = ss "ila" ;
|
||||
please_Voc = ss "tafadhari" ;
|
||||
part_Prep, possess_Prep = let
|
||||
questo : ParadigmsSwa.Number => MorphoSwa.Gender => Str = table {
|
||||
Sg => \\g=> case <g> of { <G3> => "la" ;
|
||||
<G4> => "cha" ;
|
||||
<G5> => "ya" ;
|
||||
<G11> => "pa";
|
||||
<G12> => "kwa";
|
||||
<G13> => "mwa";
|
||||
<G1> |<G2>|<G6>|<G7> |<G8> => "wa" ;
|
||||
_ => ""};
|
||||
|
||||
this_Quant = {s = \\n,g,anim,c => mkQuant SpHrObj n g anim Nom P3} ;
|
||||
this_Quant1 = {s = \\n,g,anim,c => mkQuant HrObj n g anim Nom P3} ;
|
||||
that_Quant = {s = \\n,g,anim,c => mkQuant SpHr n g anim Nom P3} ;
|
||||
|
||||
|
||||
Pl => \\g=> case <g> of{<G1> => "wa" ;
|
||||
<G4> => "vya" ;
|
||||
<G5>|<G6> => "za" ;
|
||||
<G2>|<G3> |<G8> |<G9> |<G10> => "ya";
|
||||
_ => ""}}
|
||||
in { s= questo};
|
||||
quite_Adv = mkAdv "kabisa" ;
|
||||
she_Pron = mkPron "yeye" "ake" G1 Sg P3;
|
||||
so_AdA = mkAdA "so" ;
|
||||
somebody_NP = regNP "mtu fulani" a_wa singular;
|
||||
someSg_Det = { s = table {
|
||||
Obj g => Detsomesgprefix g + "ngi";
|
||||
Sub => []} ;
|
||||
n= Sg
|
||||
} ;
|
||||
somePl_Det = { s = table {
|
||||
Obj g => Detsomeplprefix g + "ngi" ;
|
||||
Sub => []} ;
|
||||
n= Pl
|
||||
} ;
|
||||
something_NP = regNP "kitu fulani" ki_vi singular ;
|
||||
somewhere_Adv = mkAdv "seheme fulani" ;
|
||||
that_Quant = let
|
||||
questo : ParadigmsSwa.Number => MorphoSwa.Gender => Str = table {
|
||||
Sg => \\g=> case <g> of {
|
||||
<G1> => "huyo" ;
|
||||
<G2 > => "huo";
|
||||
<G3 > => "hilo";
|
||||
<G4 > => "hicho";
|
||||
<G5 > => "hiyo";
|
||||
<G6 > => "huo";
|
||||
<G7> => "huo";
|
||||
<G8> => "huo" ;
|
||||
<G11 > => "hapo";
|
||||
<G12 > => "huko";
|
||||
<G13 > => "humo";
|
||||
<G9 > | <G10 >=> ""
|
||||
};
|
||||
|
||||
Pl => \\g=> case <g> of{
|
||||
<G1> => "hao" ;
|
||||
<G2 > => "hiyo";
|
||||
<G3 > => "hayo";
|
||||
<G4 > => "hivyo";
|
||||
<G5 > => "hizo";
|
||||
<G6 > => "hizo";
|
||||
<G8> => "hayo" ;
|
||||
<G10 > => "hiyo";
|
||||
<G12 > => "huko";
|
||||
<G13 > => "humo";
|
||||
_ => ""
|
||||
}
|
||||
|
||||
};
|
||||
in {
|
||||
s = questo ;
|
||||
} ;
|
||||
there_Adv = mkAdv "hapo" ;
|
||||
there7to_Adv = mkAdv "hapa kuvika" ;
|
||||
there7from_Adv = mkAdv ["hapa kutoka"] ;
|
||||
therefore_PConj = ss "kwa ajili" ;
|
||||
they_Pron =mkPron "wao" "ao" G1 Pl P3 ;
|
||||
this_Quant = let
|
||||
questo : ParadigmsSwa.Number => MorphoSwa.Gender => Str = table {
|
||||
Sg => \\g=> case <g> of {
|
||||
<G1> => "huyu" ;
|
||||
<G11> => "hapa" ;
|
||||
<G12> => "huku" ;
|
||||
<G13> => "humu" ;
|
||||
<G4 > => "hiki";
|
||||
<G3 > => "hili";
|
||||
<G5 > => "hii";
|
||||
<G9 > |<G10 >=> "";
|
||||
<G2 > |<G8>|<G7> |<G6> => "huu"
|
||||
};
|
||||
|
||||
Pl => \\g=> case <g> of{
|
||||
<G1> => "hawa" ;
|
||||
<G4 > => "hivi";
|
||||
<G5 > |<G6 > => "hizi";
|
||||
<G2 > |<G10> => "hii";
|
||||
<G3 > |<G8 >|<G9 > => "haya";
|
||||
_=> ""
|
||||
}
|
||||
|
||||
}
|
||||
in {
|
||||
s = questo ;
|
||||
} ;
|
||||
through_Prep = mkPrep "kuvitila" ;
|
||||
too_AdA = mkAdA "vile" ;
|
||||
to_Prep = mkPrep "kuvika" ;
|
||||
under_Prep = mkPrep "chini ya" ;
|
||||
very_AdA = mkAdA "mno" ;
|
||||
-- want_VV = mkVV (regV "enda") ;
|
||||
we_Pron =mkPron "sisi" "etu" G1 Pl P1 ;
|
||||
--whatPl_IP = mkIP "ata" "ata" plural ;
|
||||
-- whatSg_IP = mkIP "ata" "ata" singular ;
|
||||
when_IAdv = ss "madhali" ;
|
||||
when_Subj = ss "madhali" ;
|
||||
where_IAdv = ss "wapi" ;
|
||||
which_IQuant = {s = \\_ => "wapi"} ;
|
||||
---b whichPl_IDet = mkDeterminer plural ["which"] ;
|
||||
---b whichSg_IDet = mkDeterminer singular ["which"] ;
|
||||
-- whoPl_IP = mkIP "uu" "whom" "whose" plural ;
|
||||
-- whoSg_IP = mkIP "who" "whom" "whose" singular ;
|
||||
why_IAdv = ss "kwa nini" ;
|
||||
without_Prep = mkPrep "bila" ;
|
||||
with_Prep = mkPrep "pamoja na" ;
|
||||
--yes_Phr = ss "ii" ;
|
||||
yes_Utt = ss "ndio" ;
|
||||
youSg_Pron = mkPron "wewe" "ako" G1 Sg P2 ;
|
||||
youPol_Pron,youPl_Pron = mkPron "nyinyi" "enyu" G1 Pl P3 ;
|
||||
not_Predet = {s = \\g => "nongi"} ;
|
||||
no_Quant = {s = \\g,n => "hakuna"} ;
|
||||
if_then_Conj = mkConj "kama" "basi" singular ;
|
||||
nobody_NP = regNP "hakuna mtu" a_wa singular ;
|
||||
nothing_NP = regNP "hukuna kitu" ki_vi singular ;
|
||||
at_least_AdN = mkAdN "" ;
|
||||
at_most_AdN = mkAdN "kuvika" ;
|
||||
except_Prep = mkPrep "kasoro" ;
|
||||
-- as_CAdv = C.mkCAdv "kama" ;
|
||||
-- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ;
|
||||
that_Subj = ss "hio" ;
|
||||
lin language_title_Utt = ss "kiswahili" ;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,2 @@
|
||||
concrete VerbSwa of Verb = CatSwa ** open ResSwa in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV = predV ;
|
||||
|
||||
}
|
||||
concrete VerbSwa of Verb = CatSwa ** VerbBantu with
|
||||
(ResBantu = ResSwa);
|
||||
|
||||
11
src/swahili/old/AdjectiveSwa.gf
Normal file
11
src/swahili/old/AdjectiveSwa.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
concrete AdjectiveSwa of Adjective = CatSwa ** open ResSwa, Prelude , ParamX in {
|
||||
|
||||
lin
|
||||
|
||||
PositA a = {
|
||||
s = a.s ! Posit ;
|
||||
} ;
|
||||
|
||||
-- PositA a = a;
|
||||
|
||||
}
|
||||
12
src/swahili/old/AdverbSwa.gf
Normal file
12
src/swahili/old/AdverbSwa.gf
Normal file
@@ -0,0 +1,12 @@
|
||||
concrete AdverbSwa of Adverb = CatSwa ** open ResSwa, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
-- PositAdvAdj : A -> Adv ; -- vizuri
|
||||
|
||||
PositAdvAdj a = {
|
||||
s = a.s ! Posit ! AA
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
45
src/swahili/old/CatSwa.gf
Normal file
45
src/swahili/old/CatSwa.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
concrete CatSwa of Cat = CommonX ** open ResSwa, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
CN = {s,s1,s2 : Number => Str; g : Gender ; anim : Animacy ; hasAdj : Bool } ;
|
||||
N = {s : Number => Str; g : Gender ; anim : Animacy } ;
|
||||
N2 = {s : Number => Str; g : Gender ; anim : Animacy } ** {c2 : Str} ;
|
||||
N3 = {s : Number => Str; g : Gender ; anim : Animacy } ** {c2,c3 : Str} ;
|
||||
Pron = {s :Number => Str ; p : Person};
|
||||
V,VA = Verb ; -- = {s : VForm => Str} ;
|
||||
V2 = Verb ** {c2 : Str} ;
|
||||
NP = {s : Case => Str ; a : Agr} ;
|
||||
A = {s : Degree => AForm => Str} ;
|
||||
AP = {s : AForm => Str} ;
|
||||
Det = {s : Gender => Case => Animacy => Str ; n : Number } ;
|
||||
Quant = {s : Number => Gender => Animacy => Case => Str} ;
|
||||
Predet,Ord = {s : Str} ;
|
||||
|
||||
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
-- Verb
|
||||
|
||||
VP = ResSwa.VP ;
|
||||
|
||||
-- Numeral
|
||||
Num = {s : Gender => Str ; n : Number} ;
|
||||
|
||||
{--
|
||||
Num = {s : Gender => Animacy => Str ; n : Number} ;
|
||||
Card = {s : Gender => Animacy => Str ; n : Number} ;
|
||||
Digits = {s : Str ; n : Number} ;
|
||||
--}
|
||||
--Prepositions
|
||||
Prep = {s : Str} ;
|
||||
|
||||
-- Sentence
|
||||
|
||||
Cl = Clause ;
|
||||
|
||||
}
|
||||
6
src/swahili/old/ConjunctionSwa.gf
Normal file
6
src/swahili/old/ConjunctionSwa.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
concrete ConjunctionSwa of Conjunction =
|
||||
CatSwa ** open ResSwa, Coordination, Prelude in {
|
||||
|
||||
|
||||
|
||||
}
|
||||
9
src/swahili/old/GrammarSwa.gf
Normal file
9
src/swahili/old/GrammarSwa.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarSwa of Grammar =NounSwa , AdjectiveSwa , StructuralSwa ,VerbSwa , SentenceSwa , AdverbSwa
|
||||
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
7
src/swahili/old/IdiomSwa.gf
Normal file
7
src/swahili/old/IdiomSwa.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
concrete IdiomSwa of Idiom = CatSwa ** open Prelude, ResSwa in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
10
src/swahili/old/LangSwa.gf
Normal file
10
src/swahili/old/LangSwa.gf
Normal file
@@ -0,0 +1,10 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete LangSwa of Lang =
|
||||
GrammarSwa,
|
||||
LexiconSwa
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
99
src/swahili/old/LexiconSwa.gf
Normal file
99
src/swahili/old/LexiconSwa.gf
Normal file
@@ -0,0 +1,99 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
concrete LexiconSwa of Lexicon = CatSwa **
|
||||
open ParadigmsSwa, Prelude in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
|
||||
bird_N = regN "ndege" e_e animate;
|
||||
country_N = regN "nchi" e_e inanimate ;
|
||||
cousin_N = regN "binamu" e_ma animate;
|
||||
cow_N = regN "ngombe" e_e animate;
|
||||
doctor_N = regN "daktari" e_ma animate ;
|
||||
dog_N = regN "mbwa" e_e animate ;
|
||||
door_N = regN "mlango" m_mi inanimate;
|
||||
enemy_N = regN "adui" e_ma animate;
|
||||
father_N = regN "baba" e_e animate;
|
||||
fish_N = regN "samaki" e_e animate;
|
||||
friend_N = regN "rafiki" e_ma animate;
|
||||
garden_N = regN "shamba" e_ma inanimate;
|
||||
girl_N = regN "msichana" m_wa animate ;
|
||||
lamp_N = regN "taa" e_e inanimate ;
|
||||
man_N = regN "mwanaume" m_wa animate ;
|
||||
tree_N = regN "mti" m_mi inanimate ;
|
||||
water_N = regN "maji" ma_ma inanimate ;
|
||||
woman_N = regN "mwanamke" m_wa animate ;
|
||||
ear_N = regN "sikio" e_ma inanimate ;
|
||||
eye_N = mkN "jicho" "macho" ji_ma inanimate ;
|
||||
fingernail_N = regN "ukucha" u_e inanimate ;
|
||||
nose_N = regN "pua" e_ma inanimate;
|
||||
person_N = regN "mtu" m_wa animate ;
|
||||
road_N = regN "barabara" e_e inanimate;
|
||||
tooth_N = regN "jino" ji_ma inanimate ;
|
||||
wife_N = regN "bibi" e_ma animate ;
|
||||
river_N = regN "mto" m_mi inanimate ;
|
||||
|
||||
come_V = regV "kuja";
|
||||
walk_V = regV "tembea";
|
||||
sleep_V = regV "lala";
|
||||
smell_V = regV "nuka";
|
||||
stand_V = regV "simama";
|
||||
stop_V = regV "simama";
|
||||
swell_V = regV "fura";
|
||||
swim_V = regV "ogelea";
|
||||
think_V = regV "waza";
|
||||
travel_V = regV "safiri";
|
||||
|
||||
big_A = regA "kubwa";
|
||||
|
||||
beautiful_A = regA "rembo" ;
|
||||
black_A = regA "eusi";
|
||||
blue_A = regA "buluu" ;
|
||||
broad_A = regA "pana" ;
|
||||
brown_A = regA "hudhurungi" ;
|
||||
clean_A = regA "safi" ;
|
||||
clever_A = regA "hodari" ;
|
||||
cold_A = regA "baridi";
|
||||
correct_A = regA "sahihi" ;
|
||||
dirty_A = regA "chafu" ;
|
||||
dry_A = regA "kavu" ;
|
||||
dull_A = regA "liofifia" ;
|
||||
full_A = regA "tele" ;
|
||||
good_A = regA "zuri" ;
|
||||
green_A = regA "kijani";
|
||||
heavy_A = regA "zito" ;
|
||||
hot_A = regA "moto" ;
|
||||
important_A = regA "muhimu" ;
|
||||
long_A = regA "refu" ;
|
||||
narrow_A = regA "embamba" ;
|
||||
near_A = regA "karibu" ;
|
||||
new_A = regA "pya" ;
|
||||
old_A = regA "zee" ;
|
||||
ready_A = regA "tayari" ;
|
||||
red_A = regA "ekundu" ;
|
||||
rotten_A = regA "oza" ;
|
||||
round_A = regA "viringo" ;
|
||||
sharp_A = regA "kali" ;
|
||||
short_A = regA "fupi" ;
|
||||
small_A = regA "dogo" ;
|
||||
smooth_A = regA "laini" ;
|
||||
straight_A = regA "nyofu" ;
|
||||
stupid_A = regA "jinga" ;
|
||||
thick_A = regA "nene" ;
|
||||
thin_A = regA "embamba" ;
|
||||
ugly_A = regA "baya";
|
||||
certain_A = regA "hakika" ;
|
||||
warm_A = regA "fufutende" ;
|
||||
wet_A = regA "nyevu" ;
|
||||
white_A = regA "eupe" ;
|
||||
wide_A = regA "pana" ;
|
||||
yellow_A = regA "njano" ;
|
||||
young_A = regA "bichi" ;
|
||||
|
||||
father_N2 = mkN2 (regN "baba" e_e animate) (mkPrep "ya") ;
|
||||
mother_N2 = mkN2 (regN "mama" e_e animate) (mkPrep "ya");
|
||||
brother_N2 = mkN2 (regN "ndugu" e_e animate) (mkPrep "ya") ;
|
||||
|
||||
} ;
|
||||
229
src/swahili/old/MorphoSwa.gf
Normal file
229
src/swahili/old/MorphoSwa.gf
Normal file
@@ -0,0 +1,229 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
|
||||
--1 A Simple Swahili Resource Morphology
|
||||
--
|
||||
-- This resource morphology contains definitions needed in the resource
|
||||
-- syntax. To build a lexicon, it is better to use $ParadigmsSwa$, which
|
||||
-- gives a higher-level access to this module.
|
||||
|
||||
resource MorphoSwa = open Prelude, (Predef=Predef), ResSwa in {
|
||||
|
||||
flags optimize=all ;
|
||||
--$Nouns--
|
||||
oper
|
||||
|
||||
CommonNoun : Type = {s : Number => Str; g : Gender ; anim : Animacy } ;
|
||||
|
||||
numForms : Str -> Str -> Number => Str = \bon,bons ->
|
||||
table {Sg => bon ; Pl => bons} ;
|
||||
|
||||
mkNoun : (Number => Str) -> Gender -> Animacy -> CommonNoun = \mecmecs,gen,anim ->
|
||||
{s = mecmecs ; g = gen ; anim = anim} ;
|
||||
|
||||
mkNounIrreg : Str -> Str -> Gender -> Animacy -> CommonNoun = \mec,mecs,gen,anim ->
|
||||
mkNoun (numForms mec mecs) gen anim ;
|
||||
|
||||
mkNomReg : Str -> Gender -> Animacy -> CommonNoun = \mtu,gen,anim ->
|
||||
let watu = case gen of {
|
||||
g1_2 => case Predef.take 3 mtu of {
|
||||
"mwa" => Predef.drop 1 mtu ;
|
||||
"mwi" => "wa"+ Predef.drop 2 mtu ;
|
||||
_ => "wa" + Predef.drop 1 mtu
|
||||
}; -- mtu/watu
|
||||
g3_4 => "mi" + Predef.drop 1 mtu ; -- mti/miti
|
||||
g5_6 => "me" + Predef.drop 2 mtu ; -- jicho/macho
|
||||
g5a_6 => "ma" + mtu ; -- somo/masomo
|
||||
g7_8 => "vi" + Predef.drop 2 mtu ; -- kitabu/vitabu
|
||||
g11_6 => "ma" + Predef.drop 1 mtu ; -- ugonjwa/magonjwa
|
||||
g11_10 => Predef.drop 1 mtu ; -- ukuta/kuta
|
||||
_ => mtu -- ma_ma (maji/maji); e_e (taa/taa); u_u (uhuru/uhuru)
|
||||
};
|
||||
in mkNounIrreg mtu watu gen anim ;
|
||||
|
||||
mkNn : Str -> Str -> Gender -> Animacy -> CommonNoun = \mec,mecs,gen,anim ->
|
||||
mkNoun (numForms mec mecs) gen anim ;
|
||||
|
||||
--Autonomous Personal Pronoun
|
||||
mkPronoun :Number -> Person-> Str= \n,p ->
|
||||
case <n,p> of {
|
||||
<Sg,P1> => "mimi" ;
|
||||
<Sg,P2> => "wewe" ;
|
||||
<Sg,P3> => "yeye" ;
|
||||
<Pl,P1> => "sisi" ;
|
||||
<Pl,P2> => "nyinyi" ;
|
||||
<Pl,P3> => "wao"
|
||||
|
||||
};
|
||||
|
||||
|
||||
--$Verbs
|
||||
{--
|
||||
VerbprefixR : Agr -> Str = \a -> Verbprefix a.n a.g a.anim a.p ;
|
||||
|
||||
|
||||
|
||||
Verbprefix : Number -> Gender -> Animacy -> Person -> Str = \n,g,anim,p ->
|
||||
case <anim,n,g,p> of {
|
||||
<_,Sg,_,P1> => "ni" ;
|
||||
<_,Sg,_,P2> => "u" ;
|
||||
<_,Pl,_,P1> => "tu" ;
|
||||
<_,Pl,_,P2> => "m" ;
|
||||
<AN,Sg,_,_> => "a" ;
|
||||
<AN,Pl,_,_> => "wa" ;
|
||||
<_,Sg,g1_2,_> => "a" ;
|
||||
<_,Pl,g1_2,_> => "wa" ;
|
||||
<_,Sg,g3_4,_> => "u" ;
|
||||
<_,Pl,g3_4,_> => "i" ;
|
||||
<_,Sg,g5_6,_> => "li" ;
|
||||
<_,Pl,g5_6,_> => "ya" ;
|
||||
<_,Sg,g5a_6,_> => "li" ;
|
||||
<_,Pl,g5a_6,_> => "ya" ;
|
||||
<AN,Sg,g6,_> => "a" ;
|
||||
<AN,Pl,g6,_> => "wa" ;
|
||||
<_,Sg,g6,_> => "ya" ;
|
||||
<_,Pl,g6,_> => "ya" ;
|
||||
<_,Sg,g7_8,_> => "ki" ;
|
||||
<_,Pl,g7_8,_> => "vi" ;
|
||||
<_,Sg,g9_10,_> => "i" ;
|
||||
<_,Pl,g9_10,_> => "zi" ;
|
||||
<_,_,g11,_> => "u" ;
|
||||
<_,Sg,g11_6,_> => "u" ;
|
||||
<_,Pl,g11_6,_> => "ya" ;
|
||||
<_,Sg,g11_10,_> => "u" ;
|
||||
<_,Pl,g11_10,_> => "zi"
|
||||
} ;
|
||||
|
||||
|
||||
Verbprefix : Number -> Gender -> Animacy -> Person -> Str = \n,g,anim,p ->
|
||||
case <anim,n,g,p> of {
|
||||
<AN,Sg,_,P1> => "ni" ;
|
||||
<AN,Pl,_,P1> => "tu" ;
|
||||
<_,_,_,_> => ""
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
mkV : Str -> {s : VForm => Str} =
|
||||
\cheza -> {
|
||||
s = table {
|
||||
--VInf => "ku"+cheza ;
|
||||
VInf => case Predef.take 2 cheza of {
|
||||
"ku" => cheza;
|
||||
_ => "ku"+cheza
|
||||
};
|
||||
VImper n p => case <n,p> of {<Sg,P2> => init cheza + "eni";<_,_> => cheza};
|
||||
VPres n g anim p => Verbprefix n g anim p ++ "na" ++ cheza;
|
||||
VPast n g anim p => Verbprefix n g anim p ++ "li" ++ cheza ;
|
||||
VFut n g anim p => Verbprefix n g anim p ++ "ta" ++ cheza
|
||||
}
|
||||
} ;
|
||||
|
||||
--}
|
||||
|
||||
--2 Adjectives
|
||||
-- To form the adjectival and the adverbial forms, two strings are needed
|
||||
-- in the worst case. (First without degrees.)
|
||||
|
||||
Adj = {s : AForm => Str} ;
|
||||
|
||||
VowelAdjprefix : Number -> Gender -> Animacy -> Str = \n,g,anim ->
|
||||
case <anim,n,g> of {
|
||||
<AN,Sg,_> => "mw" ;
|
||||
<AN,Pl,_> => "w" ;
|
||||
<_,Sg,g1_2> => "mw" ;
|
||||
<_,Pl,g1_2> => "w" ;
|
||||
<_,Sg,g3_4> => "mw" ;
|
||||
<_,Pl,g3_4> => "m" ;
|
||||
<_,Sg,g5_6> => "nj" ;
|
||||
<_,Pl,g5_6> => "m" ;
|
||||
<_,Sg,g5a_6> => "mw" ;
|
||||
<_,Pl,g5a_6> => "ny" ;
|
||||
<_,Sg,g6> => "m" ;
|
||||
<_,Pl,g6> => "m" ;
|
||||
<_,Sg,g7_8> => "ki" ;
|
||||
<_,Pl,g7_8> => "vi" ;
|
||||
<_,Sg,g9_10> => "ny" ;
|
||||
<_,Pl,g9_10> => "" ;
|
||||
<_,_,g11> => "m" ;
|
||||
<_,Sg,g11_6> => "m" ;
|
||||
<_,Pl,g11_6> => "ma" ;
|
||||
<_,Sg,g11_10> => "ny" ;
|
||||
<_,Pl,g11_10> => "m"
|
||||
} ;
|
||||
|
||||
|
||||
ConsonantAdjprefix : Number -> Gender -> Animacy -> Str = \n,g,anim ->
|
||||
case <anim,n,g> of {
|
||||
<AN,Sg,_> => "m" ;
|
||||
<AN,Pl,_> => "wa" ;
|
||||
<_,Sg,g1_2> => "m" ;
|
||||
<_,Pl,g1_2> => "wa" ;
|
||||
<_,Sg,g3_4> => "" ;
|
||||
<_,Pl,g3_4> => "" ;
|
||||
<_,Sg,g5_6> => "" ;
|
||||
<_,Pl,g5_6> => "ma" ;
|
||||
<_,Sg,g5a_6> => "" ;
|
||||
<_,Pl,g5a_6> => "ma" ;
|
||||
<_,Sg,g6> => "ma" ;
|
||||
<_,Pl,g6> => "ma" ;
|
||||
<_,Sg,g7_8> => "ki" ;
|
||||
<_,Pl,g7_8> => "vi" ;
|
||||
<_,Sg,g9_10> => "i" ;
|
||||
<_,Pl,g9_10> => "" ;
|
||||
<_,_,g11> => "m" ;
|
||||
<_,Sg,g11_6> => "m" ;
|
||||
<_,Pl,g11_6> => "ma" ;
|
||||
<_,Sg,g11_10> => "m" ;
|
||||
<_,Pl,g11_10> => "n"
|
||||
} ;
|
||||
|
||||
|
||||
mkAdjective : Str -> Adj = \zuri ->
|
||||
{
|
||||
s = table {
|
||||
AF n g anim => case Predef.take 1 zuri of {
|
||||
"a"|"e"|"i"|"o"|"u" => VowelAdjprefix n g anim + zuri;
|
||||
_ => ConsonantAdjprefix n g anim +zuri
|
||||
};
|
||||
AA => zuri
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
mkDeterminer : Number -> Str -> {s : Str ; n : Number} = \n,s ->
|
||||
{s = s ; n = n} ;
|
||||
|
||||
mkQuant : Spatial -> Number -> Gender -> Animacy -> Case -> Person -> Str = \sp,n,g,anim,c,p ->
|
||||
let
|
||||
pfx = "foo" ; ---- Verbprefix n g anim p ;
|
||||
in
|
||||
case <anim,n,c> of {
|
||||
<AN,Sg,Nom> => case <sp> of {
|
||||
<SpHrObj> => "huyu" ;
|
||||
<HrObj> => "huyo" ;
|
||||
<_> => "yule" } ;
|
||||
|
||||
<_,_,_> => case <sp> of {
|
||||
<SpHrObj> => "h" + Predef.dp 1 (Verbprefix n g anim p) + Verbprefix n g anim p ; --sphrobj ;
|
||||
-- <HrObj> => mkQuantEnd (Predef.tk 1 sphrobj) ;
|
||||
<HrObj> => mkQuantEnd (Predef.tk 1 ("h" + Predef.dp 1 (Verbprefix n g anim p) + Verbprefix n g anim p)) ;
|
||||
<_> => Verbprefix n g anim p + "le" }
|
||||
} ;
|
||||
|
||||
mkQuantEnd : Str -> Str = \stem ->
|
||||
let
|
||||
suffix = Predef.dp 1 stem ;
|
||||
front = Predef.tk 1 stem
|
||||
in
|
||||
case <suffix> of {
|
||||
<"i"> => stem + "yo" ;
|
||||
<"k"> => front + "cho" ;
|
||||
<"v"> => front + "vyo" ;
|
||||
<"w"> => front + "o" ;
|
||||
<_> => stem + "o"
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
83
src/swahili/old/NounSwa.gf
Normal file
83
src/swahili/old/NounSwa.gf
Normal file
@@ -0,0 +1,83 @@
|
||||
|
||||
concrete NounSwa of Noun = CatSwa ** open MorphoSwa, ResSwa, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
UseN noun = {
|
||||
s = noun.s ;
|
||||
s1 = noun.s ;
|
||||
s2 = noun.s ;
|
||||
g = noun.g ;
|
||||
anim = noun.anim ;
|
||||
hasAdj = False
|
||||
} ;
|
||||
|
||||
UseN2 noun = {
|
||||
s = noun.s ;
|
||||
s1 = noun.s ;
|
||||
s2 = noun.s ;
|
||||
g = noun.g ;
|
||||
anim = noun.anim ;
|
||||
hasAdj = False
|
||||
} ;
|
||||
|
||||
|
||||
-- Num
|
||||
|
||||
NumSg = {s = \\_ => [] ; n = Sg} ;
|
||||
NumPl = {s = \\_ => [] ; n = Pl} ;
|
||||
|
||||
|
||||
DetQuant quant num = {
|
||||
s = \\g,c,anim => quant.s ! num.n ! g ! anim ! c ++ num.s ! g;
|
||||
n = num.n
|
||||
};
|
||||
|
||||
AdjCN ap cn =
|
||||
let
|
||||
anim = cn.anim ;
|
||||
g = cn.g;
|
||||
mod = cn.hasAdj
|
||||
in{
|
||||
s = \\n => cn.s ! n ++ ap.s ! (AF n g anim) ;
|
||||
s1 = \\n => cn.s1 ! n;
|
||||
s2=case <mod> of {
|
||||
<False> => \\n => ap.s ! (AF n g anim);
|
||||
<True> => \\n => cn.s2 ! n ++ ap.s ! (AF n g anim)
|
||||
};
|
||||
g = g ;
|
||||
anim = anim ;
|
||||
hasAdj=True
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
--DetCN : Det -> CN -> NP ; -- mtu huyo
|
||||
|
||||
|
||||
DetCN det cn =
|
||||
let
|
||||
anim = cn.anim ;
|
||||
g = cn.g ;
|
||||
n = det.n ;
|
||||
mod = cn.hasAdj
|
||||
in case <mod> of {
|
||||
<False> => {
|
||||
s = \\c => cn.s ! n ++ det.s ! g ! c ! anim ;
|
||||
a = agr n g anim P3
|
||||
} ;
|
||||
<True> => {
|
||||
s = \\c => cn.s1 ! n ++ det.s ! g ! c ! anim ++ cn.s2 ! n ;
|
||||
a = agr n g anim P3
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
4
src/swahili/old/NumeralSwa.gf
Normal file
4
src/swahili/old/NumeralSwa.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
concrete NumeralSwa of Numeral = CatSwa [Numeral,Digits] ** open ResSwa in {
|
||||
|
||||
|
||||
}
|
||||
171
src/swahili/old/ParadigmsSwa.gf
Normal file
171
src/swahili/old/ParadigmsSwa.gf
Normal file
@@ -0,0 +1,171 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
|
||||
--1 Swahili Lexical Paradigms
|
||||
|
||||
|
||||
resource ParadigmsSwa = open(Predef=Predef), Prelude, MorphoSwa,ResSwa,CatSwa in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--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.
|
||||
|
||||
Gender : Type ;
|
||||
|
||||
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 ;
|
||||
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Worst case: give all four forms and the semantic gender.
|
||||
|
||||
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 ;
|
||||
|
||||
--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 = <>} ;
|
||||
|
||||
|
||||
} ;
|
||||
5
src/swahili/old/PhraseSwa.gf
Normal file
5
src/swahili/old/PhraseSwa.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
concrete PhraseSwa of Phrase = CatSwa ** open Prelude, ResSwa in {
|
||||
|
||||
|
||||
|
||||
}
|
||||
3
src/swahili/old/QuestionSwa.gf
Normal file
3
src/swahili/old/QuestionSwa.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
concrete QuestionSwa of Question = CatSwa ** open ResSwa, Prelude in {
|
||||
|
||||
}
|
||||
4
src/swahili/old/RelativeSwa.gf
Normal file
4
src/swahili/old/RelativeSwa.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
concrete RelativeSwa of Relative = CatSwa ** open ResSwa in {
|
||||
|
||||
|
||||
}
|
||||
171
src/swahili/old/ResSwa.gf
Normal file
171
src/swahili/old/ResSwa.gf
Normal file
@@ -0,0 +1,171 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
|
||||
--1 Swahili auxiliary operations.
|
||||
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work. To define everything that is needed to
|
||||
-- implement $Test$, it moreover contains regular lexical
|
||||
-- patterns needed for $Lex$.
|
||||
|
||||
resource ResSwa = ParamX ** open Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--For $Noun$
|
||||
|
||||
-- This is the worst-case $Case$ needed for pronouns.
|
||||
|
||||
param Case = Nom | Loc ;
|
||||
|
||||
param Animacy = AN | IN ;
|
||||
|
||||
param Gender = g1_2 | g3_4 | g5_6 | g5a_6 | g6 | g7_8 | g9_10 | g11 | g11_6 | g11_10 ;
|
||||
|
||||
--2 For $Adjective$
|
||||
|
||||
AForm = AF Number Gender Animacy
|
||||
| AA ;
|
||||
|
||||
-- The order of sentence is needed already in $VP$.
|
||||
|
||||
Order = ODir | OQuest ;
|
||||
|
||||
--2 For $Verb$
|
||||
|
||||
-- Verbs will take one of the five forms
|
||||
|
||||
param
|
||||
VForm = VInf
|
||||
| VImper Number Person
|
||||
| VPres Number Gender Animacy Person
|
||||
| VPast Number Gender Animacy Person
|
||||
| VFut Number Gender Animacy Person;
|
||||
|
||||
|
||||
oper
|
||||
|
||||
Verb : Type = {s : VForm => Str} ;
|
||||
|
||||
|
||||
VerbForms : Type = Tense => Anteriority => Polarity => Agr => Str ;
|
||||
|
||||
VP : Type = {
|
||||
s : VerbForms ;
|
||||
s2 : Agr => Str
|
||||
} ;
|
||||
|
||||
|
||||
mkV : Str -> {s : VForm => Str} =
|
||||
\cheza -> {
|
||||
s = table {
|
||||
VInf => case Predef.take 2 cheza of {
|
||||
"ku" => cheza;
|
||||
_ => "ku"+cheza
|
||||
};
|
||||
VImper n p => case <n,p> of{
|
||||
<Sg,P2> => init cheza + "eni";
|
||||
<_,_> => cheza};
|
||||
VPres n g anim p => Verbprefix n g anim p + "na" + cheza;
|
||||
VPast n g anim p => Verbprefix n g anim p + "li" + cheza ;
|
||||
VFut n g anim p => Verbprefix n g anim p + "ta" + cheza
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
predV : Verb -> VP = \verb -> {
|
||||
s = \\t,ant,b,agr =>
|
||||
let
|
||||
inf = verb.s ! VInf ;
|
||||
imper = verb.s ! VImper agr.n agr.p;
|
||||
pres = verb.s ! VPres agr.n agr.g agr.anim agr.p ;
|
||||
past = verb.s ! VPast agr.n agr.g agr.anim agr.p ;
|
||||
fut = verb.s ! VFut agr.n agr.g agr.anim agr.p ;
|
||||
in
|
||||
case <t,ant,b> of {
|
||||
<_,Anter,Pos> => imper;
|
||||
<Pres,Simul,Pos> => pres ;
|
||||
<Past,Anter,Pos> => past ;
|
||||
<Fut, Anter,Pos> => fut ;
|
||||
<_,_,_> => inf
|
||||
|
||||
} ;
|
||||
s2 = \\_ => []
|
||||
} ;
|
||||
|
||||
|
||||
Verbprefix : Number -> Gender -> Animacy -> Person -> Str = \n,g,anim,p ->
|
||||
case <anim,n,g,p> of {
|
||||
<AN,Sg,_,P1> => "ni" ;
|
||||
<AN,Sg,_,P2> => "u" ;
|
||||
<AN,Pl,_,P1> => "tu" ;
|
||||
<AN,Pl,_,P2> => "m" ;
|
||||
<AN,Sg,_,_> => "a" ;
|
||||
<AN,Pl,_,_> => "wa" ;
|
||||
<_,Sg,g1_2,_> => "a" ;
|
||||
<_,Pl,g1_2,_> => "wa" ;
|
||||
<_,Sg,g3_4,_> => "u" ;
|
||||
<_,Pl,g3_4,_> => "i" ;
|
||||
<_,Sg,g5_6,_> => "li" ;
|
||||
<_,Pl,g5_6,_> => "ya" ;
|
||||
<_,Sg,g5a_6,_> => "li" ;
|
||||
<_,Pl,g5a_6,_> => "ya" ;
|
||||
<IN,_,g6,_> => "ya" ;
|
||||
<IN,Sg,g7_8,_> => "ki" ;
|
||||
<IN,Pl,g7_8,_> => "vi" ;
|
||||
<IN,Sg,g9_10,_> => "i" ;
|
||||
<IN,Pl,g9_10,_> => "zi" ;
|
||||
<IN,_,g11,_> => "u" ;
|
||||
<IN,Sg,g11_6,_> => "u" ;
|
||||
<IN,Pl,g11_6,_> => "ya" ;
|
||||
<IN,Sg,g11_10,_> => "u" ;
|
||||
<IN,Pl,g11_10,_> => "zi"
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Auxiliary verbs have special negative forms.
|
||||
param
|
||||
VVForm =
|
||||
VVF VForm
|
||||
| VVPresNeg
|
||||
| VVPastNeg --# notpresent
|
||||
;
|
||||
|
||||
--Adjectives
|
||||
|
||||
oper Adj = {s : AForm => Str} ;
|
||||
|
||||
--2 For $Quantifiers$
|
||||
-- A 3-dimensional system of quantifiers (demonstrative pronouns) based on position of object, hearer + speaker
|
||||
-- need to find linguistic term to express this
|
||||
|
||||
param Spatial = SpHrObj | SpHr | HrObj ; --w.r.t object
|
||||
|
||||
-- Agreement of adjectives, verb phrases, and relative pronouns.
|
||||
|
||||
oper
|
||||
AGR = {n : Number ; g : Gender ; anim : Animacy ; p : Person} ;
|
||||
Agr : Type = {n : Number ; g : Gender ; anim : Animacy ; p : Person} ;
|
||||
agr : Number -> Gender -> Animacy -> Person -> Agr = \n,g,anim,p -> {n = n ; g = g ; anim = anim ; p = p} ;
|
||||
|
||||
-- For $Sentence$.
|
||||
|
||||
Clause : Type = {
|
||||
s : Tense => Anteriority => Polarity => Str
|
||||
} ;
|
||||
|
||||
mkClause : Str -> Agr -> VP -> Clause =
|
||||
\subj,agr,vp -> {
|
||||
s = \\t,a,b =>
|
||||
let
|
||||
verb = vp.s ! t ! a ! b ! agr
|
||||
in
|
||||
subj ++ verb
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
9
src/swahili/old/SentenceSwa.gf
Normal file
9
src/swahili/old/SentenceSwa.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
concrete SentenceSwa of Sentence = CatSwa ** open Prelude, ResSwa in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
PredVP np vp = mkClause (np.s ! Nom) np.a vp ;
|
||||
|
||||
}
|
||||
|
||||
15
src/swahili/old/StructuralSwa.gf
Normal file
15
src/swahili/old/StructuralSwa.gf
Normal file
@@ -0,0 +1,15 @@
|
||||
concrete StructuralSwa of Structural = CatSwa **
|
||||
open MorphoSwa, ResSwa, ParadigmsSwa,
|
||||
(C = ConstructX), Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
lin
|
||||
|
||||
this_Quant = {s = \\n,g,anim,c => mkQuant SpHrObj n g anim Nom P3} ;
|
||||
this_Quant1 = {s = \\n,g,anim,c => mkQuant HrObj n g anim Nom P3} ;
|
||||
that_Quant = {s = \\n,g,anim,c => mkQuant SpHr n g anim Nom P3} ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
8
src/swahili/old/VerbSwa.gf
Normal file
8
src/swahili/old/VerbSwa.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
concrete VerbSwa of Verb = CatSwa ** open ResSwa in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV = predV ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user