1
0
forked from GitHub/gf-rgl

Merge pull request #271 from inariksit/somali

Somali
This commit is contained in:
Inari Listenmaa
2019-08-13 20:08:48 +02:00
committed by GitHub
7 changed files with 37 additions and 26 deletions

View File

@@ -122,4 +122,5 @@ linref
VP = linVP VInf ;
CN = linCN ;
Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ;
S = \s -> linBaseCl (s.s ! False) ;
}

View File

@@ -225,18 +225,18 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
AdjCN ap cn = cn ** {
s = table { NomSg => cn.s ! Indef Sg ; -- When an adjective is added, noun loses case marker.
x => cn.s ! x } ;
mod = \\n,c => cn.mod ! n ! Abs -- If there was something before, it is now in Abs
++ case cn.hasMod of {
True => "oo" ;
False => [] }
++ ap.s ! AF n c ;
mod = let conj = if_then_Str cn.hasMod "oo" [] in
\\n,c => cn.mod ! n ! Abs -- If there was something before, it is now in Abs
++ conj -- If the sentence is already modified, any new modifier needs to be introduced with conjunction
++ ap.s ! AF n c ;
hasMod = True
} ;
-- : CN -> RS -> CN ;
RelCN cn rs = cn ** {
mod = \\n,c => cn.mod ! n ! c ++ rs.s ! gender cn ! c ;
mod = let conj = if_then_Str cn.hasMod "ee" [] in
\\n,c => cn.mod ! n ! c ++ conj ++ rs.s ! gender cn ! c ;
hasMod = True ;
} ;

View File

@@ -102,7 +102,7 @@ lin pot2plus d e = d ** {
n = Pl} ;
lin pot2as3 n = n ;
lin pot3 n = n ** {
thousand = "kun" ;
thousand = n.thousand ++ "kun" ;
ord = n.s ! Kow ++ "kunaad" ;
--da = M KA ; -- TODO check
n = Pl } ;

View File

