mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
@@ -33,7 +33,7 @@ lin big_A = mkA "weyn" ;
|
|||||||
-- lin bike_N = mkN "" ;
|
-- lin bike_N = mkN "" ;
|
||||||
lin bird_N = mkN "shimbir" fem ;
|
lin bird_N = mkN "shimbir" fem ;
|
||||||
-- lin bite_V2 = mkV2 "" ;
|
-- lin bite_V2 = mkV2 "" ;
|
||||||
-- lin black_A = mkA "" ;
|
lin black_A = mkA "madow" ;
|
||||||
-- lin blood_N = mkN "" ;
|
-- lin blood_N = mkN "" ;
|
||||||
-- lin blow_V = mkV "" ;
|
-- lin blow_V = mkV "" ;
|
||||||
-- lin blue_A = mkA "" ;
|
-- lin blue_A = mkA "" ;
|
||||||
@@ -397,7 +397,7 @@ lin wait_V2 = mkV2 "sug" ;
|
|||||||
-- lin watch_V2 = mkV2 "" ;
|
-- lin watch_V2 = mkV2 "" ;
|
||||||
lin water_N = mkNoun "biyo" "biyaha" "biyo" "biyaha" Masc ; -- ?? gender
|
lin water_N = mkNoun "biyo" "biyaha" "biyo" "biyaha" Masc ; -- ?? gender
|
||||||
-- lin wet_A = mkA "" ;
|
-- lin wet_A = mkA "" ;
|
||||||
-- lin white_A = mkA "" ;
|
lin white_A = mkA "cad" ;
|
||||||
-- lin wide_A = mkA "" ;
|
-- lin wide_A = mkA "" ;
|
||||||
-- lin wife_N = mkN "" ;
|
-- lin wife_N = mkN "" ;
|
||||||
-- lin win_V2 = mkV2 "" ;
|
-- lin win_V2 = mkV2 "" ;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
in dt.pref -- if det is numeral
|
in dt.pref -- if det is numeral
|
||||||
++ cn.s ! nfc.nf
|
++ cn.s ! nfc.nf
|
||||||
++ dt.s -- non-numeral det
|
++ dt.s -- non-numeral det
|
||||||
++ cn.mod ! num ! c
|
++ cn.mod ! det.st ! num ! c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : PN -> NP ;
|
-- : PN -> NP ;
|
||||||
@@ -90,8 +90,8 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
|
|
||||||
-- MassNP : CN -> NP ;
|
-- MassNP : CN -> NP ;
|
||||||
MassNP cn = useN cn ** {
|
MassNP cn = useN cn ** {
|
||||||
s = table { Nom => cn.s ! NomSg ++ cn.mod ! Sg ! Nom ;
|
s = table { Nom => cn.s ! NomSg ++ cn.mod ! Indefinite ! Sg ! Nom ;
|
||||||
c => cn.s ! Indef Sg ++ cn.mod ! Sg ! c }
|
c => cn.s ! Indef Sg ++ cn.mod ! Indefinite ! Sg ! c }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -225,18 +225,19 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
AdjCN ap cn = cn ** {
|
AdjCN ap cn = cn ** {
|
||||||
s = table { NomSg => cn.s ! Indef Sg ; -- When an adjective is added, noun loses case marker.
|
s = table { NomSg => cn.s ! Indef Sg ; -- When an adjective is added, noun loses case marker.
|
||||||
x => cn.s ! x } ;
|
x => cn.s ! x } ;
|
||||||
mod = let conj = if_then_Str cn.hasMod "oo" [] in
|
mod = \\st,n,c =>
|
||||||
\\n,c => cn.mod ! n ! Abs -- If there was something before, it is now in Abs
|
cn.mod ! st ! 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
|
++ andConj st cn.hasMod -- If the sentence is already modified, any new modifier needs to be introduced with conjunction
|
||||||
++ ap.s ! AF n c ;
|
++ ap.s ! AF n c ;
|
||||||
hasMod = True
|
hasMod = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- : CN -> RS -> CN ;
|
-- : CN -> RS -> CN ;
|
||||||
RelCN cn rs = cn ** {
|
RelCN cn rs = cn ** {
|
||||||
mod = let conj = if_then_Str cn.hasMod "ee" [] in
|
mod = \\st,n,c => --what to do with subject case if there's both adj and RS?
|
||||||
\\n,c => cn.mod ! n ! c ++ conj ++ rs.s ! gender cn ! c ;
|
cn.mod ! st ! n ! Abs
|
||||||
|
++ andConj st cn.hasMod
|
||||||
|
++ rs.s ! gender cn ! c ;
|
||||||
hasMod = True ;
|
hasMod = True ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -263,7 +264,9 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
--2 Possessive and partitive constructs
|
--2 Possessive and partitive constructs
|
||||||
|
|
||||||
-- : PossNP : CN -> NP -> CN ;
|
-- : PossNP : CN -> NP -> CN ;
|
||||||
PossNP cn np = cn ** {mod = \\n,c => cn.mod ! n ! c ++ np.s ! Abs} ; -- guriga Axmed, not Axmed gurigiisa
|
PossNP cn np = cn ** { -- guriga Axmed, not Axmed gurigiisa
|
||||||
|
mod = \\st,n,c => cn.mod ! st ! n ! c ++ objpron np ! Abs
|
||||||
|
} ;
|
||||||
{-
|
{-
|
||||||
-- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
|
-- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
|
||||||
PartNP cn np = cn ** { } ;
|
PartNP cn np = cn ** { } ;
|
||||||
@@ -284,4 +287,12 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
-- : Det -> DAP ; -- this (or that)
|
-- : Det -> DAP ; -- this (or that)
|
||||||
DetDAP det = det ;
|
DetDAP det = det ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
oper
|
||||||
|
andConj : State -> Bool -> Str = \st,hasMod ->
|
||||||
|
case <st,hasMod> of {
|
||||||
|
<Indefinite,True> => "oo" ;
|
||||||
|
<Definite,True> => "ee" ;
|
||||||
|
_ => []
|
||||||
|
} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ oper
|
|||||||
Sg2_Prep => Sg2 ;
|
Sg2_Prep => Sg2 ;
|
||||||
Pl1_Prep i => Pl1 i ;
|
Pl1_Prep i => Pl1 i ;
|
||||||
Pl2_Prep => Pl2 ;
|
Pl2_Prep => Pl2 ;
|
||||||
_ => Pl3
|
_ => Sg3 Masc
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
isP3 = overload {
|
isP3 = overload {
|
||||||
|
|||||||
@@ -13,13 +13,14 @@ oper
|
|||||||
Noun3 : Type = Noun ;
|
Noun3 : Type = Noun ;
|
||||||
|
|
||||||
CNoun : Type = Noun ** {
|
CNoun : Type = Noun ** {
|
||||||
mod : Number => Case => Str ;
|
mod : State -- for conjunctions: oo for indef, ee for def
|
||||||
|
=> Number => Case => Str ;
|
||||||
hasMod : Bool ;
|
hasMod : Bool ;
|
||||||
isPoss : Bool -- to prevent impossible forms in ComplN2 with Ns that have short possessive, e.g. "father"
|
isPoss : Bool -- to prevent impossible forms in ComplN2 with Ns that have short possessive, e.g. "father"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
cn2str : Number -> Case -> CNoun -> Str = \n,c,cn ->
|
cn2str : Number -> Case -> CNoun -> Str = \n,c,cn ->
|
||||||
cn.s ! Indef n ++ cn.mod ! n ! c ;
|
cn.s ! Indef n ++ cn.mod ! Indefinite ! n ! c ;
|
||||||
|
|
||||||
PNoun : Type = {s : Str ; a : Agreement} ;
|
PNoun : Type = {s : Str ; a : Agreement} ;
|
||||||
|
|
||||||
@@ -154,7 +155,7 @@ oper
|
|||||||
False => np.s} ;
|
False => np.s} ;
|
||||||
|
|
||||||
useN : Noun -> CNoun ** BaseNP = \n -> n **
|
useN : Noun -> CNoun ** BaseNP = \n -> n **
|
||||||
{ mod = \\_,_ => [] ; hasMod = False ;
|
{ mod = \\_,_,_ => [] ; hasMod = False ;
|
||||||
a = Sg3 (gender n) ; isPron,isPoss = False ;
|
a = Sg3 (gender n) ; isPron,isPoss = False ;
|
||||||
empty = [] ; st = Indefinite
|
empty = [] ; st = Indefinite
|
||||||
} ;
|
} ;
|
||||||
@@ -896,7 +897,7 @@ oper
|
|||||||
wo = wordOrder [] [] {p1,p2=[]} (vp'.comp ! pagr2agr vp.obj2.a) inf vp' ;
|
wo = wordOrder [] [] {p1,p2=[]} (vp'.comp ! pagr2agr vp.obj2.a) inf vp' ;
|
||||||
in wo.beforeSTM ++ wo.afterSTM ;
|
in wo.beforeSTM ++ wo.afterSTM ;
|
||||||
|
|
||||||
linCN : CNoun -> Str = \cn -> cn.s ! NomSg ++ cn.mod ! Sg ! Abs ;
|
linCN : CNoun -> Str = \cn -> cn.s ! Indef Sg ++ cn.mod ! Indefinite ! Sg ! Abs ;
|
||||||
linAdv : Adverb -> Str = \adv ->
|
linAdv : Adverb -> Str = \adv ->
|
||||||
adv.berri
|
adv.berri
|
||||||
++ adv.sii
|
++ adv.sii
|
||||||
|
|||||||
7
src/somali/unittest/ap.gftest
Normal file
7
src/somali/unittest/ap.gftest
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
-- LangEng: the big black bird
|
||||||
|
LangSom: shimbir BIND da madow ee weyn
|
||||||
|
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumSg) (AdjCN (PositA big_A) (AdjCN (PositA black_A) (UseN bird_N))))) NoVoc
|
||||||
|
|
||||||
|
-- LangEng: a big black bird
|
||||||
|
LangSom: shimbir madow oo weyn
|
||||||
|
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant IndefArt NumSg) (AdjCN (PositA big_A) (AdjCN (PositA black_A) (UseN bird_N))))) NoVoc
|
||||||
@@ -9,3 +9,7 @@ Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (
|
|||||||
-- LangEng: the men that buy the books are these
|
-- LangEng: the men that buy the books are these
|
||||||
LangSom: niman BIND ka buugaag BIND ta iibsadaa waa kuwan
|
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
|
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
|
||||||
|
|
||||||
|
-- LangEng: the books that the men buy are these
|
||||||
|
LangSom: buugaag BIND ta niman BIND ku iibsadaan waa kuwan
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (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)))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumPl))))))) NoVoc
|
||||||
|
|||||||
Reference in New Issue
Block a user