From e71c959a0999a4b645035fdc5aa20a94e2a81a54 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Apr 2020 20:57:56 +0200 Subject: [PATCH] (Hun) WIP: comparative and superlative forms --- src/hungarian/AdjectiveHun.gf | 17 +++++++-------- src/hungarian/CatHun.gf | 2 +- src/hungarian/ResHun.gf | 41 ++++++++++++++++++++++++++++++----- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 484e15d34..19134c2c7 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -5,12 +5,12 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { lin -- : A -> AP ; - PositA a = a ; + PositA a = {s = a.s ! Posit} ; -- : A -> NP -> AP ; - -- ComparA a np = a ** { - -- - -- } ; + ComparA a np = a ** { + s = \\n => a.s ! Compar ! n ++ np.s ! Ade ; + } ; -- : A2 -> NP -> AP ; -- married to her -- ComplA2 a2 np = a2 ** { } ; @@ -19,13 +19,12 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- ReflA2 a2 = a2 ** { } ; -- : A2 -> AP ; -- married - -- UseA2 = PositA ; + UseA2 = PositA ; -- : A -> AP ; -- warmer - -- UseComparA a = a ** { - -- s = \\af => "???" ++ a.s ! af ; - -- compar = [] - -- } ; + UseComparA a = a ** { + s = \\n => a.s ! Compar ! n ; + } ; -- : CAdv -> AP -> NP -> AP ; -- as cool as John diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 743abe55d..a4471e71d 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -46,7 +46,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { -- Constructed in AdjectiveHun. - AP = ResHun.Adjective ; + AP = ResHun.AdjPhrase ; --2 Nouns and noun phrases diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index f80efe02d..b3b2589b7 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -116,16 +116,45 @@ oper -------------------------------------------------------------------------------- -- Adjectives - Adjective : Type = {s : Number => Str} ; + AdjPhrase : Type = {s : Number => Str} ; + + Adjective : Type = {s : Degree => Number => Str} ; mkAdj : Str -> Adjective = \sg -> { - s = \\n => - let plural = case n of { - Sg => [] ; - Pl => pluralAllomorph sg } - in sg + plural + s = \\d,n => + let adj = case d of { + Compar => comparAdj sg ; + Superl => "leg" + comparAdj sg ; + _ => sg } ; + plural = case n of { + Sg => [] ; + Pl => pluralAdj adj } + in adj + plural } ; + -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives + comparAdj : Str -> Str = \stem -> + case stem of { +-- Final a and e become lengthened at the end of a word, if the comparative suffix -bb is joined to it—e.g., drága, drágább; fekete, feketébb, &c.; ó shortens its sound only in jó; jobb, legjobb. + "szép" => "szebb" ; + "könnyű" => "könnyebb" ; + "ifju" => "ifjabb" ; + "hosszú" => "hosszabb" ; + "sok" => "több" ; + _ + #v => stem + "bb" ; + _ => harm "abb" "ebb" ! getHarm stem + } ; + + + pluralAdj : Str -> Str = \stem -> + case vowFinal stem of { + True => -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives + case last stem of { "ü" => "ek" ; + "i" => harm "ak" "ek" ! getHarm stem ; + _ => "k" } ; + + False => harm3 "ok" "ek" "ök" ! getHarm stem + } ; -------------------------------------------------------------------------------- -- Verbs