From a520c9659f57ff28f18454e61e0f6e4b3e68f0f0 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 27 Sep 2019 11:14:23 +0200 Subject: [PATCH] (Som) Add superlatives --- src/somali/AdjectiveSom.gf | 4 +++- src/somali/CatSom.gf | 5 ++++- src/somali/NounSom.gf | 19 +++++++++++-------- src/somali/unittest/ap.gftest | 8 ++++++++ 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/somali/AdjectiveSom.gf b/src/somali/AdjectiveSom.gf index b64d15008..19b4e6fd3 100644 --- a/src/somali/AdjectiveSom.gf +++ b/src/somali/AdjectiveSom.gf @@ -40,7 +40,9 @@ concrete AdjectiveSom of Adjective = CatSom ** open ResSom, Prelude in { -- The superlative use is covered in $Ord$. -- : Ord -> AP ; -- warmest - -- AdjOrd ord = ord ** {} ; + AdjOrd ord = ord ** { + compar = [] + } ; -- Sentence and question complements defined for all adjectival -- phrases, although the semantics is only clear for some adjectives. diff --git a/src/somali/CatSom.gf b/src/somali/CatSom.gf index 9e41234ba..c4da9418a 100644 --- a/src/somali/CatSom.gf +++ b/src/somali/CatSom.gf @@ -66,7 +66,10 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in { Predet = {s : Str ; da : DefArticle ; isPoss : Bool} ; Quant = ResSom.Quant ; Num = ResSom.Num ; - Ord = {s : Str ; n : Number} ; + Ord = { + s : AForm => Str ; -- Ord can came from AP and become AP again + n : Number -- Ord can come from Num, which has inherent number + } ; DAP = ResSom.Determiner ; diff --git a/src/somali/NounSom.gf b/src/somali/NounSom.gf index bc680e617..5578c774a 100644 --- a/src/somali/NounSom.gf +++ b/src/somali/NounSom.gf @@ -141,9 +141,9 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { -- : Quant -> Num -> Ord -> Det ; -- these five best DetQuantOrd quant num ord = let theseFive = DetQuant quant num in theseFive ** { - s = \\g,c => theseFive.s ! g ! c ++ ord.s ; - sp = \\g,c => theseFive.sp ! g ! c ++ ord.s ; - shortPoss = \\da => theseFive.shortPoss ! da ++ ord.s + s = \\g,c => theseFive.s ! g ! c ++ ord.s ! AF num.n c ; + sp = \\g,c => theseFive.sp ! g ! c ++ ord.s ! AF num.n c ; + shortPoss = \\da => theseFive.shortPoss ! da ++ ord.s ! AF num.n Abs } ; -- Whether the resulting determiner is singular or plural depends on the @@ -173,17 +173,20 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { OrdDigits digs = digs ** { s = digs.s ! NOrd } ; -} -- : Numeral -> Ord ; - OrdNumeral num = num ** {s = num.ord} ; + OrdNumeral num = num ** { + s = \\_ => num.ord + } ; -{- -- : A -> Ord ; - OrdSuperl a = { } ; + OrdSuperl a = { + s = \\af => "ugu" ++ a.s ! af ; + n = Sg -- ?? is this meaningful? + } ; -- One can combine a numeral and a superlative. -- : Numeral -> A -> Ord ; -- third largest - OrdNumeralSuperl num a = num ** { } ; --} + -- OrdNumeralSuperl num a = num ** { } ; -- : Quant DefArt = defQuant "a" "kan" "tan" "kuwan" False ; diff --git a/src/somali/unittest/ap.gftest b/src/somali/unittest/ap.gftest index 8178002ef..baf20a2f6 100644 --- a/src/somali/unittest/ap.gftest +++ b/src/somali/unittest/ap.gftest @@ -22,3 +22,11 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQ -- LangEng: that cat is bigger than this cat LangSom: bisad BIND daasi bisad BIND dan waa ka weyn tahay Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)) (UseComp (CompAP (ComparA big_A (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)))))))) NoVoc + +-- LangEng: that cat is biggest +LangSom: bisad BIND daasi waa ugu weyn tahay +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)) (UseComp (CompAP (AdjOrd (OrdSuperl big_A))))))) NoVoc + +-- LangEng: cat is the biggest animal that I saw +LangSom: bisadi waa xayawaan BIND ka ugu weyn aan arkay +Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (MassNP (UseN cat_N)) (UseComp (CompNP (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl big_A)) (RelCN (UseN animal_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (SlashV2a see_V2)))))))))