@@ -154,7 +154,7 @@ oper
_ => Sg3 g } ;
getNum : Agreement -> Number = \a ->
case a of { Sg1|Sg2|Sg3 _ => Sg ; _ => Pl } ;
case a of { Sg1|Sg2|Sg3 _|Impers => Sg ; _ => Pl } ;
plAgr : Agreement -> Agreement = \agr ->
case agr of { Sg1 => Pl1 Excl ;

View File

@@ -161,16 +161,13 @@ oper
emptyNP : NounPhrase = {
s = \\_ => [] ;
a = Pl3 ;
a = Sg3 Masc ;
isPron = False ;
empty = [] ;
st = Indefinite
} ;
impersNP : NounPhrase = emptyNP ** {
a = Impers ;
isPron = True
} ;
impersNP : NounPhrase = pronTable ! Impers ;
--------------------------------------------------------------------------------
-- Pronouns
@@ -234,7 +231,7 @@ oper
poss = {s, short = quantTable "ood" ; sp = gnTable "ood" "ood" "uwood"}
} ;
Impers => {
s = table {Nom => "la" ; Abs => "la"} ;
s = \\_ => [] ; -- the string `la' comes from Passive (: PrepCombination)
a = Impers ; isPron = True ; sp = \\_ => "" ;
empty = [] ; st = Definite ;
poss = {s, short = quantTable "??" ; sp = gnTable "??" "??" "??"}
@@ -787,17 +784,19 @@ oper
predVP : NounPhrase -> VerbPhrase -> Clause = \np,vps -> {
s = \\cltyp,t,a,p =>
let predRaw : {fin : Str ; inf : Str} = vf cltyp t a p subj.a vp ;
pred : {fin : Str ; inf : Str} = case <cltyp,p,vp.pred> of {
<Statement,Pos,NoCopula> => {fin,inf = []} ;
<_ , _, Copula> => {fin = presCopula ! {agr=subj.a ; pol=p} ; inf=[]} ;
_ => predRaw
pred : {fin : Str ; inf : Str} = case <cltyp,p,t,vp.pred,subj.a> of {
<Statement,Pos,Pres,NoCopula ,Sg3 _|Pl3>
=> {fin,inf = []} ; -- If the VP is formed with CompNP
<_ , _,Pres,NoCopula|Copula, _> -- Comp* present tense
=> {fin = presCopula ! {agr=subj.a ; pol=p} ; inf=[]} ;
_ => predRaw
} ;
subjnoun : Str = if_then_Str np.isPron np.empty (subj.s ! Nom) ;
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) np.empty ;
obj : {p1,p2 : Str} =
let o : {p1,p2 : Str} = vp.comp ! subj.a ;
bind : Str = case <isPassive vp,vp.obj2.a, vp.c2, vp.pred> of {
<False,P3_Prep,Single NoPrep,NoPred> => [] ;
bind : Str = case <isPassive vp, vp.obj2.a, vp.c2> of {
<False,P3_Prep,Single NoPrep> => [] ;
_ => BIND } ;
in case <cltyp,p> of {
<Statement,Neg> => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} ;
@@ -809,7 +808,7 @@ oper
p2 = if_then_Pol p subjpron []} ;
Question => {p1 = "ma" ; p2 = []} ; -- TODO find out how negative questions work
Statement => case <p,vp.pred,subj.a> of {
<Pos,Copula|NoCopula,Sg3 _|Impers> => {p1 = "waa" ; p2 = []} ;
<Pos,Copula|NoCopula,Pl3|Sg3 _> => {p1 = "waa" ; p2 = []} ;
_ => stmarkerNoContr ! subj.a ! p }} ;
in (wordOrder subjnoun subjpron stm obj pred vp) ;
} where {

View File

@@ -0,0 +1,11 @@
-- LangEng: the books that the men buy
LangSom: buugaag BIND ta niman BIND ku iibsadaan
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN book_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (SlashV2a buy_V2))))))) NoVoc
-- LangEng: the men that buy the books
LangSom: niman BIND ka buugaag BIND ta iibsada
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant DefArt NumPl) (UseN book_N)))))))) NoVoc
-- LangEng: the men that buy the books are these
LangSom: niman BIND ka buugaag BIND ta iibsadaa waa kuwan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant DefArt NumPl) (UseN book_N))))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumPl))))))) NoVoc

View File

@@ -13,7 +13,7 @@ LangSom: waa ay ku arkeen
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron they_Pron) (ComplSlash (SlashV2a see_V2) (UsePron youSg_Pron))))) NoVoc
-- LangEng: they didn't see you
LangSom: ku &+ ma arkin
LangSom: ku BIND ma arkin
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PNeg (PredVP (UsePron they_Pron) (ComplSlash (SlashV2a see_V2) (UsePron youSg_Pron))))) NoVoc
-- LangEng: you taught yourself
@@ -21,7 +21,7 @@ LangSom: waa aad isku bartay
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron youSg_Pron) (ReflVP (SlashV2a teach_V2))))) NoVoc
-- LangEng: you don't teach yourself
LangSom: isku &+ ma barto
LangSom: isku BIND ma barto
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron youSg_Pron) (ReflVP (SlashV2a teach_V2))))) NoVoc
-- LangEng: one saw you
@@ -48,7 +48,7 @@ LangSom: hooyo waa ay ina kaa siisey
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (UseN2 mother_N2)) (ComplSlash (Slash3V3 give_V3 (UsePron we_Pron)) (UsePron youSg_Pron))))) NoVoc
-- LangEng: mother didn't give you us
LangSom: hooyo ina &+ ma ay kaa siin
LangSom: hooyo ina BIND ma ay kaa siin
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PNeg (PredVP (MassNP (UseN2 mother_N2)) (ComplSlash (Slash3V3 give_V3 (UsePron we_Pron)) (UsePron youSg_Pron))))) NoVoc
-- LangEng: he gave himself bread
@@ -56,7 +56,7 @@ LangSom: rooti waa uu is siiyey
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron he_Pron) (ReflVP (Slash2V3 give_V3 (MassNP (UseN bread_N))))))) NoVoc
-- LangEng: one adds salt to the meat
LangSom: hilib &+ ka cusbo waa lagu daraa
LangSom: hilib BIND ka cusbo waa lagu daraa
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (GenericCl (ComplSlash (Slash3V3 add_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N))) (MassNP (UseN salt_N)))))) NoVoc
-- LangEng: one can add salt to meat
@@ -71,5 +71,5 @@ LangSom: waa aan ka dul boodi karaa
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplVV can_VV (UseV jump_V)) (PrepNP above_Prep (UsePron it_Pron)))))) NoVoc
-- LangEng: you can't jump above me
LangSom: iga &+ ma dul boodi karto
LangSom: iga BIND ma dul boodi karto
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron youSg_Pron) (AdvVP (ComplVV can_VV (UseV jump_V)) (PrepNP above_Prep (UsePron i_Pron)))))) NoVoc