diff --git a/languages.csv b/languages.csv index 18d0d92a5..4345453dc 100644 --- a/languages.csv +++ b/languages.csv @@ -5,7 +5,7 @@ Ara,Arabic,arabic,,,,,,y,,y Bul,Bulgarian,bulgarian,,,y,,,,,y Cat,Catalan,catalan,Romance,,y,,,,y,y Chi,Chinese (simplified),chinese,,,,,,,,y -Cze,Czech,czech,,,n,n,n,n,n,n +Cze,Czech,czech,,,,,,n,,y Dan,Danish,danish,Scand,,y,,,,,y Dut,Dutch,dutch,,,y,,,,,y Eng,English,english,,,y,,,,y,y diff --git a/src/czech/ParadigmsCze.gf b/src/czech/ParadigmsCze.gf index 2f0a7bb0f..a8cb96789 100644 --- a/src/czech/ParadigmsCze.gf +++ b/src/czech/ParadigmsCze.gf @@ -61,7 +61,7 @@ oper = \s -> lin N (declMESTO s) ; muzN : Str -> N = \s -> lin N (declMUZ s) ; - soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i} + soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i} = \s -> lin N (declSOUDCE s) ; strojN : Str -> N = \s -> lin N (declSTROJ s) ; @@ -97,7 +97,7 @@ oper _ + "í" => jarniAdjForms s ; _ + "ův" => otcuvAdjForms s ; _ + "in" => matcinAdjForms s ; - _ => Predef.error ("no mkA for" ++ s) + _ => matcinAdjForms ("??" + s) -- Predef.error ("no mkA for" ++ s) }) ; } ; @@ -133,7 +133,7 @@ oper mkPrep : Str -> Case -> Prep = \s,c -> lin Prep {s = s ; c = c ; hasPrep = True} ; ---- True if s /= "" - + mkConj : Str -> Conj = \s -> lin Conj {s1 = [] ; s2 = s} ; diff --git a/src/czech/ResCze.gf b/src/czech/ResCze.gf index f683a2ab1..1ff5c71d9 100644 --- a/src/czech/ResCze.gf +++ b/src/czech/ResCze.gf @@ -86,7 +86,7 @@ oper ul + "ice" => ul + "ic" ; koleg + "yně" => koleg + "yň" ; ruz + "e" => ruz + "í" ; - _ => Predef.error ("shortFemPlGen does not apply to" ++ s) + _ => "??" + s -- Predef.error ("shortFemPlGen does not apply to" ++ s) } ; --------------- @@ -155,7 +155,7 @@ oper => declKURE ; => declMORE ; => declSTAVENI ; - _ => Predef.error ("cannot infer declension type for" ++ nom ++ gen) + _ => (\s -> declSTROJ ("??" + s)) -- Predef.error ("cannot infer declension type for" ++ nom ++ gen) } in decl nom ; @@ -172,7 +172,7 @@ oper _ + "ce" => declSOUDCE s ; _ + "e" => declMORE s ; _ + "í" => declSTAVENI s ; - _ => Predef.error ("cannot guess declension type for" ++ s) + _ => declSTROJ ("??" + s) -- Predef.error ("cannot guess declension type for" ++ s) } ; -- the traditional declensions, in both CEG and Wiki diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index a718d87ac..a9fdefd6e 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -6,19 +6,24 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : A -> AP ; PositA a = emptyAP ** { - s = a.s ! Posit + s = \\n,c => + let adj : Noun = (a ** {s = a.s ! Posit}) in + caseFromStem glue adj c n ; } ; -- : A -> NP -> AP ; - ComparA a np = emptyAP ** { - s = a.s ! Compar ; - compar = np.s ! Ade ; + ComparA a np = UseComparA a ** { + compl = \\n => applyAdp (caseAdp Ade) np ; + -- compl = applyAdp (prepos Nom "mint") np ; } ; -- : A2 -> NP -> AP ; -- married to her - ComplA2 a2 np = emptyAP ** { - s = a2.s ! Posit ; - compar = np.s ! a2.c2.c ++ a2.c2.s + ComplA2 a2 np = let ap : AP = PositA a2 in ap ** { + s = case a2.isPost of {False => ap.s ; _ => \\_,_ => []} ; + compl = \\n => applyAdp a2.c2 np + ++ case a2.isPost of { + True => ap.s ! n ! Nom ; + False => [] } ; } ; -- : A2 -> AP ; -- married to itself @@ -29,13 +34,15 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : A -> AP ; -- warmer UseComparA a = emptyAP ** { - s = a.s ! Compar ; + s = \\n,c => + let adj : Noun = (a ** {s = a.s ! Compar}) in + caseFromStem glue adj c n ; } ; -- : CAdv -> AP -> NP -> AP ; -- as cool as John CAdvAP adv ap np = ap ** { - s = \\n => adv.s ++ ap.s ! n ; - compar = ap.compar ++ adv.p ++ np.s ! Nom + s = \\n,c => adv.s ++ ap.s ! n ! c ; + compl = \\n => ap.compl ! n ++ adv.p ++ applyAdp (caseAdp Nom) np ; } ; -- The superlative use is covered in $Ord$. @@ -53,7 +60,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : AdA -> AP -> AP ; AdAP ada ap = ap ** { - s = \\af => ada.s ++ ap.s ! af ; + s = \\n,c => ada.s ++ ap.s ! n ! c ; } ; @@ -61,7 +68,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : AP -> Adv -> AP ; -- warm by nature AdvAP ap adv = ap ** { - s = \\af => ap.s ! af ++ adv.s ; + s = \\n,c => ap.s ! n ! c ++ adv.s ; } ; } diff --git a/src/hungarian/AdverbHun.gf b/src/hungarian/AdverbHun.gf index ed7b74737..d4643818a 100644 --- a/src/hungarian/AdverbHun.gf +++ b/src/hungarian/AdverbHun.gf @@ -12,7 +12,8 @@ lin -- : Prep -> NP -> Adv ; PrepNP prep np = { - s = prep.pr ++ np.s ! prep.c ++ prep.s ; + s = applyAdp prep np ; + isPre = False ; } ; -- Adverbs can be modified by 'adadjectives', just like adjectives. diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 287dc7182..e60c34b8e 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -1,4 +1,4 @@ -concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { +concrete CatHun of Cat = CommonX - [Adv] ** open ResHun, Prelude in { flags optimize=all_subs ; @@ -58,7 +58,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { -- ``` Predet (QuantSg | QuantPl Num) Ord -- as defined in NounHun. - CN = ResHun.Noun ; + CN = ResHun.CNoun ; NP = ResHun.NounPhrase ; Pron = ResHun.Pronoun ; --Pronouns need enough info to turn it into NP or Quant. Det = ResHun.Determiner ; @@ -66,7 +66,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { Quant = ResHun.Quant ; Num = ResHun.Num ; Ord = { - s : Number => Str ; -- Number => Case => Str ; -- Ord can come from AP and become AP again + s : Number => Case => Str ; -- Ord can come from AP and become AP again n : Number -- Ord can come from Num, which has inherent number } ; DAP = ResHun.Determiner ; @@ -78,7 +78,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { Card = ResHun.Numeral ; Numeral = ResHun.Numeral ; - Digits = {s : CardOrd => Str ; n : Number} ; + Digits = {s : CardOrd => Str} ; @@ -118,4 +118,9 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { N3 = ResHun.Noun ; PN = ResHun.NounPhrase ; + Adv = {s : Str ; isPre : Bool} ; + +linref + CN = linCN ; + } diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index f7bac7224..689a9c891 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -3,36 +3,48 @@ concrete ConjunctionHun of Conjunction = -- Adverb and other simple {s : Str} types. lincat - [Adv],[AdV],[IAdv],[S] = {s1,s2 : Str} ; + [AdV],[IAdv],[S] = {s1,s2 : Str} ; lin - BaseAdv, BaseAdV, BaseIAdv, BaseS = twoSS ; - ConsAdv, ConsAdV, ConsIAdv, ConsS = consrSS comma ; - ConjAdv, ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ; + BaseAdV, BaseIAdv, BaseS = twoSS ; + ConsAdV, ConsIAdv, ConsS = consrSS comma ; + ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ; + +lincat + [Adv] = {s1,s2 : Str ; isPre : Bool} ; + +lin + BaseAdv x y = y ** twoSS x y ; + ConsAdv x xs = xs ** consrSS comma x xs ; + ConjAdv co xs = xs ** conjunctDistrSS co xs ; -- Adjectival phrases lincat - [AP] = {s1,s2 : Number => Str} ; + [AP] = {s1,s2 : Number => Case => Str} ; lin BaseAP x y = -- Don't try to have discontinuous comparative forms - let xCont : AP = x ** {s = \\n => x.s ! n ++ x.compar} ; - yCont : AP = y ** {s = \\n => y.s ! n ++ y.compar} ; - in twoTable Number xCont yCont ; + let xCont : AP = x ** {s = \\n,c => x.s ! n ! c ++ x.compl ! n} ; + yCont : AP = y ** {s = \\n,c => y.s ! n ! c ++ y.compl ! n} ; + in twoTable2 Number Case xCont yCont ; ConsAP a as = - let aCont : AP = a ** {s = \\n => a.s ! n ++ a.compar} ; - in consrTable Number comma aCont as ; - ConjAP co as = conjunctDistrTable Number co as ** {compar = []} ; + let aCont : AP = a ** {s = \\n,c => a.s ! n ! c ++ a.compl ! n} ; + in consrTable2 Number Case comma aCont as ; + ConjAP co as = conjunctDistrTable2 Number Case co as ** {compl = \\_ => []} ; -- Noun phrases lincat - [NP] = ResHun.BaseNP ** {s1,s2 : Case => Str} ; + [NP] = ResHun.BaseNP ** {s1,s2 : Possessor => Case => Str} ; lin - BaseNP x y = twoTable Case x y ** y ; - ConsNP x xs = consrTable Case comma x xs ** xs ; - ConjNP co xs = conjunctDistrTable Case co xs ** xs ** {agr = }; + BaseNP x y = twoTable2 Possessor Case x y ** y ; + ConsNP x xs = xs ** consrTable2 Possessor Case comma x xs ; + ConjNP co xs = conjunctDistrTable2 Possessor Case co xs ** xs ** { + agr = Pl ; + _ => co.n }> + } ; -- Relative sentences lincat diff --git a/src/hungarian/GrammarHun.gf b/src/hungarian/GrammarHun.gf index 325a57e95..5122cfb85 100644 --- a/src/hungarian/GrammarHun.gf +++ b/src/hungarian/GrammarHun.gf @@ -9,10 +9,10 @@ concrete GrammarHun of Grammar = RelativeHun, ConjunctionHun, PhraseHun, - TextX, + TextX - [Adv], StructuralHun, IdiomHun, - TenseX + TenseX - [Adv] ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 80fa8dc9a..deda0643c 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -8,93 +8,93 @@ concrete LexiconHun of Lexicon = CatHun ** lin airplane_N = mkN "repülőgép" "repülőgépet" ; -- lin alas_Interj = mkInterj "" ; -- lin already_Adv = mkA "" ; -lin animal_N = mkN "állat" ; +lin animal_N = mkN "állat" "állatot" "állatok" "állata" ; -- lin answer_V2S = mkV2S "válasz" ; -lin apartment_N = mkN "lakás" ; +lin apartment_N = mkN "lakás" "lakást" ; lin apple_N = mkN "alma" ; -lin art_N = mkN "müvészet" ; +lin art_N = mkN "művészet" "művészetet" ; -- lin ashes_N = mkN "" ; -- lin ask_V2Q = mkV2 "" ; ---- -- B -lin baby_N = mkN "bébi" ; +lin baby_N = mkN "bébi" "bébit" ; -- lin back_N = mkN "" ; lin bad_A = mkA "rossz" ; -lin bank_N = mkN "bank" ; +lin bank_N = mkN "bank" "bankot" ; -- lin bark_N = mkN "" ; lin beautiful_A = mkA "szép" ; -- lin become_VA = mkVA "" ; lin beer_N = mkN "sör" "sört" ; -- lin beg_V2V = mkV2 "" ; -lin belly_N = mkN "has" ; +lin belly_N = mkN "has" "hasat" ; lin big_A = mkA "nagy" ; -lin bike_N = mkN "bicikli" ; -lin bird_N = mkN "madár" ; +lin bike_N = mkN "bicikli" "biciklit"; +lin bird_N = mkN "madár" "madarat"; -- lin bite_V2 = mkV2 "" ; lin black_A = mkA "fekete" ; -lin blood_N = mkN "vér" ; +lin blood_N = mkN "vér" "vért"; -- lin blow_V = mkV "" ; lin blue_A = mkA "kék" ; -lin boat_N = mkN "hajó" ; +lin boat_N = mkN "hajó" "hajót" "hajók" "hajója" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; -lin book_N = mkN "könyv" ; +lin book_N = mkN "könyv" "könyvet" ; lin boy_N = mkN "fiú" ; -lin bread_N = mkN "kenyér" ; +lin bread_N = mkN "kenyér" "kenyeret"; lin break_V2 = mkV2 "szünet" ; -lin breast_N = mkN "mell" ; +lin breast_N = mkN "mell" "mellet" ; -- lin breathe_V = mkV "" ; -- lin broad_A = mkA "" ; -- lin brother_N2 = mkN "öccsém" ; (possessive form?) lin brown_A = mkA "barna" ; -- lin burn_V = mkV "" ; -lin butter_N = mkN "vaj" ; +lin butter_N = mkN "vaj" "vajat" ; -- lin buy_V2 = mkV2 "" ; ---- -- C -lin camera_N = mkN "fényképezőgép" ; +lin camera_N = mkN "fényképezőgép" "fényképezőgépet"; -- lin cap_N = mkN "" ; -lin car_N = mkN "autó" ; -lin carpet_N = mkN "szőnyeg" ; -lin cat_N = mkN "macska" ; -lin ceiling_N = mkN "plafon" ; -lin chair_N = mkN "szék" ; -lin cheese_N = mkN "sajt" ; -lin child_N = mkN "gyerek" ; -lin church_N = mkN "templom" ; -lin city_N = mkN "város" ; +lin car_N = mkN "autó" "autót" ; +lin carpet_N = mkN "szőnyeg" "szőnyeget" ; +lin cat_N = mkN "macska" "macskát"; +lin ceiling_N = roof_N ; +lin chair_N = mkN "szék" "széket"; +lin cheese_N = mkN "sajt" "sajtot" ; +lin child_N = mkN "gyerek" "gyereket" ; +lin church_N = mkN "templom" "templomot" ; +lin city_N = mkN "város" "várost" ; lin clean_A = mkA "tiszta" ; lin clever_A = mkA "okos" ; lin close_V2 = mkV2 "közel" ; -lin cloud_N = mkN "felhö" ; -lin coat_N = mkN "kabát" ; +lin cloud_N = mkN "felhő" "felhőt" ; +lin coat_N = mkN "kabát" "kabátot" ; lin cold_A = mkA "hideg" ; -- lin come_V = mkV "" ; -lin computer_N = mkN "számítógép" ; +lin computer_N = mkN "számítógép" "számítógépet" ; lin correct_A = mkA "igaz" ; -- lin count_V2 = mkV2 "" ; -lin country_N = mkN "ország" ; -lin cousin_N = mkN "unokatestvér" ; --short "unoka" +lin country_N = mkN "ország" "országot" "országok" "országa" ; +lin cousin_N = mkN "unokatestvér" "unokatestvért"; --short "unoka" lin cow_N = mkN "tehén" ; -- lin cut_V2 = mkV2 "" ; -- -- ---- -- -- D -- -lin day_N = mkN "nap" ; +lin day_N = mkN "nap" "napot" ; -- lin die_V = mkV "" ; -- lin dig_V = mkV "" ; -- lin dirty_A = mkA "" ; -- lin distance_N3 = mkN "" ; -- lin do_V2 = mkV2 do_V ; -lin doctor_N = mkN "orvos" ; -lin dog_N = mkN "kutya" ; -lin door_N = mkN "ajtó" ; +lin doctor_N = mkN "orvos" "orvost"; +lin dog_N = mkN "kutya" "kutyát"; +lin door_N = mkN "ajtó" "ajtót" ; -- lin drink_V2 = mkV2 "" ; -- lin dry_A = mkA "" ; -- lin dull_A = mkA "" ; @@ -103,94 +103,95 @@ lin door_N = mkN "ajtó" ; ---- -- E -lin ear_N = mkN "fül" ; -lin earth_N = mkN "föld" ; +lin ear_N = mkN "fül" "fület"; +lin earth_N = mkN "föld" "földet"; -- lin eat_V2 = mkV2 "" ; -lin egg_N = mkN "tojás" ; +lin egg_N = mkN "tojás" "tojást" ; lin empty_A = mkA "üres" ; -lin enemy_N = mkN "ellenség" ; -lin eye_N = mkN "szem" ; +lin enemy_N = mkN "ellenség" "ellenséget" ; +lin eye_N = mkN "szem" "szemet"; ---- -- F -lin factory_N = mkN "gyár" ; +lin factory_N = mkN "gyár" "gyárat" ; -- lin fall_V = mkV "" ; -- lin far_Adv = mkA "" ; -lin fat_N = mkN "kövér" ; -lin father_N2 = mkN2 "apa" ; +lin fat_N = mkN "kövér" "kövéret"; +lin father_N2 = mkN2 (mkN "apa" "apát") ; -- lin fear_V2 = mkV2 "" ; -- lin fear_VS = mkVS "" ; -lin feather_N = mkN "madártoll" ; +lin feather_N = mkN "madártoll" "madártollat"; -- lin fight_V2 = mkV2 "" ; -- lin find_V2 = mkV2 "" ; -lin fingernail_N = mkN "köröm" ; -lin fire_N = mkN "tűz" ; -lin fish_N = mkN "hal" ; +lin fingernail_N = mkN "köröm" "körmöt"; +lin fire_N = mkN "tűz" "tüzet" ; +lin fish_N = mkN "hal" "halat" ; -- lin float_V = mkV "" ; -lin floor_N = mkN "padló" ; +lin floor_N = mkN "padló" "padlót" ; -- lin flow_V = mkV "" ; -lin flower_N = mkN "vírág" ; +lin flower_N = mkN "virág" "virágot" "virágok" "virága" ; lin fly_V = mkV "repül" ; -lin fog_N = mkN "köd" ; -lin foot_N = mkN "láb" ; --same as leg, to specify "lábfej" -lin forest_N = mkN "erdő" ; +lin fog_N = mkN "köd" "ködöt" "ködön" "ködhöz" "ködök" + "köde" "ködünk" "ködei" ; +lin foot_N = leg_N ; --same as leg, to specify "lábfej" +lin forest_N = mkN "erdő" "erdőt" ; -- lin forget_V2 = mkV2 "" ; -- lin freeze_V = mkV "" ; -lin fridge_N = mkN "hűtő" ; -lin friend_N = mkN "barát" ; -lin fruit_N = mkN "gyümölcs" ; +lin fridge_N = mkN "hűtő" "hűtőt" ; +lin friend_N = mkN "barát" "barátot" ; +lin fruit_N = mkN "gyümölcs" "gyümölcsöt" "gyümölcsök" "gyümölcse" ; lin full_A = mkA "tele" ; -- --lin fun_AV ---- -- G -lin garden_N = mkN "kert" ; -lin girl_N = mkN "lány" ; +lin garden_N = mkN "kert" "kertet" ; +lin girl_N = mkN "lány" "lányt"; -- lin give_V3 = mkV3 "" ; -lin glove_N = mkN "kesztyű" ; +lin glove_N = mkN "kesztyű" "kesztyűt" ; -- lin go_V = mkV "" ; -lin gold_N = mkN "arany" ; +lin gold_N = mkN "arany" "aranyat" ; lin good_A = mkA "jó" ; -lin grammar_N = mkN "nyelvtan" ; -lin grass_N = mkN "fű" ; +lin grammar_N = mkN "nyelvtan" "nyelvtant"; +lin grass_N = mkN "fű" "füvet"; lin green_A = mkA "zöld" ; ---- -- H -lin hair_N = mkN "haj" ; -lin hand_N = mkN "kéz" ; +lin hair_N = mkN "haj" "hajat" ; +lin hand_N = mkN "kéz" "kezet" ; -- lin harbour_N = mkN "" ; -lin hat_N = mkN "kalap" ; +lin hat_N = mkN "kalap" "kalapot" ; -- lin hate_V2 = mkV2 "" ; -lin head_N = mkN "fej" ; +lin head_N = mkN "fej" "fejet"; -- lin hear_V2 = mkV2 "" ; -lin heart_N = mkN "szív" ; +lin heart_N = mkN "szív" "szívet"; lin heavy_A = mkA "nehéz" ; -- lin hill_N = mkN "" ; -- lin hit_V2 = mkV2 "" ; -- lin hold_V2 = mkV2 "" ; -- lin hope_VS = mkV "" ; -- lin horn_N = mkN "" ; -lin horse_N = mkN "ló" ; +lin horse_N = mkN "ló" "lovat"; lin hot_A = mkA "forró" ; -lin house_N = mkN "ház" ; +lin house_N = mkN "ház" "házat" ; -- lin hunt_V2 = mkV2 "" ; -lin husband_N = mkN "férj" ; +lin husband_N = mkN "férj" "férjet"; -------- -- I - K -lin ice_N = mkN "jég" ; -lin industry_N = mkN "ipar" ; -lin iron_N = mkN "vas" ; +lin ice_N = mkN "jég" "jeget" ; +lin industry_N = mkN "ipar" "ipart" ; +lin iron_N = mkN "vas" "vasat" ; -- lin john_PN = mkPN "" ; -- lin jump_V = mkV "" ; -- lin kill_V2 = mkV2 "" ; -lin king_N = mkN "király" ; -lin knee_N = mkN "térd" ; +lin king_N = mkN "király" "királyt" ; +lin knee_N = mkN "térd" "térdet"; -- lin know_V2 = mkV2 "" ; -- lin know_VQ = mkVQ "" ; -- lin know_VS = mkV "" ; @@ -199,15 +200,15 @@ lin knee_N = mkN "térd" ; ---- -- L -lin lake_N = mkN "tó" ; -lin lamp_N = mkN "lámpa" ; -lin language_N = mkN "nyelv" ; +lin lake_N = mkN "tó" "tavat" ; +lin lamp_N = mkN "lámpa" "lámpát"; +lin language_N = mkN "nyelv" "nyelvet"; -- lin laugh_V = mkV "" ; -lin leaf_N = mkN "levél" ; +lin leaf_N = mkN "levél" "levelet"; -- lin learn_V2 = mkV2 "" ; -lin leather_N = mkN "bőr" ; +lin leather_N = mkN "bőr" "bőrt"; -- lin leave_V2 = mkV2 "" ; -lin leg_N = mkN "láb" ; +lin leg_N = mkN "láb" "lábat"; -- lin lie_V = mkV "" ; -- lin like_V2 = mkV2 "" ; -- lin listen_V2 = mkV2 "" ; @@ -216,7 +217,7 @@ lin leg_N = mkN "láb" ; -- lin long_A = mkA "" ; -- lin lose_V2 = mkV2 "" ; -- lin louse_N = mkN "" ; -lin love_N = mkN "szerelem" ; +lin love_N = mkN "szerelem" "szerelmet"; -- lin love_V2 = mkV2 "" ; ---- @@ -224,46 +225,46 @@ lin love_N = mkN "szerelem" ; lin man_N = mkN "férfi" "ak" harmA ; -- force plural allomorph and a-harmony lin married_A2 = mkA2 "házas" Ins ; -lin meat_N = mkN "hús" ; -lin milk_N = mkN "tej" ; -lin moon_N = mkN "hold" ; -lin mother_N2 = mkN2 "anya" ; -lin mountain_N = mkN "hegy" ; -lin mouth_N = mkN "száj" ; -lin music_N = mkN "zene" ; +lin meat_N = mkN "hús" "húst"; +lin milk_N = mkN "tej" "tejet" ; +lin moon_N = mkN "hold" "holdat" ; +lin mother_N2 = mkN2 (mkN "anya" "anyát") ; +lin mountain_N = mkN "hegy" "hegyet"; +lin mouth_N = mkN "száj" "szájat" ; +lin music_N = mkN "zene" "zenét"; ---- -- N lin name_N = mkN "név" "nevet" ; -lin narrow_A = mkA "keskeny" ; --also "szűk" +lin narrow_A = mkA "keskeny" "keskenyet"; --also "szűk" lin near_A = mkA "közel" ; -lin neck_N = mkN "nyak" ; +lin neck_N = mkN "nyak" "nyakat"; lin new_A = mkA "új" ; -lin newspaper_N = mkN "újság" ; -lin night_N = mkN "éjszak" ; --also shortened to "éj" ("este" more for evening) -lin nose_N = mkN "orr" ; +lin newspaper_N = mkN "újság" "újságot" ; +lin night_N = mkN "éjszaka" "éjszakát"; --also shortened to "éj" ("este" more for evening) +lin nose_N = mkN "orr" "orrot" ; lin now_Adv = mkAdv "most" ; -lin number_N = mkN "szám" ; +lin number_N = mkN "szám" "számot" ; -- -- -------- -- -- O - P -- -- -lin oil_N = mkN "olaj" ; +lin oil_N = mkN "olaj" "olajat" ; -- TODO olajok or olajak? lin old_A = mkA "öreg" ; --also "idős" -- lin open_V2 = mkV2 "" ; -- lin paint_V2A = mkV2A "" ; -lin paper_N = mkN "papír" ; +lin paper_N = mkN "papír" "papírt" "papírok" "papírja" ; -- lin paris_PN = mkPN "Paris" ; -lin peace_N = mkN "béke" ; -lin pen_N = mkN "toll" ; -lin person_N = mkN "ember" ; -lin planet_N = mkN "bolygó" ; -lin plastic_N = mkN "műanyag" ; +lin peace_N = mkN "béke" "békét"; +lin pen_N = mkN "toll" "tollat" ; +lin person_N = mkN "ember" "embert"; +lin planet_N = mkN "bolygó" "bolygót" ; +lin plastic_N = mkN "műanyag" "műanyagot" "műanyagok" "műanyaga" ; -- lin play_V = mkV "" ; -lin policeman_N = mkN "rendőr" ; --the police "rendőrség" -lin priest_N = mkN "pap" ; +lin policeman_N = mkN "rendőr" "rendőrt"; --the police "rendőrség" +lin priest_N = mkN "pap" "papot" "papok" "papja" ; -- lin pull_V2 = mkV2 "" ; -- lin push_V2 = mkV2 "" ; -- lin put_V2 = mkV2 "" ; @@ -271,42 +272,42 @@ lin priest_N = mkN "pap" ; -- -------- -- -- Q - R -- -lin queen_N = mkN "kírálynő" ; -lin question_N = mkN "kérdés" ; -lin radio_N = mkN "rádió" ; -lin rain_N = mkN "eső" ; +lin queen_N = mkN "kírálynő" "kírálynőt" ; +lin question_N = mkN "kérdés" "kérdést" ; +lin radio_N = mkN "rádió" "rádiót" ; +lin rain_N = mkN "eső" "esőt" ; -- lin rain_V0 = mkV "" ; -- lin read_V2 = mkV2 "" ; lin ready_A = mkA "kész" ; -lin reason_N = mkN "ok" ; +lin reason_N = mkN "ok" "okot" "okok" "oka" ; lin red_A = mkA "piros" ; -lin religion_N = mkN "vallás" ; -lin restaurant_N = mkN "étterem" ; -lin river_N = mkN "folyó" ; -lin road_N = mkN "út" ; -lin rock_N = mkN "szikla" ; -lin roof_N = mkN "plafon" ; -lin root_N = mkN "gyökér" ; -lin rope_N = mkN "kötél" ; +lin religion_N = mkN "vallás" "vallást"; +lin restaurant_N = mkN "étterem" "éttermet"; +lin river_N = mkN "folyó" "folyót" ; +lin road_N = mkN "út" "utat" ; +lin rock_N = mkN "szikla" "sziklát"; +lin roof_N = mkN "plafon" "plafont" "plafonok" "plafonja" ; +lin root_N = mkN "gyökér" "gyökeret"; +lin rope_N = mkN "kötél" "kötelet"; -- lin rotten_A = mkA "" ; -- lin round_A = mkA "" ; -- lin rub_V2 = mkV2 "" ; -lin rubber_N = mkN "gumi" ; -lin rule_N = mkN "szabály" ; +lin rubber_N = mkN "gumi" "gumit"; +lin rule_N = mkN "szabály" "szabályt" ; -- lin run_V = mkV "" ; ---- -- S -lin salt_N = mkN "só" ; -lin sand_N = mkN "homok" ; +lin salt_N = mkN "só" "sót" ; +lin sand_N = mkN "homok" "homokot" "homokok" "homokja" ; -- lin say_VS = mkVS "" ; -lin school_N = mkN "iskola" ; -lin science_N = mkN "tudomány" ; +lin school_N = mkN "iskola" "iskolát"; +lin science_N = mkN "tudomány" "tudományt" ; -- lin scratch_V2 = mkV2 "" ; -lin sea_N = mkN "tenger" ; +lin sea_N = mkN "tenger" "tengert"; lin see_V2 = mkV2 "lát" ; -lin seed_N = mkN "mag" ; +lin seed_N = mkN "mag" "magot" "magok" "magja" ; -- lin seek_V2 = mkV2 "" ; -- lin sell_V3 = mkV3 "" ; -- lin send_V3 = mkV3 "" ; @@ -314,42 +315,43 @@ lin seed_N = mkN "mag" ; -- lin sharp_A = mkA "" ; -- lin sheep_N = mkN "" fem ; -- lin ship_N = mkN "" ; -lin shirt_N = mkN "ing" ; --shirt like t-shirt or the more formal? -lin shoe_N = mkN "cipő" ; -lin shop_N = mkN "üzlet" ; +lin shirt_N = mkN "ing" "inget"; --shirt like t-shirt or the more formal? +lin shoe_N = mkN "cipő" "cipőt" ; +lin shop_N = mkN "üzlet" "üzletet"; lin short_A = mkA "rövid" ; --in short text, if human length then "alacsony" -lin silver_N = mkN "ezüst" ; +lin silver_N = mkN "ezüst" "ezüstöt" "ezüstön" "ezüsthöz" "ezüstök" + "ezüstje" "ezüstünk" "ezüstjei" ; -- lin sing_V = mkV "" ; -- lin sister_N = mkN "" ; -- lin sit_V = mkV "" ; -lin skin_N = mkN "bőr" ; -lin sky_N = mkN "ég" ; +lin skin_N = mkN "bőr" "bőrt"; +lin sky_N = mkN "ég" "eget" ; -- lin sleep_V = mkV "" ; -lin small_A = mkA "kicsi" ; +lin small_A = mkA "kicsi" "kicsit"; -- lin smell_V = mkV "" ; -lin smoke_N = mkN "füst" ; +lin smoke_N = mkN "füst" "füstet"; lin smooth_A = mkA "sima" ; -lin snake_N = mkN "kígyó" ; -lin snow_N = mkN "hó" ; -lin sock_N = mkN "zokni" ; -lin song_N = mkN "dal" ; +lin snake_N = mkN "kígyó" "kígyót" ; +lin snow_N = mkN "hó" "havat" ; +lin sock_N = mkN "zokni" "zoknit"; +lin song_N = mkN "dal" "dalt" ; -- lin speak_V2 = mkV2 "" ; -- lin spit_V = mkV "" ; -- lin split_V2 = mkV2 "" ; -- lin squeeze_V2 = mkV2 "" ; -- lin stab_V2 = mkV2 "" ; -- lin stand_V = mkV "" ; -lin star_N = mkN "csillag" ; -lin steel_N = mkN "acél" ; -lin stick_N = mkN "rúd" ; -lin stone_N = mkN "kő"; +lin star_N = mkN "csillag" "csillagot" "csillagok" "csillaga" ; +lin steel_N = mkN "acél" "ok" harmA ; +lin stick_N = mkN "rúd" "rudat" ; +lin stone_N = mkN "kő" "követ" ; -- lin stop_V = mkV "" ; -- lin stove_N = mkN "" ; -lin straight_A = mkA "egyenes" ; -lin student_N = mkN "diák" ; +lin straight_A = mkA "egyenes"; +lin student_N = mkN "diák" "diákot" ; lin stupid_A = mkA "buta" ; --also "hülye" -- lin suck_V2 = mkV2 "" ; -lin sun_N = mkN "nap" ; --same as day +lin sun_N = mkN "nap" "napot"; --same as day -- lin swell_V = mkV "" ; -- lin swim_V = mkV "" ; @@ -357,23 +359,23 @@ lin sun_N = mkN "nap" ; --same as day -- T -lin table_N = mkN "asztal" ; -lin tail_N = mkN "farok" ; +lin table_N = mkN "asztal" "asztalt"; +lin tail_N = mkN "farok" "farkot"; lin talk_V3 = mkV3 "beszél" ; -- lin teach_V2 = mkV2 "" ; -lin teacher_N = mkN "tanár" ; -lin television_N = mkN "tévé" ; --also "televízió" but not used +lin teacher_N = mkN "tanár" "tanárt" ; +lin television_N = mkN "tévé" "tévét" ; --also "televízió" but not used lin thick_A = mkA "vastag" ; lin thin_A = mkA "vekony" ; -- lin think_V = mkV "" ; -- lin throw_V2 = mkV2 "" ; -- lin tie_V2 = mkV2 "" ; lin today_Adv = mkAdv "ma" ; -lin tongue_N = mkN "nyelv" ; --same as language -lin tooth_N = mkN "fog" ; -lin train_N = mkN "vonat" ; +lin tongue_N = mkN "nyelv" "nyelvet"; --same as language +lin tooth_N = mkN "fog" "fogat" ; +lin train_N = mkN "vonat" "vonatot" "vonatok" "vonata" ; -- lin travel_V = mkV "" ; -lin tree_N = mkN "fa" ; +lin tree_N = mkN "fa" "fát"; -- lin turn_V = mkV "" ; -------- @@ -382,8 +384,8 @@ lin tree_N = mkN "fa" ; lin ugly_A = mkA "csúf" ; -- lin uncertain_A = mkA "" ; -- lin understand_V2 = mkV2 "" ; -lin university_N = mkN "egyetem" ; -lin village_N = mkN "falu" ; +lin university_N = mkN "egyetem" "egyetemet"; +lin village_N = mkN "falu" "falut" "falvak"; -- lin vomit_V = mkV2 "" ; -------- @@ -391,28 +393,27 @@ lin village_N = mkN "falu" ; -- lin wait_V2 = mkV2 "" ; -- lin walk_V = mkV "" ; -lin war_N = mkN "háború" ; +lin war_N = mkN "háború" "háborút" ; lin warm_A = mkA "meleg" ; -- lin wash_V2 = mkV2 "" ; -- lin watch_V2 = mkV2 "" ; -lin water_N = mkN "víz" ; +lin water_N = mkN "víz" "vizet" ; lin wet_A = mkA "nedves" ; lin white_A = mkA "fehér" ; lin wide_A = mkA "széles" ; -lin wife_N = mkN "feleség" ; +lin wife_N = mkN "feleség" "feleséget" ; -- lin win_V2 = mkV2 "" ; -lin wind_N = mkN "szél" ; -lin window_N = mkN "ablak" ; -lin wine_N = mkN "bor" ; -lin wing_N = mkN "szárny" ; +lin wind_N = mkN "szél" "szelet" ; +lin window_N = mkN "ablak" "ablakot" "ablakok" "ablaka" ; +lin wine_N = mkN "bor" "bort"; +lin wing_N = mkN "szárny" "szárnyat"; -- lin wipe_V2 = mkV2 "" ; ---lin woman_N = mkN "nő" "k" harmO ; -lin woman_N = mkN "nő" "nőket" ; +lin woman_N = mkN "nő" "nőt" ; -- lin wonder_VQ = mkVQ "" ; -lin wood_N = mkN "fa" ; --same as tree -lin worm_N = mkN "féreg" ; --also "kukac" --- lin write_V2 = mkV2 "" ; -lin year_N = mkN "év" ; +lin wood_N = mkN "fa" "fát"; --same as tree +lin worm_N = mkN "féreg" "férget"; --also "kukac" +lin write_V2 = mkV2 (mkV "írok" "írsz" "ír" "írunk" "írtok" "írnak" "írni") ; +lin year_N = mkN "év" "évet"; lin yellow_A = mkA "sárga" ; lin young_A = mkA "fiatal" ; diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index b995be70a..e3d3e2e4e 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -1,4 +1,5 @@ -concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { +concrete NounHun of Noun = CatHun ** open + ResHun, Prelude, Coordination in { flags optimize=all_subs ; @@ -7,20 +8,39 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { --2 Noun phrases -- : Det -> CN -> NP - DetCN det cn = emptyNP ** det ** { - s = \\c => det.s ! Nom ++ cn.s ! det.n ! c ; + DetCN det cn = emptyNP ** cn ** det ** { + s = \\p,c => + let possessed : Str = caseFromPossStem cn det c ; + standalone : Str = caseFromStem glue cn c det.n ; + in case det.caseagr of { + True => det.s ! c ; + False => det.s ! Nom + } ++ case of { + <_, DetPoss _> + => possessed ; + + => standalone ; + + => let pron : Pronoun = pronTable ! ; -- Possessor's number + dnum : CatHun.Num = case det.n of { -- Possessed's number + Sg => NumSg ; Pl => NumPl } ; + in caseFromPossStem cn (DetQuant (PossPron pron) dnum) c + } ++ cn.compl ! det.n ! c ; agr = ; + objdef = dt2objdef det.dt ; } ; -- : PN -> NP ; UsePN pn = pn ; -- : Pron -> NP ; - UsePron pron = pron ; + UsePron pron = pron ** { + s = \\_ => pron.s ; + } ; -- : Predet -> NP -> NP ; -- only the man PredetNP predet np = np ** { - s = \\c => predet.s ++ np.s ! c ; + s = \\p,c => predet.s ++ np.s ! p ! c ; } ; -- A noun phrase can also be postmodified by the past participle of a @@ -32,28 +52,33 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : NP -> Adv -> NP ; -- Paris today AdvNP np adv = np ** { - s = \\c => np.s ! c ++ adv.s ; - } ; + s = \\p,c => case adv.isPre of { + True => adv.s ++ np.s ! p ! c ; + False => np.s ! p ! c ++ adv.s } ; + } ; + -- : NP -> Adv -> NP ; -- boys, such as .. ExtAdvNP np adv = np ** { - s = \\c => np.s ! c ++ bindComma ++ adv.s ; - } ; + s = \\p,c => np.s ! p ! c ++ bindComma ++ adv.s ; + } ; + -- : NP -> RS -> NP ; -- Paris, which is here RelNP np rs = np ** { - s = \\c => np.s ! c ++ bindComma ++ rs.s ! np.agr.p2 ! c ; - } ; + s = \\p,c => np.s ! p ! c ++ bindComma ++ rs.s ! np.agr.p2 ! c ; + } ; -- Determiners can form noun phrases directly. -- : Det -> NP ; - DetNP det = emptyNP ** { - s = det.sp ; + DetNP det = emptyNP ** det ** { + s = \\p => det.sp ; agr = ; } ; -- : CN -> NP ; MassNP cn = emptyNP ** { - s = \\c => cn.s ! Sg ! c ; + s = \\p,c => caseFromStem glue cn c Sg ++ -- TODO add possessors + cn.compl ! Sg ! c ; agr = ; } ; @@ -63,20 +88,27 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- quantifier and an optional numeral can be discerned. -- : Quant -> Num -> Det ; - DetQuant quant num = quant ** num ** { - s = \\c => case of { - => [] ; -- don't output "a 2 cars" - _ => quant.s ! num.n ! c } - ++ num.s ! Attrib ; -- TODO: add inflection table in numbers - sp = \\c => quant.sp ! num.n ! c - ++ num.s ! Indep ; - } ; + DetQuant quant num = let n = num2number num.n in + quant ** num ** { + s = \\c => case of { + => [] ; -- don't output "a 2 cars" + _ => quant.s ! n ! c } + ++ num.s ! Attrib ; -- TODO: add inflection table in numbers + sp = \\c => case of { + => [] ; + _ => quant.sp ! n ! c } + ++ num.s ! Indep ; + n = n ; + dt = qt2dt quant.qt ; + } ; -- : Quant -> Num -> Ord -> Det ; -- these five best DetQuantOrd quant num ord = - let theseFive = DetQuant quant num in theseFive ** { - s = \\c => theseFive.s ! c ++ ord.s ! num.n ; - sp = \\c => theseFive.sp ! c ++ ord.s ! num.n ; + let theseFive = DetQuant quant num ; + n = num2number num.n ; + in theseFive ** { + s = \\c => theseFive.s ! c ++ ord.s ! n ! Nom ; + sp = \\c => theseFive.sp ! c ++ ord.s ! n ! Nom ; } ; -- Whether the resulting determiner is singular or plural depends on the @@ -87,17 +119,16 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- the inherent number. NumSg = baseNum ; - NumPl = baseNum ** {n = Pl} ; + NumPl = baseNum ** {n = NoNum Pl} ; -- : Card -> Num ; NumCard card = card ** { - n = Sg -- Numerals take noun in Sg: e.g. öt város, literally 'five city' + n = IsNum -- Numerals take noun in Sg: e.g. öt város, literally 'five city' } ; -- : Digits -> Card ; NumDigits dig = dig ** { s = \\place => dig.s ! NCard ; - numtype = IsNum ; } ; -- : Numeral -> Card ; @@ -117,7 +148,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -} -- : A -> Ord ; OrdSuperl a = { - s = a.s ! Superl ; + s = \\n,c => + let adj : Noun = (a ** {s = a.s ! Superl}) in + caseFromStem glue adj c n ; n = Sg -- ?? is this meaningful? } ; @@ -127,32 +160,33 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- OrdNumeralSuperl num a = num ** { } ; -- : Quant - DefArt = { + DefArt = mkQuant "a" "a" ** { s, sp = \\_,_ => pre {"a" ; "az" / v } ; - isIndefArt = False ; - objdef = Def ; + qt = DefQuant ; } ; -- : Quant - IndefArt = { - s, - sp = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; - isIndefArt = True ; - objdef = Indef ; + IndefArt = mkQuant "egy" [] ** { + s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; + sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ; + qt = IndefArticle ; } ; -- : Pron -> Quant - -- PossPron pron = - -- let p = pron.poss ; - -- in DefArt ** { - -- } ; + PossPron pron = pron ** { + s,sp = \\_ => pron.s ; + qt = QuantPoss (agr2pstem pron.agr) ; + caseagr = False ; + } ; --2 Common nouns -- : N -> CN -- : N2 -> CN ; - UseN,UseN2 = \n -> n ; + UseN,UseN2 = \n -> n ** { + compl = \\_,_ => [] ; + } ; -- : N2 -> NP -> CN ; -- ComplN2 n2 np = @@ -169,18 +203,20 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : AP -> CN -> CN AdjCN ap cn = cn ** { - s = \\n,c => ap.s ! Sg ++ cn.s ! n ! c ++ ap.compar + s = \\nc => ap.s ! Sg ! Nom ++ cn.s ! nc ; + compl = \\n,c => ap.compl ! n ++ cn.compl ! n ! c ; } ; -- : CN -> RS -> CN ; RelCN cn rs = cn ** { - s = \\n,c => cn.s ! n ! c ++ rs.s ! n ! c + compl = \\n,c => cn.compl ! n ! c ++ rs.s ! n ! c } ; -- : CN -> Adv -> CN ; - AdvCN cn adv = cn ** { - s = \\n,c => cn.s ! n ! c ++ adv.s - } ; + AdvCN cn adv = case adv.isPre of { + True => AdjCN (invarAP adv.s) cn ; + False => cn ** {compl = \\n,c => cn.compl ! n ! c ++ adv.s} + } ; -- Nouns can also be modified by embedded sentences and questions. -- For some nouns this makes little sense, but we leave this for applications @@ -195,14 +231,15 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : CN -> NP -> CN ; -- city Paris (, numbers x and y) ApposCN cn np = cn ** { - s = \\n,c => cn.s ! n ! c ++ np.s ! Nom + compl = \\n,c => cn.compl ! n ! c ++ np.s ! NoPoss ! Nom } ; --2 Possessive and partitive constructs -- : PossNP : CN -> NP -> CN ; -- PossNP cn np = cn ** { - -- } ; + -- compl = \\n,c => cn.compl ! n ! c ++ np.s ! Poss P3 n ! c -- TODO check + -- } ; -- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples -- PartNP cn np = cn ** { diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 40acfc2aa..5b08fb429 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -1,7 +1,7 @@ resource NounMorphoHun = ParamHun ** open Prelude, Predef in { oper - Noun = {s : Number => Case => Str} ; + Noun = {s : NumCaseStem => Str ; h : Harm} ; -- Paradigm functions -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf @@ -12,32 +12,17 @@ oper -- Apply mkNoun to the lengthened stem "almá" or "kefé" nAlmá : Noun = mkNoun almá ; - in {s = \\n,c => case of { + in nAlmá ** { + s = \\nc => case nc of { -- Singular nominative uses the given form, e.g. "alma" or "kefe" - => alma ; + SgNom => alma ; + + PossdSg_PossrP3 => almá + "j" ; -- The rest of the forms are formed with the regular constructor, -- using "almá" or "kefé" as the stem. - _ => nAlmá.s ! n ! c - } ; - } ; - - -- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural - -- No special case here - dMadár : (nom : Str) -> (acc : Str) -> Noun = \madár,madarat -> - let madara = init madarat ; - nMadara = mkNounHarm (getHarm madara) "k" madara ; - nMadár = mkNoun madár ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc use the "madara"/"neve" stem - | => nMadara.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "madár"/"név" as the stem. - _ => nMadár.s ! n ! c - - } ; - } ; + _ => nAlmá.s ! nc } + } ; --Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. --Also handles "tó, hó" which are "tavak, havak" in plural! @@ -48,18 +33,52 @@ oper nLov = mkNoun lov ; nLova = mkNoun lova ; nLó = mkNoun ló ; - in {s = \\n,c => case of { + in nLova ** { + s = \\nc => case nc of { - -- All plural forms and Sg Acc, Sg Sup use the "lova" stem - | => nLova.s ! n ! c ; - => nLov.s ! n ! c ; + -- All plural forms and Sg Acc use the "lova" stem + PlStem | SgAccStem + => nLova.s ! nc ; - -- The rest of the forms are formed with the regular constructor, - -- using "ló" as the stem. - _ => nLó.s ! n ! c + SgSup | -- Sg Sup has vowel o/ö, not a/e + PossdSg_PossrP3 -- Consonant stem before P3 suffixes + => nLov.s ! nc ; + + PossdSg_PossrPl1 -- Round vowel, part of Pl1 suffix + => lov + harm "u" "ü" ! nLov.h ; + + PossdPl => lova + "i" ; + + -- The rest of the forms are formed with the regular constructor, + -- using "ló" as the stem. + _ => nLó.s ! nc } + } ; + + -- NB. Relevant arguments are Sg Nom, Pl Nom. + -- Third argument prevents accidental application of this paradigm + -- handles words like: falu, daru, tetű -> falvak, darvak, tetvek + dFalu : (nomsg,_,nompl : Str) -> Noun = \falu,_,falvak -> + let falva = init falvak ; + nFalva = mkNoun falva ; + nFalu = mkNoun falu ; + in nFalu ** { + s = \\nc => case nc of { + + -- All plural forms use the "falva" stem + PlStem => nFalva.s ! nc ; + + -- The plural morpheme before possessive suffixes is i + PossdPl => nFalu.s ! nc + "i" ; + + -- The form before P3 possessive suffixes: faluj|a, faluj|uk + -- Forms before other possessive suffixes follow SgAccStem. + PossdSg_PossrP3 => nFalu.s ! nc + "j" ; + + -- The rest of the forms are formed with the regular constructor, + -- using "falu" as the stem. + _ => nFalu.s ! nc } + } ; - } ; - } ; --Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) --More examples: "ajak, bokor, cukor, csokor, eper, fészek, fodor, gödör, haszon, iker, izom, kölyök, köröm, méreg, piszok, sarok, selyem, szeder, szobor, takony, terem, titok, torok, torony, tükör, vödör" -> @@ -72,64 +91,261 @@ oper majm = init majmo ; nMajmo = mkNoun majmo ; nMajom = mkNoun majom ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - | => nMajmo.s ! n ! c ; - => nMajmo.s ! n ! c ; + o = last (init majom) ; + in nMajmo ** { + s = \\nc => case nc of { - -- The rest of the forms are formed with the regular constructor, - -- using "majom" as the stem. - _ => nMajom.s ! n ! c - } ; - } ; + -- All plural forms and Sg Acc use the "majmo" stem + PlStem | SgAccStem => nMajmo.s ! nc ; + + -- Sg Sup uses the same majm* stem, but vowel can be different: + -- sátor, sátrat -> sátron, not *sátran + -- vászon, vásznat -> vásznon, not *vásznan + SgSup => majm + o + "n" ; + + -- The plural morpheme before possessive suffixes: majmai + PossdPl => majm + harm "a" "e" ! nMajmo.h + "i" ; + + -- The form before P3 possessive suffixes: majm|a, majm|uk + -- Forms before other possessive suffixes follow SgAccStem. + PossdSg_PossrP3 => majm ; + + -- The rest of the forms are formed with the regular constructor, + -- using "majom" as the stem. + _ => nMajom.s ! nc + } + } ; + + + -- Handles regular wovel ending words, with j added in possesive forms + -- Examples: "hajó, hajója, zseni, zsenije, kestyű, kestyűje" + dHajó : (nom : Str) -> (acc : Str) -> Noun = \hajó,hajót -> + let nHajó = mkNoun hajó ; + hajój = hajó + "j" ; + h = nHajó.h ; + in nHajó ** { + s = \\nc => case nc of { + -- hajó|nk, zseni|nk + PossdSg_PossrPl1 => hajó ; + -- hajój|a, zsenij|e + PossdSg_PossrP3 => hajój ; + + PossdPl => case hajó of { + _ + "i" => hajój + harm "a" "e" ! h + "i" ; -- zsenij|ei + _ => hajó + "i" } ; -- hajó|i + + -- The rest of the forms are formed with the regular constructor + _ => nHajó.s ! nc + } + } ; + + -- Opposite to dVirág: unexpected j after consonant + dPlafon : (nom : Str) -> (acc : Str) -> Noun = \plafon,plafont -> + let nPlafon = regNounNomAcc plafon plafont ; + h = nPlafon.h ; + in nPlafon ** { + s = \\nc => case nc of { + PossdSg_PossrPl1 => plafon + harm "u" "ü" ! h ; + PossdSg_PossrP3 => plafon + "j" ; + PossdPl => plafon + harm "jai" "jei" ! h ; + _ => nPlafon.s ! nc + } + } ; + + -- Opposite to dPlafon: regular paradigm puts j, but these words don't have it. + dVirág : (nom : Str) -> (acc : Str) -> Noun = \virág,virágot -> + let nVirág = regNounNomAcc virág virágot ; + h = nVirág.h ; + in nVirág ** { + s = \\nc => case nc of { + PossdSg_PossrPl1 => virág + harm "u" "ü" ! h ; + PossdSg_PossrP3 => virág ; + PossdPl => virág + harm "a" "e" ! h + "i" ; + _ => nVirág.s ! nc } + } ; + + -- Handles many possesive forms + dToll : (nom : Str) -> (acc : Str) -> Noun = \toll,tollat -> + let tolla = init tollat ; + nTolla = mkNoun tolla ; + nToll = mkNoun toll ; + napj = case andB (ifTok Bool toll tolla True False) + (notB (vowFinal tolla)) of { + True => toll ; -- sör, sör|t -> sör|e + -- király, király|t -> király|a + -- NB. plafon, papír with dPlafon + False => case tolla of { + -- hegy, hegy|et -> hegy|e + _ + ("ty"|"gy"|"ny"|"j"|"ly"|"m"|"h") + + ("e"|"a"|"ö"|"o") => init tolla ; + + -- ház, ház|at -> ház|a + _ + #c + ("a"|"e") => init tolla ; + + -- orr, orr|ot -> orr|a + -- TODO fails for gyümölcs, gyümölcs|öt -> gyümölcs|e + -- I don't know what this list means /IL + _ + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny" + |"ssz"|"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") + + ("o"|"ö") => init tolla ; + + -- nap, nap|ot -> napj|a + -- bank, bank|ot -> bankj|a + -- kabát, kabát|ot -> kabátj|a (diák, barát, újság …) + -- NB. virág, ország with dVirág (virág|ot -> virág|a) + _ + #c + ("o"|"ö") => init tolla + "j" ; + + -- háború, háború|t -> háborúj|a + _ => tolla + "j" } + } ; + in nTolla ** { + s = \\nc => case nc of { + -- All plural forms and Sg Acc use the "tolla" stem + PlStem | SgAccStem => nTolla.s ! nc ; + + PossdSg_PossrPl1 => napj + harm "u" "ü" ! nToll.h ; + + PossdSg_PossrP3 => napj ; + + -- The plural morpheme before possessive suffixes: madarai + PossdPl => napj + harm "a" "e" ! nToll.h + "i" ; + + -- The rest of the forms are formed with the regular constructor, + -- using "toll" as the stem. + _ => nToll.s ! nc + } + } ; + + -- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural. + dMadár : (nom : Str) -> (acc : Str) -> Noun = \madár,madarat -> + let madara = init madarat ; + madar = init madara ; + nMadara = mkNoun madara ; + nMadár = mkNoun madár ; + in nMadara ** { + s = \\nc => case nc of { + -- All plural forms and Sg Acc use the "tolla" stem + PlStem | SgAccStem => nMadara.s ! nc ; + + PossdSg_PossrPl1 => madar + harm "u" "ü" ! nMadara.h ; + + PossdSg_PossrP3 => madar ; + + -- The plural morpheme before possessive suffixes: madarai + PossdPl => madara + "i" ; + + -- The rest of the forms are formed with the regular constructor, + -- using "toll" as the stem. + _ => nMadár.s ! nc + } + } ; -- More words not covered by current paradigms: -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf - -- TODO: falu ~ falva-k (v-case) -- TODO: teher ~ terhet (consonant-crossing) - -- TODO: do we need possessive forms? e.g. fiú ~ fia{m,d,tok} - -- regNoun is a /smart paradigm/: it takes one or a couple of forms, + -- Worst case constructor: takes all stems + worstCaseNoun : (x1,_,_,_,_,_,_,x8 : Str) -> Harm -> Noun = + \nomsg,accsg,supsg,allsg,nompl,possdSg_possrP3sg,possdSg_PossrPl1,possdPl,h -> + let sgstem = tk 3 allsg ; -- remove -hoz/hez/höz + sginsstem : Str = case vowFinal sgstem of { + True => sgstem + "v" ; + False => duplicateLast sgstem } ; + in {s = table { + SgNom => nomsg ; + SgSup => supsg ; + SgAll => allsg ; + SgStem => sgstem ; + SgAccStem => init accsg ; -- remove t; same stem used for other forms + SgInsStem => sginsstem ; + PlStem => nompl ; + PossdSg_PossrP3 => init possdSg_possrP3sg ; -- remove -a/e + PossdSg_PossrPl1 => tk 2 possdSg_PossrPl1 ; -- remove -nk + PossdPl => possdPl } ; + h = h ; + } ; + + + -- All regNoun* are /smart paradigms/: they take one or a couple of forms, -- and decides which (non-smart) paradigm is the most likely to match. -regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> - case of { - -- alma, almát - <_ + "a", _ + "át"> - |<_ + "e" ,_ + "ét"> => dAlma n a ; + regNoun4 : (nomsg, accsg, nompl, possdSg_possrP3sg : Str) -> Noun = + \nsg,asg,npl,possd -> case possd of { + _ + #v + "j" + ("a"|"e") => dHajó nsg asg ; + _ + #c + "j" + ("a"|"e") => dPlafon nsg asg ; + + _ + #c + ("a"|"e") => dVirág nsg asg ; - <_ + "á" + #c, -- madár, madarat - _ + "a" + #c + #v + "t"> + -- Fall back to 3-argument smart paradigm + _ => regNounNomAccPl nsg asg npl + } ; - |<_ + "é" + #c, -- név, nevet - _ + "e" + #c + #v + "t"> + regNounNomAccPl : (nomsg, accsg, nompl : Str) -> Noun = \nsg,asg,npl -> + case of { + <_ + ("u"|"ú"|"ü"|"ű"|"ó"), -- falu, falut, falvak ; szó, szót, szavak + _ + ("u"|"ú"|"ü"|"ű"|"ó") + "t", + _ + "v" + #v + "k"> => dFalu nsg asg npl ; - |<_ + "í" + #c, -- víz, vizet - _ + "i" + #c + #v + "t"> => dMadár n a ; + -- Fall back to 2-argument smart paradigm + _ => regNounNomAcc nsg asg + } ; + regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> + case of { - <_ + #v + #c, -- majom, majmot - _ + #c + #v + "t"> => dMajom n a ; + -- Stem 1: Sg Nom + -- Stem 2: Everything else + -- alma, almát + <_ + "a", _ + "át"> + |<_ + "e" ,_ + "ét"> => dAlma n a ; + -- Stem 1: Sg Nom + -- Stem 2: Sg Gen, Sg Sup, Pl * + <_ + #c + #shortv + #c, -- majom, majmot + _ + #c + #c + #shortv + "t"> => dMajom n a ; - <_ + "ó", -- ló, lovat - _ + "o" + #c + #v + "t"> + -- Stem 1: Sg Nom + -- Stem 2: Sg Sup + -- Stem 3: Sg Gen, Pl * + <_ + "ó", -- ló, lovat + _ + "o" + #c + #v + "t"> - |<_ + "ő", -- kő, követ - _ + "ö" + #c + #v + "t"> + |<_ + "ó", -- tó, tavat + _ + "a" + #c + #v + "t"> - |<_ + "é", -- lé, levet - _ + "e" + #c + #v + "t"> => dLó n a ; + |<_ + "ő", -- kő, követ + _ + "ö" + #c + #v + "t"> - _ => mkNoun n - } ; + |<_ + "ű", -- fű, füvet + _ + "ü" + #c + #v + "t"> + |<_ + "é", -- lé, levet + _ + "e" + #c + #v + "t"> => dLó n a ; + + -- Stem 1 == Stem 2 == Stem 3 + -- j in PossdSg_PossrP3 but not elsewhere: gumi -> gumi|nk, gumij|a + <_ + "i", -- gumi, gumit: + _ + "it"> => dHajó n a ; + + -- Stem 1: Sg Nom, Sg * - [Gen] + -- Stem 2: Sg Gen, Pl * + <_ + "á" + #c, _ + "a" + #c + "at"> + |<_ + "é" + #c,_ + "e" + #c + ("et"|"at")> => dMadár n a ; + + _ => dToll n a + } ; + + -- 1-argument smart paradigm + -- Here we guess the genitive form and give it to appropriate 2-arg paradigm regNoun : Str -> Noun = \sgnom -> case sgnom of { _ + ("a"|"e") => dAlma sgnom (lengthen sgnom + "t") ; - #c + ("á"|"é") + #c => mkNoun sgnom ; - _ + ("á"|"é") + #c => dMadár sgnom (név2nevet sgnom) ; - _ + ("ó"|"é"|"ő"|"ű") => dLó sgnom (ló2lovat sgnom) ; - _ + #v + #c + #v + #c => dMajom sgnom (majom2majmo sgnom); + -- Words like nyár, név need to use 2-arg smart paradigm + (#c|"")+("á"|"é")+ #c => mkNoun sgnom ; + _ + ("ság"|"ség"|"gás"|"gés") -- source: https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Nouns + => mkNoun sgnom ; + _ + ("á"|"é") + #c => dToll sgnom (név2nevet sgnom) ; +-- _ + ("ó"|"é"|"ő"|"ű") => dLó sgnom (ló2lovat sgnom) ; +-- _ + #v + #c + #v + #c => dMajom sgnom (majom2majmo sgnom); _ => mkNoun sgnom -- Fall back to the regular paradigm } where { név2nevet : Str -> Str = \név -> @@ -158,12 +374,10 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> } ; --TODO: Special cases (enter these words manually to not complicate the paradigms): ---dTó: szó special case which fulfills the plural cases but not the or case ("szót" not "szavat") --dLó: special case "lén" not "leven" ---dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting + --endCaseConsAcc: "falat, fület, várat, könnyet", --also special in superessive case "falon, fülek, vizen" ---pattern matching in regNoun: one-syllable words that in fact belong to dMadár: "nyár, név" -------------------------------------------------------------------------------- -- Following code by EG in 2009 (?), comments and some additions by IL 2020 @@ -176,12 +390,24 @@ oper -- Vowels as a pattern. v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; + shortv : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü") ; + + back : pattern Str = #("a" | "á" | "o" | "ó" | "u" | "ú") ; + + front_rounded : pattern Str = #("ö" | "ő" | "ü" | "ű") ; + + -- front and back rounded + -- rounded : pattern Str = #("ö" | "ő" | "ü" | "ű" | "o" | "ó" | "u" | "ú") c : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"| "n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"z"| "cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs"| "dzs") ; + dupl : pattern Str = #("bb"|"cc"|"dd"|"ff"|"gg"|"hh"|"jj"|"kk"|"ll"|"mm"| + "nn"|"pp"|"qq"|"rr"|"ss"|"tt"|"vv"|"ww"|"xx"|"zz"| + "ddzs"|"ccs"|"ddz"|"ggy"|"lly"|"nny"|"ssz"|"tty"|"zzs") ; + -- Only single consonants unigraph : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"| "n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"z") ; @@ -194,14 +420,15 @@ oper duplicateLast : Str -> Str = \str -> case str of { x + "dzs" => x + "ddzs" ; - x + "ny" => x + "nny" ; -- takony : takonnyal x + "cs" => x + "ccs" ; x + "dz" => x + "ddz" ; x + "gy" => x + "ggy" ; x + "ly" => x + "lly" ; + x + "ny" => x + "nny" ; x + "sz" => x + "ssz" ; x + "ty" => x + "tty" ; x + "zs" => x + "zzs" ; + x + #dupl => str ; -- Don't duplicate already long consonant -- Base case: just duplicate the single letter x + s@? => x + s + s } ; @@ -221,7 +448,7 @@ oper x + "u" => x + "ú" ; x + "ö" => x + "ő" ; x + "ü" => x + "ű" ; - _ => Predef.error "Lengthening not applicable to" ++ str + _ => str -- Lengthening not applicable to str } ; shorten : Str -> Str = \str -> case str of { @@ -232,13 +459,13 @@ oper x + "ú" => x + "u" ; x + "ő" => x + "ö" ; x + "ű" => x + "ü" ; - _ => Predef.error "Shortening not applicable to" ++ str + _ => str -- Shortening not applicable to str } ; -- Function to get a harmony from a string getHarm : Str -> Harm = \s -> case s of { - _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; - _ + ("ö" | "ő" | "ü") + _ => H_o ; + _ + #back + _ => H_a ; + _ + #front_rounded + (#c|"") + (#c|"") => H_o ; _ => H_e } ; @@ -255,48 +482,33 @@ oper harm1 : Str -> HarmForms = \i -> harm i i ; -- Variant of case forms when the noun stem ends in consonant. - endCaseCons : Case -> HarmForms = \c -> case c of { - Nom => harm1 [] ; - Acc => harm3 "ot" "et" "öt" ; - Dat => harm "nak" "nek" ; - Ill => harm "ba" "be" ; - Ine => harm "ban" "ben" ; - Ela => harm "ból" "ből" ; - All => harm3 "hoz" "hez" "höz" ; - Ade => harm "nál" "nél" ; - Abl => harm "tól" "től" ; - Sub => harm "ra" "re" ; - Sup => harm3 "on" "en" "ön" ; - Del => harm "ról" "ről" ; - Cau => harm1 "ért" ; - Ins => harm "al" "el" ; - Tra => harm "á" "é" - -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' - -- Ter => harm1 "ig" ; -- Terminative 'as far as ' - -- For => harm1 "ként" ; -- Formal 'as ' - -- Tem => harm1 "kor" -- Temporal 'at '. Only used with numerals. + endCaseCons : NumCaseStem -> HarmForms = \c -> case c of { + SgSup => harm3 "on" "en" "ön" ; + SgAccStem => harm3 "o" "e" "ö" ; + SgAll => harm3 "hoz" "hez" "höz" ; + PossdPl => harm1 "i" ; -- TODO figure out allomorphs + _ => harm1 [] } ; + -- Variant where accusative has the allomorph -at - endCaseConsAccAt : Case -> HarmForms = \c -> case c of { - Acc => harm3 "at" "et" "öt" ; + endCaseConsAccAt : NumCaseStem -> HarmForms = \c -> case c of { + SgAccStem => harm3 "a" "e" "ö" ; _ => endCaseCons c } ; -- Variant where accusative has the allomorph -t for consonants -- Examples: "pénz, bor, orr, szín, lány, kés, dal" - endCaseConsAcc : Case -> HarmForms = \c -> case c of { - Acc => harm1 "t" ; + endCaseConsAcc : NumCaseStem -> HarmForms = \c -> case c of { + SgAccStem => harm1 "" ; _ => endCaseCons c } ; -- Variant of case forms when the noun stem ends in vowel. - endCaseVow : Case -> HarmForms = \c -> case c of { - Acc => harm1 "t" ; - Sup => harm1 "n" ; - Ins => harm "val" "vel" ; - Tra => harm "vá" "vé" ; - + endCaseVow : NumCaseStem -> HarmForms = \c -> case c of { + SgAccStem => harm1 "" ; + SgSup => harm1 "n" ; + SgInsStem => harm1 "v" ; -- Other forms are shared with endCaseCons. _ => endCaseCons c } ; @@ -323,38 +535,68 @@ oper mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = mkNounHarmAcc True ; mkNounHarmAcc : (useAt : Bool) -> Harm -> (plural : Str) -> Str -> Noun = \useAt,h,plural,w -> - let endCaseSg : Case -> HarmForms = case of { - <_,_ + #v> => endCaseVow ; - <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j" - |"ly"|"l"|"r"|"n"|"ny"|"ssz"|"zz" - |"ss"|"ll"|"rr"|"nn"|"ns"|"nsz" - |"nz")> => endCaseConsAcc ; - => endCaseConsAccAt ; - _ => endCaseCons } ; - endCasePl : Case -> HarmForms = case of { - <"ak",_> => endCaseConsAccAt ; - <_,True> => endCaseConsAccAt ; - _ => endCaseCons } ; + let endCaseSg : NumCaseStem -> HarmForms = + case of { + <_,_ + #v> => endCaseVow ; + <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny"|"ssz" + |"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz")> => endCaseConsAcc ; + => endCaseConsAccAt ; + _ => endCaseCons } ; + -- Last consonant doubles before instrumental and translative duplConsStem : Str = case vowFinal w of { True => w ; False => duplicateLast w } ; - -- Noun is {s : Number => Case => Str}, we construct nested tables. - in {s = table { - Sg => table { - -- Double the last letter (if consonant) before Ins, Tra - c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; - c@_ => w + endCaseSg c ! h } ; + -- Noun is {s : NumCaseStem => Str} + in {h = h ; + s = table { + -- Before Sg Ins, Tra: + -- * Double the last letter if consonant + -- * Add v if vowel (comes from endCaseSg) + SgInsStem => duplConsStem + endCaseSg SgInsStem ! h ; - Pl => table { - -- Double the plural k before Ins, Tra - c@(Ins|Tra) => w + plural + "k" + endCasePl c ! h ; + -- endCaseCons, because we only use -k as plural morpheme. + -- Possessive forms with allomorph -i are handled separately. + PlStem => w + plural ; - -- endCaseCons, because we only use -k as plural morpheme. - -- If we add possessive forms with allomorph -i, then revise. - c@_ => w + plural + endCasePl c ! h } - } - } ; + -- All other singular forms and stems + c => w + endCaseSg c ! h } ; + + } ; + + +-- This is used in ResHun.caseFromStem, which makes NP out of CN. +-- Ns only have stems, and these forms are attached to the stems. + + endCase : Case -> HarmForms = \c -> case c of { + Nom => harm1 [] ; + Acc => harm "at" "et" ; -- NB. this is only used for plural acc! + Dat => harm "nak" "nek" ; + Ade => harm "nál" "nél" ; + Sup => harm3 "on" "en" "ön" ; + Ine => harm "ban" "ben" ; + Ela => harm "ból" "ből" ; + Ins => harm "al" "el" ; + Tra => harm "á" "é" ; + All => harm3 "hoz" "hez" "höz" ; + Abl => harm "tól" "től" ; + Sub => harm "ra" "re" ; + Del => harm "ról" "ről" ; + Cau => harm1 "ért" ; + Ill => harm "ba" "be" + -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' + -- Ter => harm1 "ig" ; -- Terminative 'as far as ' + -- For => harm1 "ként" ; -- Formal 'as ' + -- Tem => harm1 "kor" -- Temporal 'at '. Only used with numerals. + } ; + + endCasePossVow : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + Sup => harm1 "n" ; + Tra => harm "vá" "vé" ; + Ins => harm "val" "vel" ; + _ => endCase c + } ; } diff --git a/src/hungarian/NounMorphoHunOneArgument.gf b/src/hungarian/NounMorphoHunOneArgument.gf deleted file mode 100644 index 979b63269..000000000 --- a/src/hungarian/NounMorphoHunOneArgument.gf +++ /dev/null @@ -1,361 +0,0 @@ -resource NounMorphoHunOneArgument = ParamHun ** open Prelude, Predef in { - -oper - Noun = {s : Number => Case => Str} ; - - -- Paradigm functions - -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf - - -- Words like "alma, kefe, apa, anya, fa": - dAlma : Str -> Noun = \alma -> - let almá : Str = lengthen alma; - - nAlmá : Noun = mkNoun almá ; - in {s = \\n,c => case of { - -- Singular nominative uses the given form, e.g. "alma" or "kefe" - => alma ; - - -- The rest of the forms are formed with the regular constructor, - -- using "almá" or "kefé" as the stem. - _ => nAlmá.s ! n ! c - } ; - } ; - --- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural --- No special case here --- dMadár: "víz" has wovel shortening but "vizek" not "vizik", implement differently? -dMadár : Str -> Noun = \madár -> - let r = last madár ; - madá = init madár ; - mada = shorten madá ; -- shortens vowels - a = last mada ; - a = case a of { - "e"|"i" => "e" ; - a => a - } ; - madara = mada + r + a ; - nMadara = mkNounHarm (getHarm madara) "k" madara ; - nMadár = mkNoun madár ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc use the "madara"/"neve" stem - | => nMadara.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "madár"/"név" as the stem. - _ => nMadár.s ! n ! c - - } ; - } ; - ---Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. --- "lovon" instead of "lón" fixed but that gives the following problems: -dLó : Str -> Noun = \ló -> - let lo = shorten ló ; - lov = lo + "v" ; - ak : Str = case ló of { - _ + ("ö" | "ő") => "ek" ; - _ + ("o" | "ó") => "ak" ; - lé => shorten (last lé) + "k"} ; - harmonyPlural : Harm = case ló of { - _ + ("ö" | "ő") => H_e ; -- All plural allomorphs have E harmony, singular ones have O. - _ + ("o" | "ó") => H_a ; - lé => getHarm (lé)} ; - nLov = mkNounHarm harmonyPlural ak lov ; - nLó = mkNoun ló ; - in {s = \\n,c => case of { - - -- All plural forms and Sg Acc, Sg Sup use the "lov" stem - | | => nLov.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "ló" as the stem. - _ => nLó.s ! n ! c - - } ; - } ; - ---Handles words like "tó, hó"" which are "tavak, havak" in plural. ---(Since I only have these examples for now I do a simplified case with ó, a) --- "tavon" instead of "tón" case fixed, works automatically with the Sup rules -dTó : Str -> Noun = \tó -> - let t = init tó ; - tav = t + "av" ; - nTav = mkNounHarm H_a "ak" tav ; - nTó = mkNoun tó ; - in {s = \\n,c => case of { - - -- All plural forms and Sg Acc use the "tav" stem - || => nTav.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "tó" as the stem. - _ => nTó.s ! n ! c - - } ; - } ; - ---Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) ---More examples: "ajak, bokor, cukor, csokor, eper, fészek, fodor, gödör, haszon, iker, izom, kölyök, köröm, méreg, piszok, sarok, selyem, szeder, szobor, takony, terem, titok, torok, torony, tükör, vödör" -> --- "ajkat, bokrot, cukrot, csokrot, epret, fészket, fodrot, gödröt, hasznot, ikret, izmot, kölyköt, körmet, mérget, piszkot, sarkot, selymet, szedret, szobrot, taknyot, termet, titkot, torkot, tornyot, tükröt, vödröt" --- case handled -dMajom : Str -> Noun = \majom -> - -- Str*Str is syntactic sugar for {p1 : Str ; p2 : Str} ; - -- confusing syntax: you can't write let : Str*Str = … - -- it has to be called something else, and then you - -- can get "tako" and "ny" with p1, p2. - let tako_ny : Str*Str = case majom of { - x + dzs@#trigraph => ; - x + zs@#digraph => ; - -- ? pattern matches exactly 1 character - x + s@? => } ; - tako = tako_ny.p1 ; - ny = tako_ny.p2 ; - - nyo = ny + last tako ; - tak = init tako ; - taknyo = tak + nyo ; - nMajmo = mkNounHarm (getHarm taknyo) "k" taknyo ; - nMajom = mkNoun majom ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - | | => nMajmo.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "majom" as the stem. - _ => nMajom.s ! n ! c - } ; - } ; - ---Handles words like "sátor, álom, alkalom, farok, halom, vászon" --- "sátrat, álmat, alkalmat, farkat, halmat, vásznat" --- (bátor not noun) -dFarok : Str -> Noun = \farok -> - let k = last farok ; - far = init (init farok) ; - fark = far + k ; - nFark = mkNounHarm (getHarm fark) "ak" fark ; - nFarok = mkNoun farok ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc and Sg Sup use the "fark" stem - | | => nFark.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "farok" as the stem. - _ => nFarok.s ! n ! c - } ; - } ; - --- More words not covered by current paradigms: --- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf --- TODO: falu ~ falva-k (v-case) --- TODO: teher ~ terhet (consonant-crossing) --- TODO: do we need possessive forms? e.g. fiú ~ fia{m,d,tok} - --- regNoun is a /smart paradigm/: it takes one or a couple of forms, --- and decides which (non-smart) paradigm is the most likely to match. -regNoun : Str -> Noun = \sgnom -> case sgnom of { - _ + "a"|"e" => dAlma sgnom ; - (? | #digraph | #trigraph) + ("á"|"é") + (? | #digraph | #trigraph) => mkNoun sgnom ; - _ + ("á"|"é") + ? => dMadár sgnom ; - _ + "é"|"ő"|"ű" => dLó sgnom ; - _ + "ó" => dTó sgnom ; - _ + "alom" => dFarok sgnom ; - _ + "elem" => dMajom sgnom ; - - -- TODO: more non-smart paradigms + more pattern matching - -- TODO: smart paradigms with >1 form. Which forms are the most descriptive? - - _ => mkNoun sgnom -- Fall back to the regular paradigm -} ; - ---TODO: Special cases (enter these words manually to not complicate the paradigms): ---dTó: szó special case which fulfills the plural cases but not the or case ("szót" not "szavat") ---dLó: special case "lén" not "leven" ---dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting ---endCaseConsAcc: "falat, fület, várat, könnyet", ---also special in superessive case "falon, fülek, vizen" ---pattern matching in regNoun: one-syllable words that in fact belong to dMadár: "nyár, név" ---------------------------------------------------------------------------------------------- --- Following code by EG in 2009 (?), comments and some additions by IL 2020 - -param - -- Harmony types - Harm = H_a | H_e | H_o ; - -oper - - -- Vowels as a pattern. - v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | - "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; - -- Digraphs - digraph : pattern Str = #("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") ; - - -- Trigraphs - trigraph : pattern Str = #("dzs") ; - - duplicateLast : Str -> Str = \str -> case str of { - x + "dzs" => x + "ddzs" ; - x + "ny" => x + "nny" ; -- takony : takonnyal - x + "cs" => x + "ccs" ; - x + "dz" => x + "ddz" ; - x + "gy" => x + "ggy" ; - x + "ly" => x + "lly" ; - x + "sz" => x + "ssz" ; - x + "ty" => x + "tty" ; - x + "zs" => x + "zzs" ; - - -- Base cacse: just duplicate the single letter - x + s@? => x + s + s } ; - - -- Function to test if a string ends in a vowel - vowFinal : Str -> Bool = \str -> - case str of { - _ + #v => True ; -- Matching a string against a pattern. - _ => False - } ; - - lengthen : Str -> Str = \str -> case str of { - x + "a" => x + "á" ; - x + "e" => x + "é" ; - x + "i" => x + "í" ; - x + "o" => x + "ó" ; - x + "u" => x + "ú" ; - x + "ö" => x + "ő" ; - x + "ü" => x + "ű" ; - _ => Predef.error "Lengthening not applicable to" ++ str - } ; - - shorten : Str -> Str = \str -> case str of { - x + "á" => x + "a" ; - x + "é" => x + "e" ; - x + "í" => x + "i" ; - x + "ó" => x + "o" ; - x + "ú" => x + "u" ; - x + "ő" => x + "ö" ; - x + "ű" => x + "ü" ; - _ => Predef.error "Shortening not applicable to" ++ str - } ; - - -- Function to get a harmony from a string - getHarm : Str -> Harm = \s -> case s of { - _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; - _ + ("ö" | "ő" | "ü") + _ => H_o ; - _ => H_e - } ; - - -- Used as a table of allomorphs for a give case. - HarmForms : Type = Harm => Str ; - - -- Functions for constructing a HarmForms table. - harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> table { - H_a => a ; - H_e => e ; - H_o => o - } ; - harm : Str -> Str -> HarmForms = \a,e -> harm3 a e e ; - harm1 : Str -> HarmForms = \i -> harm i i ; - - -- Variant of case forms when the noun stem ends in consonant. - endCaseCons : Case -> HarmForms = \c -> case c of { - Nom => harm1 [] ; - Acc => harm3 "ot" "et" "öt" ; - Dat => harm "nak" "nek" ; - Ill => harm "ba" "be" ; - Ine => harm "ban" "ben" ; - Ela => harm "ból" "ből" ; - All => harm3 "hoz" "hez" "höz" ; - Ade => harm "nál" "nél" ; - Abl => harm "tól" "től" ; - Sub => harm "ra" "re" ; - Sup => harm3 "on" "en" "ön" ; - Del => harm "ról" "ről" ; - Cau => harm1 "ért" ; - Ins => harm "al" "el" ; - Tra => harm "á" "é" - -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' - -- Ter => harm1 "ig" ; -- Terminative 'as far as ' - -- For => harm1 "ként" ; -- Formal 'as ' - -- Tem => harm1 "kor" -- Temporal 'at '. Only used with numerals. - } ; - - -- Variant where accusative has the allomorph -at - endCaseConsAccAt : Case -> HarmForms = \c -> case c of { - Acc => harm3 "at" "et" "öt" ; - _ => endCaseCons c - } ; - - -- Variant where accusative has the allomorph -t for consonants - -- Examples: "pénz, bor, orr, szín, lány, kés, dal" - endCaseConsAcc : Case -> HarmForms = \c -> case c of { - Acc => harm1 "t" ; - _ => endCaseCons c - } ; - - -- Variant of case forms when the noun stem ends in vowel. - endCaseVow : Case -> HarmForms = \c -> case c of { - Acc => harm1 "t" ; - Sup => harm1 "n" ; - Ins => harm "val" "vel" ; - Tra => harm "vá" "vé" ; - - -- Other forms are shared with endCaseCons. - _ => endCaseCons c - } ; - - -- Function to return a plural allomorph given the stem (e.g. név, almá). - pluralAllomorph : (stem : Str) -> Str = pluralAllomorphLowStem False ; - - -- Function to return a plural allomorph given lowering stem or not - -- Examples of lowering stems: ág, ágy, ár, fal, fog, gyár, hal, has, hát, ház, hold, láz, lyuk, nyak, olaj, oldal, toll, ujj, vonal - -- Examples of lowering stems: férj, fej, hely, fül, könny, könyv, mell, szög - pluralAllomorphLowStem : (low : Bool) -> (stem : Str) -> Str = \low,stem -> - case of { - <_,True> => "k" ; - => harm "ak" "ek" ! getHarm stem ; - _ => harm3 "ok" "ek" "ök" ! getHarm stem - } ; - - - -- Harmony and plural allomorph read from the singular nominative - mkNoun : Str -> Noun = \w -> - mkNounHarm (getHarm w) (pluralAllomorph w) w ; - - -- Harmony and plural allomorph given explicitly (check if the True makes it bad) - mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = mkNounHarmAcc True ; - - mkNounHarmAcc : (useAt : Bool) -> Harm -> (plural : Str) -> Str -> Noun = \useAt,h,plural,w -> - let endCaseSg : Case -> HarmForms = case of { - <_,_ + #v> => endCaseVow ; - <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j" - |"ly"|"l"|"r"|"n"|"ny"|"ssz"|"zz" - |"ss"|"ll"|"rr"|"nn"|"ns"|"nsz" - |"nz")> => endCaseConsAcc ; - => endCaseConsAccAt ; - _ => endCaseCons } ; - endCasePl : Case -> HarmForms = case of { - <"ak",_> => endCaseConsAccAt ; - <_,True> => endCaseConsAccAt ; - _ => endCaseCons } ; - -- Last consonant doubles before instrumental and translative - duplConsStem : Str = case vowFinal w of { - True => w ; - False => duplicateLast w } ; - - -- Noun is {s : Number => Case => Str}, we construct nested tables. - in {s = table { - Sg => table { - -- Double the last letter (if consonant) before Ins, Tra - c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; - c@_ => w + endCaseSg c ! h } ; - - Pl => table { - -- Double the plural k before Ins, Tra - c@(Ins|Tra) => w + plural + "k" + endCasePl c ! h ; - - -- endCaseCons, because we only use -k as plural morpheme. - -- If we add possessive forms with allomorph -i, then revise. - c@_ => w + plural + endCasePl c ! h } - } - } ; - -} diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index da89f54f8..ed05e9859 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -18,8 +18,11 @@ oper --2 Nouns mkN : overload { - mkN : (sgnom : Str) -> N ; -- Predictable nouns from singular nominative. Accusative vowel is o for back harmony. No stem lowering (TODO better explanation/examples) - mkN : (sgnom : Str) -> (sggen : Str) -> N ; -- Singular nominative and accusative. Takes care of cases like … TODO example + mkN : (sgnom : Str) -> N ; -- Predictable nouns from singular nominative. Accusative vowel is o/ö, no stem lowering. Use: `mkN "nap"` for nap, napot. + mkN : (sgnom, sggen : Str) -> N ; -- Singular nominative and accusative. Use: `mkN "név" "nevet"` + mkN : (sgnom, sggen, plnom : Str) -> N ; -- Singular nominative, singular accusative, plural nominative. Use: `mkN "falu" "falut" "falvak"` + mkN : (sgnom, sggen, plnom, sgnom_possdSg3 : Str) -> N ; -- Singular nominative, singular accusative, plural nominative, singular nominative possessed by 3rd person singular. Use: `mkN "virág" "virágot" "virágok" "virága"` (would give "virágja" otherwise) + mkN : (férfi : Str) -> (harm : Harmony) -> (ak : Str) -> N ; -- Noun with unpredictable vowel harmony and plural allomorph } ; @@ -32,8 +35,9 @@ oper --2 Adjectives mkA : overload { - mkA : (adj : Str) -> A ; -- Regular adjective, given in ??? form - -- mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A. + mkA : (sgnom : Str) -> A ; -- Regular adjective, given in singular nominative + mkA : (sgnom, sgacc : Str) -> A ; -- Singular nominative and accusative + mkA : N -> A ; -- Adjective from a noun. mkN has more paradigms, so anything irregular goes via N. } ; mkA2 : overload { @@ -88,7 +92,7 @@ oper } ; prePrep : Str -> Case -> Prep -- Preposition - = \s,c -> lin Prep {pr=s ; s=[] ; c=c} ; + = \s,c -> lin Prep (ResHun.prepos c s) ; casePrep : Case -> Prep ; -- No postposition, only case @@ -99,7 +103,7 @@ oper -- lin Subj { } ; mkAdv : Str -> Adv - = \s -> lin Adv {s = s} ; + = \s -> lin Adv {s = s ; isPre=False} ; mkAdV : Str -> AdV = \s -> lin AdV {s = s} ; @@ -125,6 +129,15 @@ oper mkN : Str -> Str -> N = \n,a-> lin N (regNounNomAcc n a) ; + mkN : Str -> Str -> Str -> N = + \n,a,pln-> lin N (regNounNomAccPl n a pln) ; + + mkN : (x1,_,_,x4 : Str) -> N = + \n,a,pln,possd -> lin N (regNoun4 n a pln possd) ; + + mkN : (x1,_,_,_,_,_,_,x8 : Str) -> N = + \a,b,c,d,e,f,g,h -> lin N (worstCaseNoun a b c d e f g h (getHarm a)) ; + mkN : Str -> Harmony -> N = \s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ; @@ -145,25 +158,30 @@ oper } ; mkA = overload { - mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ; - -- mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda -> - -- jakda ** {s = \\af => kiga ++ jakda.s ! af} ; + mkA : (sgnom : Str) -> A = \s -> lin A (mkAdj s) ; + mkA : (sgnom,sgacc : Str) -> A = \nom,acc -> + lin A (mkAdj2 nom (regNounNomAcc nom acc)) ; + mkA : N -> A = \noun -> + let sgnom : Str = noun.s ! SgNom in + lin A (mkAdj2 sgnom noun) ; } ; mkA2 = overload { - mkA2 : A -> A2 = \a -> a ** {c2 = casePrep Nom} ; + mkA2 : A -> A2 = \a -> a ** {c2 = casePrep Nom ; isPost = False} ; mkA2 : Str -> Prep -> A2 = \s,p -> - lin A2 {s = (mkAdj s).s ; c2 = p} ; + lin A2 ((mkAdj s) ** {c2 = p ; isPost = False}) ; mkA2 : Str -> Case -> A2 = \s,c -> - lin A2 {s = (mkAdj s).s ; c2 = casePrep c} ; + lin A2 ((mkAdj s) ** {c2 = casePrep c ; isPost = False}) ; mkA2 : A -> Prep -> A2 = \a,p -> - lin A2 (a ** {c2 = p}) ; + lin A2 (a ** {c2 = p ; isPost = False}) ; } ; mkV = overload { mkV : (sg3 : Str) -> V = \v -> lin V (mkVerb v) ; -- mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** { -- s = \\vf => nore + hada.s ! vf} ; + mkV : (x1,_,_,_,_,_,x7 : Str) -> V = \sg1,sg2,sg3,pl1,pl2,pl3,inf -> + lin V (mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf) ; } ; copula = ResHun.copula ; @@ -182,13 +200,13 @@ oper mkPrep = overload { mkPrep : (e : Str) -> Prep - = \str -> lin Prep (ResHun.mkPrep str) ; + = \str -> lin Prep (ResHun.nomAdp str) ; mkPrep : Str -> Case -> Prep - = \str,c -> lin Prep (ResHun.mkPrep str ** {c = c}) ; + = \str,c -> lin Prep (ResHun.caseAdp c str) ; } ; casePrep : Case -> Prep - = \c -> lin Prep (ResHun.mkPrep [] ** {c = c}) ; + = \c -> lin Prep (ResHun.caseAdp c) ; -------------------------------------------------------------------------------- } diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 35d4e5ad8..911bac0a7 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -1,31 +1,109 @@ resource ParamHun = ParamX ** open Prelude in { +-------------------------------------------------------------------------------- +-- Generic + +oper + if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f -> + case p of {Pos => t ; Neg => f } ; + -------------------------------------------------------------------------------- -- Phonology -------------------------------------------------------------------------------- -- Morphophonology +-------------------------------------------------------------------------------- +-- Quant +param + QuantType = + IndefArticle -- Needed to prevent "a 2 cars" + | IndefQuant -- Not IndefArt, not poss, not def + | DefQuant + | QuantPoss PossStem -- Which possessive stem it takes + ; + + DetType = + DefDet -- distinction between Article and Other no longer needed + | IndefDet -- still need def or indef + | DetPoss PossStem -- Sill need to know which stem it takes if Poss + ; + + -- Singular stems. Plural is always same, no need to add here. + PossStem = dSg_rSg1P2 | dSg_rP3 Number | dSg_rPl1 ; + +oper + -- standard trick to prevent "a one car" + isIndefArt : {qt : QuantType} -> Bool = \quant -> + case quant.qt of { + IndefArticle => True ; + _ => False + } ; + + dt2objdef : DetType -> ObjDef = \dt -> case dt of { + IndefDet => Indef ; + _ => Def + } ; + + objdef2dt : ObjDef -> DetType = \od -> case od of { + Def => DefDet ; + Indef => IndefDet + } ; + + qt2dt : QuantType -> DetType = \qt -> case qt of { + QuantPoss x => DetPoss x ; + DefQuant => DefDet ; + _ => IndefDet + } ; + + agr2pstem : Person*Number -> PossStem = \pn -> + case of { + => dSg_rPl1 ; + => dSg_rP3 n ; + _ => dSg_rSg1P2 + } ; -------------------------------------------------------------------------------- -- Nouns param - Case = Nom | Acc | Dat - -- | PossStem -- TODO: Stem where possessive suffixes attach? - | Ill | Ine | Ela | All | Ade | Abl | Sub | Sup | Del -- Locatives - | Cau -- Causal-final 'for the purpose of, for the reason that' - | Ins -- Instrumental - | Tra -- Translative - -- | Ess | Ter | For - -- | Tem -- Temporal, e.g. hatkor ‘six o’clock’ (from hat ‘6’) - ; + NumCaseStem = + SgNom | SgAccStem | SgSup -- These may use 2-3 different stems + -- May have irregular vowel in suffix + | SgAll -- May have irregular vowel in suffix + | SgInsStem -- Instrumental and translative: -v after vowels + | SgStem -- Rest of the cases in Sg + | PlStem -- Rest of the cases in Pl + | PossdSg_PossrP3 -- Possessed item is Sg, possessor is Sg or Pl P3 + | PossdSg_PossrPl1 -- Possessed item is Sg, possessor is Pl P1 + | PossdPl -- Possessed item in plural, any possessor. + ; -- Rest of poss forms use SgAccStem + Case = + Nom | Acc | Dat +-- | Ill -- Locatives + | Ine + | Ela + | All + | Ade +-- | Abl +-- | Sub + | Sup +-- | Del +-- | Cau -- Causal-final 'for the purpose of, for the reason that' + | Ins -- Instrumental + | Tra -- Translative + -- | Ess | Ter | For + -- | Tem -- Temporal, e.g. hatkor ‘six o’clock’ (from hat ‘6’) + ; + SubjCase = SCNom | SCDat ; -- Limited set of subject cases + Possessor = NoPoss | Poss Person Number ; + oper caseTable : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Case=>Str = @@ -33,18 +111,18 @@ oper Nom => n ; Acc => a ; Dat => d ; - Ill => il ; + Ins => ins ; + Tra => tra ; + Sup => sup ; Ine => ine ; Ela => el ; All => al ; Ade => ad ; Abl => ab ; Sub => sub ; - Sup => sup ; Del => del ; - Cau => ca ; - Ins => ins ; - Tra => tra } ; + Ill => il ; + Cau => ca } ; sc2case : SubjCase -> Case = \sc -> case sc of { @@ -52,6 +130,45 @@ oper SCDat => Dat } ; + case2str : Case -> Str = \c -> case c of { + Nom => "Nom" ; + Acc => "Acc" ; + Dat => "Dat" ; + Ins => "Ins" ; + Tra => "Tra" ; + Sup => "Sup" ; + Ine => "Ine" ; + Ela => "Ela" ; + All => "All" ; + Ade => "Ade" ; + Abl => "Abl" ; + Sub => "Sub" ; + Del => "Del" ; + Ill => "Ill" ; + Cau => "Cau" } ; + + ncstem2str : NumCaseStem -> Str = \nc -> case nc of { + SgNom => "SgNom" ; + SgAccStem => "SgAccStem" ; + SgSup => "SgSup" ; + SgAll => "SgAll" ; + SgInsStem => "SgInsStem" ; + SgStem => "SgStem" ; + PlStem => "PlStem" ; + PossdSg_PossrP3 => "PossdSg_PossrP3" ; + PossdSg_PossrPl1 => "PossdSg_PossrPl1" ; + PossdPl => "PossdPl" + } ; + + possessor2str : Possessor -> Str = \p -> case p of { + NoPoss => "NoPoss" ; + Poss P1 Sg => "Poss P1 Sg" ; + Poss P2 Sg => "Poss P2 Sg" ; + Poss P3 Sg => "Poss P3 Sg" ; + Poss P1 Pl => "Poss P1 Pl" ; + Poss P2 Pl => "Poss P2 Pl" ; + Poss P3 Pl => "Poss P3 Pl" + } ; -------------------------------------------------------------------------------- -- Numerals @@ -61,13 +178,16 @@ param CardOrd = NOrd | NCard ; -- Not used yet - NumType = NoNum | IsDig | IsNum ; + NumType = NoNum Number | IsNum ; oper - isNum : {numtype : NumType} -> Bool = \nt -> case nt.numtype of { - NoNum => False ; - _ => True + isNum : {n : NumType} -> Bool = \n -> case n.n of { + IsNum => True ; + _ => False } ; + + num2number : NumType -> Number = \n -> + case n of {NoNum x => x ; IsNum => Sg} ; -------------------------------------------------------------------------------- -- Adjectives @@ -88,13 +208,13 @@ param VForm = VInf - | VFin Person Number ; + | VPres Person Number ; oper agr2vf : Person*Number -> VForm = \pn -> case of { - => VFin p n + => VPres p n } ; -------------------------------------------------------------------------------- diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 14fcb2cab..e31d338b3 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -12,12 +12,12 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { UttImpPol = UttImpSg ; -} UttIP, - UttNP = \np -> {s = np.s ! Nom} ; + UttNP = \np -> {s = np.s ! NoPoss ! Nom} ; UttVP vp = {s = vp.obj ++ vp.adv ++ vp.s ! VInf} ; UttAdv adv = adv ; - UttCN cn = {s = cn.s ! Sg ! Nom} ; + UttCN cn = {s = linCN cn} ; UttCard n = {s = n.s ! Indep} ; - UttAP ap = {s = ap.s ! Sg ++ ap.compar} ; + UttAP ap = {s = ap.s ! Sg ! Nom ++ ap.compl ! Sg} ; UttInterj i = i ; NoPConj = {s = []} ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 5426e0d24..dcc6139f0 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -13,6 +13,63 @@ resource ResHun = NounMorphoHun ** open Prelude, Predef in { -- Noun morphology is in NounMorphoHun oper + CNoun : Type = Noun ** { + compl : Number => Case => Str ; + } ; + + mkCaseNoun : Str -> Number => Case => Str = \s -> + \\n,c => caseFromStem (\a,b -> a+b) (mkNoun s) c n ; + mkCaseNoun2 : (n,a : Str) -> Number => Case => Str = \no,ac -> + \\n,c => caseFromStem (\a,b -> a+b) (regNounNomAcc no ac) c n ; + + caseFromStem : (Str->Str->Str) -> Noun -> Case -> Number -> Str = \bind,cn,cas,n -> + let applyCase' : NumCaseStem -> Str = applyCase bind cas cn in + case of { + => cn.s ! SgNom ; + => bind (cn.s ! SgAccStem) "t" ; + => cn.s ! SgSup ; + => cn.s ! SgAll ; + => cn.s ! PlStem ; -- don't use applyCase', it adds a BIND which breaks everything! + => applyCase' SgInsStem ; + => bind (bind (cn.s ! PlStem) "k") (endCase cas ! cn.h) ; + => applyCase' SgStem ; + => applyCase' PlStem + } ; + + caseFromPossStem : CNoun -> Determiner -> Case -> Str = \cn,det,cas -> + let st : PossStem = case det.dt of { + DetPoss x => x ; + _ => Predef.error "caseFromPossStem: Not possessive Det" } ; + casetable : Case->HarmForms = case of { + -- P3 Sg possessive suffix ends in vowel, others in consonant. + => endCasePossVow ; + _ => endCase } ; + stem : NumCaseStem = case det.n of { + Pl => PossdPl ; + Sg => case st of { + dSg_rP3 _ => PossdSg_PossrP3 ; + dSg_rPl1 => PossdSg_PossrPl1 ; + dSg_rSg1P2 => SgAccStem } + } ; + + -- possessive suffix e.g. "their cats-3pl" is just k. not uk/ük + -- possessive suffix e.g. "her cat-3sg" is ∅, we store + suf = case of { + => "k" ; + => "" ; + _ => det.poss ! cn.h } ; + in case of { + -- Possessor is P3 Sg, possessed is plural, case is Nom: + -- just use the stored PossdPl stem, e.g. 'madarai' + => cn.s ! PossdPl ; + + -- Any number of possr or possd, case Nom = empty case ending + => glue (cn.s ! stem) suf ; + + -- Other forms have non-empty poss. suffix and case ending + _ => applyCaseSuf suf cas cn stem casetable + } ; + BaseNP : Type = { agr : Person*Number ; objdef : ObjDef ; @@ -20,70 +77,164 @@ oper } ; NounPhrase : Type = BaseNP ** { - s : Case => Str ; + s : Possessor => Case => Str ; } ; emptyNP : NounPhrase = { - s = \\_ => [] ; + s = \\_,_ => [] ; agr = ; objdef = Indef ; empty = [] ; } ; - indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ; + indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\p,c => s} ; defNP : Str -> Number -> NounPhrase = \s,n -> emptyNP ** { - s = (mkNoun s).s ! n ; + s = \\c => mkCaseNoun s ! n ; n = n ; objdef = Def ; } ; + + linCN : CNoun -> Str = \cn -> cn.s ! SgNom ++ cn.compl ! Sg ! Nom ; -------------------------------------------------------------------------------- -- Pronouns - Pronoun : Type = NounPhrase ** { - --poss : Str ; -- for PossPron : Pron -> Quant + Pronoun : Type = BaseNP ** { + s : Case => Str ; + poss : HarmForms ; -- for PossPron : Pron -> Quant } ; + possForms : Person*Number => HarmForms = \\agr => case agr of { + => harm1 "m" ; + => harm1 "d" ; + => harm "a" "e" ; --TODO: wovel cases with "ja"? See verb forms below + => harm1 "nk" ; -- u/ü/other vowel in stem + => harm "tok" "tök" ; + => harm "uk" "ük" + } ; + + pronTable : Person*Number => Pronoun = \\agr => case agr of { + => emptyNP ** { + s = caseTable "én" "engem" "nekem" + "belém" "bennem" "belőlem" -- inner locatives + "hozzám" "nálam" "tőlem" -- outer locatives + "rám" "rajtam" "rólam" -- outer locatives + "értem" -- Causative + "velem" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "te" "teged" "neked" + "beléd" "benned" "belőled" + "hozzád" "nálad" "tőled" + "rád" "rajtad" "rólad" + "érted" -- Causative + "veled" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "ő" "őt" "neki" + "belé" "benne" "belőle" + "hozzá" "nála" "tőle" + "rá" "rajta" "róla" + "érte" -- Causative + "vele" -- Instrumental + nonExist ; -- Translative + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "mi" "minket" "nekünk" + "belénk" "bennünk" "belőlünk" + "hozzánk" "nálunk" "tőlünk" + "ránk" "rajtunk" "rólunk" + "értünk" -- Causative + "velünk" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "ti" "titeket" "nektek" + "belétek" "bennetek" "belőletek" + "hozzátok" "nálatok" "tőletek" + "rátok" "rajtatok" "rólatok" + "értetek" -- Causative + "veletek" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "ők" "őket" "nekik" + "beléjük" "bennük" "belőlük" + "hozzájuk" "náluk" "tőlük" + "rájuk" "rajtuk" "róluk" + "értük" -- Causative + "velük" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } + } ; -------------------------------------------------------------------------------- -- Det, Quant, Card, Ord + BaseQuant : Type = { + poss : HarmForms ; -- Quants made by PossPron need this, empty for others + caseagr : Bool ; -- If it agrees in case: "azoknak a nőknek" vs. "sok nőknek" + } ; + -- Quant has variable number: -- e.g. this_Quant has both "this" and "these" - Quant : Type = { + Quant : Type = BaseQuant ** { s, -- form that comes before noun: "{this} car" sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP) - isIndefArt : Bool ; -- standard trick to prevent "a one car" - objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object + qt : QuantType ; } ; mkQuant : (s,sp : Str) -> Quant = \s,sp -> { - s = (mkNoun s).s ; - sp = (mkNoun sp).s ; - isIndefArt = False ; - objdef = Def ; + s = mkCaseNoun s ; + sp = mkCaseNoun sp ; + qt = DefQuant ; + caseagr = True ; + poss = harm1 [] ; } ; -- Det is formed in DetQuant : Quant -> Num -> Det -- so it has an inherent number. - Determiner : Type = { + Determiner : Type = BaseQuant ** { s, sp : Case => Str ; n : Number ; - numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl - objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object + dt : DetType ; } ; - mkDet : (s : Str) -> ObjDef -> Number -> Determiner = \s,d,n -> { + mkDet : (s : Str) -> ObjDef -> Number -> Bool -> Determiner = \s,d,n,ca -> { s, - sp = (mkNoun s).s ! n ; + sp = mkCaseNoun s ! n ; n = n ; numtype = NoNum ; - objdef = d ; + caseagr = ca ; + dt = objdef2dt d ; + poss = harm1 [] ; } ; + mkDet2 : (n,a : Str) -> ObjDef -> Number -> Bool -> Determiner = \no,ac,d,n,ca -> + let reg : Determiner = mkDet no d n ca + in reg ** { + s,sp = mkCaseNoun2 no ac ! n ; + } ; + + -- No need for number: + -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Nouns + -- "Nouns are used in the singular only, if preceded by a numeral or any other + -- word expressing quantity; as két ember, two men; sok fa, many trees." Numeral : Type = { s : Place => Str ; -- Independent or attribute - numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages -- TODO add ordinal } ; @@ -92,13 +243,12 @@ oper Noun.gf: NumCard : Card -> Num ; -} Num : Type = Numeral ** { - n : Number ; -- Singular or plural + n : NumType ; -- Singular, plural or numeral } ; baseNum : Num = { s = \\_ => [] ; - n = Sg ; - numtype = NoNum + n = NoNum Sg ; } ; -------------------------------------------------------------------------------- @@ -111,9 +261,27 @@ oper c : Case ; } ; - mkPrep : Str -> Adposition = \str -> {s=str ; c=Nom ; pr=[]} ; + nomAdp : Str -> Adposition = \s -> postpos Nom s ; + + caseAdp = overload { + caseAdp : Case -> Adposition = \c -> postpos c [] ; + caseAdp : Case -> Str -> Adposition = \c,s -> postpos c s ; + } ; + postpos : Case -> Str -> Adposition = \c,s-> {s=s ; c=c ; pr=[]} ; + prepos : Case -> Str -> Adposition = \c,s -> {s=[] ; c=c ; pr=s} ; + + emptyAdp : Adposition = nomAdp [] ; + + applyAdp : Adposition -> NounPhrase -> Str = \adp,np -> + adp.pr ++ np.s ! NoPoss ! adp.c ++ adp.s ; + + applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = + \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; + + applyCaseSuf : Str -> Case -> CNoun -> NumCaseStem -> (Case -> HarmForms) -> Str = + \suf,cas,cn,stem,casetable -> + glue (glue (cn.s ! stem) suf) (casetable cas ! cn.h) ; - emptyAdp : Adposition = mkPrep [] ; ------------------ -- Conj @@ -135,34 +303,40 @@ oper -- Adjectives AdjPhrase : Type = { - s : Number => Str ; - compar : Str -- Discontinuous: Én *nagyobb* vagyok *nálad*. + s : Number => Case => Str ; + compl : Number => Str -- Discontinuous comparative: Én nagyobb vagyok nálad. + -- This depends on Number to allow postmodifier APs. } ; emptyAP : AdjPhrase = { - s = \\_ => [] ; - compar = [] ; + s = \\_,_ => [] ; + compl = \\_ => [] ; } ; Adjective : Type = { - s : Degree => Number => Str - } ; - Adjective2 : Type = Adjective ** { - c2 : Adposition ; + s : Degree => NumCaseStem => Str ; + h : Harm ; } ; - mkAdj : Str -> Adjective = \sg -> { - 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 + Adjective2 : Type = Adjective ** { + c2 : Adposition ; + isPost : Bool ; -- put adjective past the thing it modifies } ; + mkAdj : Str -> Adjective = \sgnom -> mkAdj2 sgnom (regNoun sgnom) ; + + + mkAdj2 : Str -> Noun -> Adjective = \sgnom,adjAsNoun -> adjAsNoun ** { + s = \\d => + let adj : Noun = case d of { + Compar => mkNoun (comparAdj sgnom) ; + Superl => mkNoun ("leg" + comparAdj sgnom) ; + _ => adjAsNoun } ; + in adj.s ; + } ; + + invarAP : Str -> AdjPhrase = \s -> emptyAP ** {s = \\_,_ => s} ; + -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives comparAdj : Str -> Str = \stem -> case stem of { @@ -236,7 +410,7 @@ oper vtov2 : Verb -> Verb2 = \v -> v ** { s = table { - Def => let vDef : Verb = mkVerbReg endingsDef (v.s ! VInf) (v.s ! VFin P3 Sg) + Def => let vDef : Verb = mkVerbReg endingsDef (v.s ! VInf) (v.s ! VPres P3 Sg) in vDef.s ; Indef => v.s } ; c2 = Acc @@ -259,12 +433,12 @@ oper \sg1,sg2,sg3,pl1,pl2,pl3,inf -> { s = table { VInf => inf ; - VFin P1 Sg => sg1 ; - VFin P2 Sg => sg2 ; - VFin P3 Sg => sg3 ; - VFin P1 Pl => pl1 ; - VFin P2 Pl => pl2 ; - VFin P3 Pl => pl3 + VPres P1 Sg => sg1 ; + VPres P2 Sg => sg2 ; + VPres P3 Sg => sg3 ; + VPres P1 Pl => pl1 ; + VPres P2 Pl => pl2 ; + VPres P3 Pl => pl3 } ; sc = SCNom } ; @@ -286,7 +460,7 @@ oper -- VP VerbPhrase : Type = Verb ** { - obj : Str ; + obj : Str ; -- Person*Number => Str, if we want open word order in have_V2 adv : Str ; c2 : Case ; -- for RelSlash } ; -- TODO more fields @@ -296,7 +470,8 @@ oper } ; useV : Verb -> VerbPhrase = \v -> v ** { - obj,adv = [] ; + obj = [] ; + adv = [] ; c2 = Acc ; -- TODO check } ; @@ -304,15 +479,6 @@ oper adv = [] ; } ; - insertObj : VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { - obj = np.s ! vps.c2 ; - - -- If verb's subject case is Dat and object Nom, verb agrees with obj. - s = \\vf => case of { - => vps.s ! np.objdef ! agr2vf np.agr ; - _ => vps.s ! np.objdef ! vf } ; - } ; - insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ; insertAdvSlash : VPSlash -> SS -> VPSlash = \vps,adv -> vps ** {adv = adv.s} ; @@ -337,9 +503,10 @@ oper s = \\t,a,p => let subjcase : Case = case vp.sc of { SCNom => Nom ; SCDat => Dat } - in np.s ! subjcase + in np.s ! NoPoss ! subjcase + ++ if_then_Pol p [] "nem" ++ vp.s ! agr2vf np.agr - ++ vp.obj + ++ vp.obj -- ! np.agr ++ vp.adv ++ np.empty -- standard trick for prodrop+metavariable problem } ; @@ -349,10 +516,6 @@ oper RP : Type = {s : Number => Case => Str} ; RClause : Type = {s : Tense => Anteriority => Polarity => Number => Case => Str} ; - np2rp : NounPhrase -> RP ** {agr : Person*Number} = \np -> np ** { - s = \\n => np.s ; - } ; - relVP : RP -> VerbPhrase -> RClause = \rp -> relVP' (rp ** {agr=}) ; relVP' : RP ** {agr : Person*Number} -> VerbPhrase -> RClause = \rp,vp -> { @@ -360,9 +523,10 @@ oper SCNom => Nom ; SCDat => Dat } in rp.s ! n ! subjcase - ++ vp.obj + ++ if_then_Pol p [] "nem" + ++ vp.obj -- ! ++ vp.adv - ++ vp.s ! VFin rp.agr.p1 n -- variable by number + ++ vp.s ! VPres rp.agr.p1 n -- variable by number } ; relSlash : RP -> ClSlash -> RClause = \rp,cls -> { diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index d95b845e3..3e6a44378 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -61,16 +61,20 @@ lin most_Predet = {s = ""} ; -} --lin every_Det = -lin few_Det = mkDet "kevés" Def Sg ; -- TODO check -lin many_Det = mkDet "sok" Def Sg ; -- TODO check +lin few_Det = mkDet "kevés" Indef Sg False ; +lin many_Det = mkDet "sok" Indef Sg False ; --lin much_Det = -lin somePl_Det = mkDet "néhány" Indef Sg ; -lin someSg_Det = mkDet "néhány" Indef Sg ; +lin someSg_Det, + somePl_Det = mkDet2 "néhány" "néhányat" Indef Sg False ; --lin no_Quant = -lin that_Quant = mkQuant "az" "az" ; -lin this_Quant = mkQuant "ez" "ez" ; +lin that_Quant = + let az : Quant = mkQuant "az" "az" ; + in az ** {s = \\n,c => az.s ! n ! c ++ pre {"a" ; "az" / v }} ; +lin this_Quant = + let ez : Quant = mkQuant "ez" "ez" ; + in ez ** {s = \\n,c => ez.s ! n ! c ++ pre {"a" ; "az" / v }} ; {-lin which_IQuant = @@ -90,25 +94,25 @@ lin something_NP = defNP "valami" Sg ; -- List of postpositions requiring case: -- https://en.wiktionary.org/wiki/Appendix:Hungarian_postpositions#Postpositions_Requiring_Case -lin above_Prep = mkPrep "fölött" ; +lin above_Prep = nomAdp "fölött" ; -- lin after_Prep = mkPrep "" -- lin before_Prep = mkPrep "" ; -- lin behind_Prep = mkPrep "" ; -- lin between_Prep = = mkPrep "" ; -lin by8agent_Prep = mkPrep "által" ; -lin by8means_Prep = casePrep Ins ; +lin by8agent_Prep = nomAdp "által" ; +lin by8means_Prep = caseAdp Ins ; -- lin during_Prep = mkPrep ; -- lin except_Prep = mkPrep ; --- lin for_Prep = mkPrep "" ; +lin for_Prep = caseAdp Dat ; -- lin from_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ; -lin in_Prep = casePrep Ine ; -lin on_Prep = casePrep Ade ; +lin in_Prep = caseAdp Ine ; +lin on_Prep = caseAdp Sup ; -- lin part_Prep = casePrep ; -- lin possess_Prep = -- Suffix attaches to possessee, not possessor -- lin through_Prep = mkPrep ; -lin to_Prep = casePrep All ; -lin under_Prep = mkPrep "alatt" ; +lin to_Prep = caseAdp All ; +lin under_Prep = nomAdp "alatt" ; -- lin with_Prep = mkPrep "" ; -- lin without_Prep = mkPrep "" ; @@ -118,76 +122,14 @@ lin under_Prep = mkPrep "alatt" ; -- Pronouns are closed class, no constructor in ParadigmsHun. -- it_Pron = - i_Pron = emptyNP ** { - s = caseTable "én" "engem" "nekem" - "belém" "bennem" "belőlem" -- inner locatives - "hozzám" "nálam" "tőlem" -- outer locatives - "rám" "rajtam" "rólam" -- outer locatives - "értem" -- Causative - "velem" -- Instrumental - nonExist ; -- Translative - agr = ; - objdef = Def ; - poss = "em" ; - } ; + i_Pron = pronTable ! ; youPol_Pron, - youSg_Pron = emptyNP ** { - s = caseTable "te" "teged" "neked" - "beléd" "benned" "belőled" - "hozzád" "nálad" "tőled" - "rád" "rajtad" "rólad" - "érted" -- Causative - "veled" -- Instrumental - nonExist ; -- Translative - agr = ; - objdef = Def ; - poss = "d" ; - } ; + youSg_Pron = pronTable ! ; he_Pron, - she_Pron = emptyNP ** { - s = caseTable "ő" "őt" "neki" - "belé" "benne" "belőle" - "hozzá" "nála" "tőle" - "rá" "rajta" "róla" - "érte" -- Causative - "vele" -- Instrumental - nonExist ; -- Translative - objdef = Def ; - } ; - we_Pron = emptyNP ** { - s = caseTable "mi" "minket" "nekünk" - "belénk" "bennünk" "belőlünk" - "hozzánk" "nálunk" "tőlünk" - "ránk" "rajtunk" "rólunk" - "értünk" -- Causative - "velünk" -- Instrumental - nonExist ; -- Translative - agr = ; - objdef = Def ; - } ; - - youPl_Pron = emptyNP ** { - s = caseTable "ti" "titeket" "nektek" - "belétek" "bennetek" "belőletek" - "hozzátok" "nálatok" "tőletek" - "rátok" "rajtatok" "rólatok" - "értetek" -- Causative - "veletek" -- Instrumental - nonExist ; -- Translative - agr = ; - objdef = Def ; - } ; - they_Pron = emptyNP ** { - s = caseTable "ők" "őket" "nekik" - "beléjük" "bennük" "belőlük" - "hozzájuk" "náluk" "tőlük" - "rájuk" "rajtuk" "róluk" - "értük" -- Causative - "velük" -- Instrumental - nonExist ; -- Translative - agr = ; - objdef = Def ; - } ; + she_Pron = pronTable ! ; + we_Pron = pronTable ! ; + youPl_Pron = pronTable ! ; + they_Pron = pronTable ! ; --lin whatPl_IP = ; --lin whatSg_IP = : diff --git a/src/hungarian/SymbolHun.gf b/src/hungarian/SymbolHun.gf index 47f7c990a..1fe3dffe0 100644 --- a/src/hungarian/SymbolHun.gf +++ b/src/hungarian/SymbolHun.gf @@ -18,22 +18,22 @@ lin oper mkPN : Str -> NounPhrase = \s -> emptyNP ** { - s = \\_ => s ; + s = \\_,_ => s ; } ; lin -- : CN -> Int -> NP CNIntNP cn i = NH.MassNP (cn ** { - s = \\n,c => cn.s ! n ! c ++ i.s}) ; + compl = \\n,c => cn.compl ! n ! c ++ i.s}) ; -- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y CNSymbNP det cn xs = - let cnSymb : CN = cn ** {s = \\n,c => cn.s ! n ! c ++ xs.s} + let cnSymb : CN = cn ** {compl = \\n,c => cn.compl ! n ! c ++ xs.s} in NH.DetCN det cnSymb ; -- : CN -> Card -> NP ; -- level five ; level 5 CNNumNP cn i = NH.MassNP (cn ** { - s = \\n,c => cn.s ! n ! c ++ i.s ! Indep}) ; + compl = \\n,c => cn.compl ! n ! c ++ i.s ! Indep}) ; -- : Symb -> S ; SymbS sy = sy ; @@ -42,7 +42,7 @@ lin SymbNum sy = baseNum ** {s = \\_ => sy.s} ; -- : Symb -> Ord ; - SymbOrd sy = {s = \\n => sy.s ; n=Pl} ; + SymbOrd sy = {s = \\n,c => sy.s ; n=Pl} ; lincat Symb, [Symb] = SS ; diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 0202aa980..ef21c0631 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -1,4 +1,5 @@ -concrete VerbHun of Verb = CatHun ** open ResHun, AdverbHun, Prelude in { +concrete VerbHun of Verb = CatHun ** + open ResHun, AdverbHun, NounHun, Prelude in { lin @@ -63,7 +64,7 @@ lin } ; -} -- : VPSlash -> NP -> VP - ComplSlash = ResHun.insertObj ; + ComplSlash = insertObj ; {- -- : VV -> VPSlash -> VPSlash ; -- Just like ComplVV except missing subject! @@ -109,25 +110,31 @@ lin -- : AP -> Comp ; CompAP ap = UseCopula ** { s = \\vf => case vf of { - VFin P3 n => ap.s ! n ; - VFin _ n => ap.s ! n ++ copula.s ! vf ; - _ => ap.s ! Sg ++ copula.s ! vf} - ++ ap.compar ; + VPres P3 n => ap.s ! n ! Nom ++ ap.compl ! n ; + VPres _ n => ap.s ! n ! Nom ++ copula.s ! vf ++ ap.compl ! n ; + _ => ap.s ! Sg ! Nom ++ copula.s ! vf ++ ap.compl ! Sg } ; } ; -- : CN -> Comp ; CompCN cn = UseCopula ** { s = \\vf => case vf of { - VFin P3 n => cn.s ! n ! Nom ; - VFin _ n => cn.s ! n ! Nom ++ copula.s ! vf ; - _ => cn.s ! Sg ! Nom ++ copula.s ! vf} ; + VPres P3 n => cn.s ! SgNom -- TODO + ++ cn.compl ! n ! Nom ; + + VPres _ n => cn.s ! SgNom -- TODO + ++ cn.compl ! n ! Nom + ++ copula.s ! vf ; + + _ => cn.s ! SgNom + ++ cn.compl ! Sg ! Nom + ++ copula.s ! vf} ; } ; -- : NP -> Comp ; CompNP np = UseCopula ** { s = \\vf => case vf of { - VFin P3 _ => np.s ! Nom ; - _ => np.s ! Nom ++ copula.s ! vf } ; + VPres P3 _ => np.s ! NoPoss ! Nom ; + _ => np.s ! NoPoss ! Nom ++ copula.s ! vf } ; } ; -- : Adv -> Comp ; @@ -138,4 +145,24 @@ lin -- : VP -- Copula alone; UseCopula = useV copula ; +oper +insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { + obj = case of { + => [] ; + _ => np.s ! NoPoss ! vps.c2 } ; + + s = \\vf => + -- If verb's subject case is Dat and object Nom, verb agrees with obj. + case of { -- have_V2 needs its object possessed by the subject + => + let agr : Person*Number = case vf of { + VPres p n => ; + _ => } ; + in np.s ! Poss agr.p1 agr.p2 ! vps.c2 + ++ vps.s ! np.objdef ! agr2vf np.agr ; + + -- Default case: Verb agrees in person and number with subject + _ => vps.s ! np.objdef ! vf } ; + } ; + } diff --git a/src/hungarian/unittest/dative.gftest b/src/hungarian/unittest/dative.gftest index 990bfc0fd..2acdcb6e5 100644 --- a/src/hungarian/unittest/dative.gftest +++ b/src/hungarian/unittest/dative.gftest @@ -1,17 +1,16 @@ -- LangEng: I have a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)))))) NoVoc -LangHun: nekem van egy macskám +LangHun: nekem van egy macská &+ m -- LangEng: I have the cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))))) NoVoc -LangHun: nekem megvan a macska +LangHun: nekem van a macská &+ m --In this case we don't have to use plural -- LangEng: I have many cats Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN many_Det (UseN cat_N)))))) NoVoc -LangHun: nekem van sok macskám +LangHun: nekem van sok macská &+ m -- LangEng: I have some cats Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN somePl_Det (UseN cat_N)))))) NoVoc -LangHun: nekem van néhány macskám --- "néhány" better translation than "némely" +LangHun: nekem van néhány macská &+ m diff --git a/src/hungarian/unittest/determiners.gftest b/src/hungarian/unittest/determiners.gftest new file mode 100644 index 000000000..ce4856b70 --- /dev/null +++ b/src/hungarian/unittest/determiners.gftest @@ -0,0 +1,39 @@ +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant this_Quant NumSg) (UseN apple_N)))))) NoVoc +LangEng: I see this apple +LangHun: én látom ezt az almá &+ t + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant this_Quant NumPl) (UseN apple_N)))))) NoVoc +LangEng: I see these apples +LangHun: én látom ezeket az almákat + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant that_Quant NumPl) (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc +LangEng: I see those red apples +LangHun: én látom azokat a piros almákat + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetNP (DetQuant this_Quant NumSg)))))) NoVoc +LangEng: I see this +LangHun: én látom ezt + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetNP (DetQuant this_Quant NumPl)))))) NoVoc +LangEng: I see these +LangHun: én látom ezeket + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN somePl_Det (UseN apple_N)))))) NoVoc +LangEng: I see some apples +LangHun: én látok néhány almá &+ t + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN somePl_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc +LangEng: I see some red apples +LangHun: én látok néhány piros almá &+ t + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetNP somePl_Det))))) NoVoc +LangEng: I see some +LangHun: én látok néhányat + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN few_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc +LangEng: I see few red apples +LangHun: én látok kevés piros almá &+ t + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN many_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc +LangEng: I see many red apples +LangHun: én látok sok piros almá &+ t diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest deleted file mode 100644 index 0ceffde72..000000000 --- a/src/hungarian/unittest/inflection.gftest +++ /dev/null @@ -1,364 +0,0 @@ ---------------------- --- Noun inflection -- ---------------------- - --- Beer -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) -LangEng: under the beer -LangHun: a sör alatt - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) -LangEng: in the beer -LangHun: a sörben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) -LangEng: on the beer -LangHun: a sörnél - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) -# LangEng: of the beer -# LangHun: a söré - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) -LangEng: to the beer -LangHun: a sörhöz - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) -LangHun: a sörökben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) -LangHun: a söröknél - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) -# LangHun: a söröké - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) -LangHun: a sörökhöz - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) -LangHun: a sörök alatt - ---látom not látok -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN beer_N)))))) NoVoc -LangEng: I see the beer -LangHun: én látom a sört - ---söröket not sörököt -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN beer_N)))))) NoVoc -LangEng: I see the beers -LangHun: én látom a söröket - - --- Woman --- nő-nőt, not *nő-növet -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) -LangEng: under the woman -LangHun: a nő alatt - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) -LangEng: in the woman -LangHun: a nőben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) -LangEng: on the woman -LangHun: a nőnél - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) -# LangEng: of the woman -# LangHun: a nőé - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) -LangEng: to the woman -LangHun: a nőhöz - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -LangHun: a nőkben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -LangHun: a nőknél - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -# LangHun: a nőké - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -LangHun: a nőkhöz - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -LangHun: a nők alatt - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN woman_N)))))) NoVoc -LangEng: I see the woman -LangHun: én látom a nőt - ---nőket not nőköt -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN woman_N)))))) NoVoc -LangEng: I see the women -LangHun: én látom a nőket - --- Apple -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) -LangEng: under the apple -LangHun: az alma alatt - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) -LangEng: in the apple -LangHun: az almában - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) -LangEng: on the apple -LangHun: az almánál - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) -# LangEng: of the apple -# LangHun: az almáé - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) -LangEng: to the apple -LangHun: az almához - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almákban - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almáknál - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -# LangHun: az almáké - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almákhoz - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almák alatt - - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN apple_N)))))) NoVoc -LangEng: I see the apple -LangHun: én látom az almát - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN apple_N)))))) NoVoc -LangEng: I see the apples -LangHun: én látom az almákat - --- Bird -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) -LangEng: under the bird -LangHun: a madár alatt - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) -LangEng: in the bird -LangHun: a madárban - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) -LangEng: on the bird -LangHun: a madárnál - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) -# LangEng: of the bird -# LangHun: a madáré - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) -LangEng: to the bird -LangHun: a madárhoz - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madarakban - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madaraknál - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -# LangHun: a madaraké - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madarakhoz - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madarak alatt - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN bird_N)))))) NoVoc -LangEng: I see the bird -LangHun: én látom a madarat - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN bird_N)))))) NoVoc -LangEng: I see the birds -LangHun: én látom a madarakat - --- Name -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) -LangEng: under the name -LangHun: a név alatt - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) -LangEng: in the name -LangHun: a névben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) -LangEng: on the name -LangHun: a névnél - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) -# LangEng: of the name -# LangHun: a névé - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) -LangEng: to the name -LangHun: a névhez - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a nevekben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a neveknél - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -# LangHun: a neveké - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a nevekhez - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a nevek alatt - - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN name_N)))))) NoVoc -LangEng: I see the name -LangHun: én látom a nevet - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN name_N)))))) NoVoc -LangEng: I see the names -LangHun: én látom a neveket - --- Man -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) -LangEng: under the man -LangHun: a férfi alatt - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) -LangEng: in the man -LangHun: a férfiban - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) -LangEng: on the man -LangHun: a férfinál - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) -# LangEng: of the man -# LangHun: a férfié - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) -LangEng: to the man -LangHun: a férfihoz - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiakban - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiaknál - -# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -# LangHun: a férfiaké - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiakhoz - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiak alatt - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN man_N)))))) NoVoc -LangEng: I see the man -LangHun: én látom a férfit - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN man_N)))))) NoVoc -LangEng: I see the men -LangHun: én látom a férfiakat - - --- Horse -Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) -LangEng: by the horse -LangHun: a lóval - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) -LangEng: in the horse -LangHun: a lóban - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) -LangEng: on the horse -LangHun: a lónál - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) -LangEng: to the horse -LangHun: a lóhoz - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) -LangEng: under the horse -LangHun: a ló alatt - -Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) -LangEng: by the horses -LangHun: a lovakkal - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) -LangEng: in the horses -LangHun: a lovakban - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) -LangEng: on the horses -LangHun: a lovaknál - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) -LangEng: to the horses -LangHun: a lovakhoz - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) -LangEng: under the horses -LangHun: a lovak alatt - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN horse_N)))))) NoVoc -LangEng: I see the horse -LangHun: én látom a lovat - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN horse_N)))))) NoVoc -LangEng: I see the horses -LangHun: én látom a lovakat - - --- Stone -Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) -LangHun: a kővel - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) -LangHun: a kőben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) -LangHun: a kőnél - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) -LangHun: a kőhöz - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) -LangHun: a kő alatt - -Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) -LangHun: a kövekkel - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) -LangHun: a kövekben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) -LangHun: a köveknél - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) -LangHun: a kövekhez - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) -LangHun: a kövek alatt - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN stone_N)))))) NoVoc -LangEng: I see the stone -LangHun: én látom a követ - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN stone_N)))))) NoVoc -LangEng: I see the stones -LangHun: én látom a köveket diff --git a/src/hungarian/unittest/inflection/alma.gftest b/src/hungarian/unittest/inflection/alma.gftest new file mode 100644 index 000000000..994656c2b --- /dev/null +++ b/src/hungarian/unittest/inflection/alma.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN apple_N) +LangHun: alma + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN apple_N))) +LangHun: én látok egy almá &+ t + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN apple_N)) +LangHun: egy almán + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN apple_N) +LangHun: almák + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN apple_N))) +LangHun: én látok almákat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN apple_N)) +LangHun: egy almához + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN apple_N)) +LangHun: almákhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN apple_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/falu.gftest b/src/hungarian/unittest/inflection/falu.gftest new file mode 100644 index 000000000..d992ac5b9 --- /dev/null +++ b/src/hungarian/unittest/inflection/falu.gftest @@ -0,0 +1,25 @@ +--This constructor also takes care of szó or case ("szót" not "szavat") + +Lang: MassNP (UseN village_N) +LangHun: falu + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN village_N))) +LangHun: én látok egy falut + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN village_N)) +LangHun: egy falun + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN village_N) +LangHun: falvak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN village_N))) +LangHun: én látok falvakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN village_N)) +LangHun: egy faluhoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN village_N)) +LangHun: falvakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN village_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/férfi.gftest b/src/hungarian/unittest/inflection/férfi.gftest new file mode 100644 index 000000000..171a59443 --- /dev/null +++ b/src/hungarian/unittest/inflection/férfi.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN man_N) +LangHun: férfi + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN man_N))) +LangHun: én látok egy férfi &+ t + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN man_N)) +LangHun: egy férfin + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN man_N) +LangHun: férfiak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN man_N))) +LangHun: én látok férfiakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN man_N)) +LangHun: egy férfihoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN man_N)) +LangHun: férfiakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN man_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/fű.gftest b/src/hungarian/unittest/inflection/fű.gftest new file mode 100644 index 000000000..1b1ec932e --- /dev/null +++ b/src/hungarian/unittest/inflection/fű.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN grass_N) +LangHun: fű + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN grass_N))) +LangHun: én látok egy füvet + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN grass_N)) +LangHun: egy füvön + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN grass_N) +LangHun: füvek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN grass_N))) +LangHun: én látok füveket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN grass_N)) +LangHun: egy fűhöz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN grass_N)) +LangHun: füvekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN grass_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/inflection_placeholder.gfs b/src/hungarian/unittest/inflection/inflection_placeholder.gfs new file mode 100644 index 000000000..a40ddfc6e --- /dev/null +++ b/src/hungarian/unittest/inflection/inflection_placeholder.gfs @@ -0,0 +1,9 @@ +i ../../LangHun.gf +l -treebank MassNP (UseN PLACEHOLDER) +l -treebank PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN PLACEHOLDER))) +l -treebank PrepNP on_Prep (MassNP (UseN PLACEHOLDER)) +l -treebank DetCN (DetQuant IndefArt NumPl) (UseN PLACEHOLDER) +l -treebank PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN PLACEHOLDER))) +l -treebank PrepNP to_Prep (MassNP (UseN PLACEHOLDER)) +l -treebank PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN PLACEHOLDER)) +l -treebank DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN PLACEHOLDER) diff --git a/src/hungarian/unittest/inflection/kő.gftest b/src/hungarian/unittest/inflection/kő.gftest new file mode 100644 index 000000000..c9d681a67 --- /dev/null +++ b/src/hungarian/unittest/inflection/kő.gftest @@ -0,0 +1,26 @@ +-- Julia's comments: +-- dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting + +Lang: MassNP (UseN stone_N) +LangHun: kő + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN stone_N))) +LangHun: én látok egy követ + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN stone_N)) +LangHun: egy kövön + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN stone_N) +LangHun: kövek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN stone_N))) +LangHun: én látok köveket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN stone_N)) +LangHun: egy kőhöz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN stone_N)) +LangHun: kövekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN stone_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/ló.gftest b/src/hungarian/unittest/inflection/ló.gftest new file mode 100644 index 000000000..0827fc0aa --- /dev/null +++ b/src/hungarian/unittest/inflection/ló.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN horse_N) +LangHun: ló + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN horse_N))) +LangHun: én látok egy lovat + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN horse_N)) +LangHun: egy lovon + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN horse_N) +LangHun: lovak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN horse_N))) +LangHun: én látok lovakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN horse_N)) +LangHun: egy lóhoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN horse_N)) +LangHun: lovakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN horse_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/madár.gftest b/src/hungarian/unittest/inflection/madár.gftest new file mode 100644 index 000000000..2eea2d3bb --- /dev/null +++ b/src/hungarian/unittest/inflection/madár.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN bird_N) +LangHun: madár + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN bird_N))) +LangHun: én látok egy madarat + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN bird_N)) +LangHun: egy madáron + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN bird_N) +LangHun: madarak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN bird_N))) +LangHun: én látok madarakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN bird_N)) +LangHun: egy madárhoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN bird_N)) +LangHun: madarakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN bird_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/mkInflection.sh b/src/hungarian/unittest/inflection/mkInflection.sh new file mode 100755 index 000000000..0968f89e3 --- /dev/null +++ b/src/hungarian/unittest/inflection/mkInflection.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +sed "s/PLACEHOLDER/$1_N/g" < inflection_placeholder.gfs > inflection_concrete.gfs +gf --run < inflection_concrete.gfs > $2-new.gftest # don't override the existing ones +rm inflection_concrete.gfs diff --git a/src/hungarian/unittest/inflection/név.gftest b/src/hungarian/unittest/inflection/név.gftest new file mode 100644 index 000000000..ddd71a6a5 --- /dev/null +++ b/src/hungarian/unittest/inflection/név.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN name_N) +LangHun: név + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN name_N))) +LangHun: én látok egy nevet + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN name_N)) +LangHun: egy néven + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN name_N) +LangHun: nevek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN name_N))) +LangHun: én látok neveket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN name_N)) +LangHun: egy névhez + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN name_N)) +LangHun: nevekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN name_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/nő.gftest b/src/hungarian/unittest/inflection/nő.gftest new file mode 100644 index 000000000..e38b23152 --- /dev/null +++ b/src/hungarian/unittest/inflection/nő.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN woman_N) +LangHun: nő + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN woman_N))) +LangHun: én látok egy nőt + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN woman_N)) +LangHun: egy nőn + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN woman_N) +LangHun: nők + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN woman_N))) +LangHun: én látok nőket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN woman_N)) +LangHun: egy nőhöz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN woman_N)) +LangHun: nőkhöz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN woman_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/szerelem.gftest b/src/hungarian/unittest/inflection/szerelem.gftest new file mode 100644 index 000000000..5a9c4dd8e --- /dev/null +++ b/src/hungarian/unittest/inflection/szerelem.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN love_N) +LangHun: szerelem + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN love_N))) +LangHun: én látok egy szerelmet + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN love_N)) +LangHun: egy szerelmen + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN love_N) +LangHun: szerelmek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN love_N))) +LangHun: én látok szerelmeket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN love_N)) +LangHun: egy szerelemhez + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN love_N)) +LangHun: szerelmekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN love_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/sör.gftest b/src/hungarian/unittest/inflection/sör.gftest new file mode 100644 index 000000000..bfe61563b --- /dev/null +++ b/src/hungarian/unittest/inflection/sör.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN beer_N) +LangHun: sör + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN beer_N))) +LangHun: én látok egy sört + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN beer_N)) +LangHun: egy sörön + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN beer_N) +LangHun: sörök + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN beer_N))) +LangHun: én látok söröket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN beer_N)) +LangHun: egy sörhöz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN beer_N)) +LangHun: sörökhöz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN beer_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/tó.gftest b/src/hungarian/unittest/inflection/tó.gftest new file mode 100644 index 000000000..9ac095071 --- /dev/null +++ b/src/hungarian/unittest/inflection/tó.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN lake_N) +LangHun: tó + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN lake_N))) +LangHun: én látok egy tavat + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN lake_N)) +LangHun: egy tavon + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN lake_N) +LangHun: tavak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN lake_N))) +LangHun: én látok tavakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN lake_N)) +LangHun: egy tóhoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN lake_N)) +LangHun: tavakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN lake_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/víz.gftest b/src/hungarian/unittest/inflection/víz.gftest new file mode 100644 index 000000000..dd39c4896 --- /dev/null +++ b/src/hungarian/unittest/inflection/víz.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN water_N) +LangHun: víz + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN water_N))) +LangHun: én látok egy vízt + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN water_N)) +LangHun: egy vízen + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN water_N) +LangHun: vízek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN water_N))) +LangHun: én látok vízeket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN water_N)) +LangHun: egy vízhez + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN water_N)) +LangHun: vízekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN water_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/év.gftest b/src/hungarian/unittest/inflection/év.gftest new file mode 100644 index 000000000..34205bf75 --- /dev/null +++ b/src/hungarian/unittest/inflection/év.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN year_N) +LangHun: év + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN year_N))) +LangHun: én látok egy évet + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN year_N)) +LangHun: egy éven + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN year_N) +LangHun: évek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN year_N))) +LangHun: én látok éveket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN year_N)) +LangHun: egy évhez + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN year_N)) +LangHun: évekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN year_N) +LangHun: TODO diff --git a/src/hungarian/unittest/relative.gftest b/src/hungarian/unittest/relative.gftest index 5a2dce4d5..5e378b85e 100644 --- a/src/hungarian/unittest/relative.gftest +++ b/src/hungarian/unittest/relative.gftest @@ -6,39 +6,39 @@ -- LangEng: I see a man that flies Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))))))))) NoVoc -LangHun: én látok egy férfit ami repül +LangHun: én látok egy férfi &+ t ami repül -- LangEng: I see the man that flies Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))))))))) NoVoc -LangHun: én látom a férfit ami repül +LangHun: én látom a férfi &+ t ami repül -- LangEng: I see the man that sees a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))) NoVoc -LangHun: én látom a férfit ami egy macskát lát +LangHun: én látom a férfi &+ t ami egy macská &+ t lát -- LangEng: I see the man that sees the cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))))))) NoVoc -LangHun: én látom a férfit ami a macskát látja +LangHun: én látom a férfi &+ t ami a macská &+ t látja -- LangEng: I see the man that has a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))) NoVoc -LangHun: én látom a férfit aminek egy macskája van +LangHun: én látom a férfi &+ t aminek egy macskáj &+ a van -- LangEng: I see the man that has the cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))))))) NoVoc -LangHun: én látom a férfit aminek megvan a macska +LangHun: én látom a férfi &+ t aminek megvan a macska -- vet inte riktigt hur jag ska tänka med "the cat", tyckte det kändes mer rätt med "meg-" konstruktionen -- LangEng: I see the cat that flies and that is red -- Do we need copula in "is red" or is it still fine without? -- This constructor repeats amit, we have other constructors that don't. I think we don't need it Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseComp (CompAP (PositA red_A))))))))))))) NoVoc -LangHun: én látom a macskát ami repül és piros +LangHun: én látom a macská &+ t ami repül és piros --skulle dock byta plats på "piros" och "repül" -- LangEng: I see the man that flies and that has a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))))) NoVoc -LangHun: én látom a férfit ami repül és aminek egy macskája van +LangHun: én látom a férfi &+ t ami repül és aminek egy macskáj &+ a van ------------------------------------------------------------- @@ -47,26 +47,26 @@ LangHun: én látom a férfit ami repül és aminek egy macskája van -- LangEng: I see the man that the cat sees Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (SlashV2a see_V2)))))))))) NoVoc -LangHun: én látom a férfit amit a macska lát +LangHun: én látom a férfi &+ t amit a macska lát -- LangEng: I see a man that the cat sees -- Should this be "amit a macska lát"? Yes Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (SlashV2a see_V2)))))))))) NoVoc -LangHun: én látok egy férfit amit a macska lát +LangHun: én látok egy férfi &+ t amit a macska lát --These last cases not corrected due to "van" confusion -- LangEng: I see a cat that the man has Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN man_N)) (SlashV2a have_V2)))))))))) NoVoc -LangHun: én látok egy macskát amit a férfinak van +LangHun: én látok egy macská &+ t amit a férfi &+ nak van -- LangEng: I see the cat that the man has Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN man_N)) (SlashV2a have_V2)))))))))) NoVoc -LangHun: én látom a macskát amit a férfinak van +LangHun: én látom a macská &+ t amit a férfi &+ nak van -- LangEng: I see the cat that the man has and that flies Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN man_N)) (SlashV2a have_V2)))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))))))))))) NoVoc -LangHun: én látom a macskát amit a férfinak van és amit repül +LangHun: én látom a macská &+ t amit a férfi &+ nak van és amit repül -- LangEng: I am redder than the cats that those women have Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompAP (ComparA red_A (DetCN (DetQuant DefArt NumPl) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant that_Quant NumPl) (UseN woman_N)) (SlashV2a have_V2)))))))))))) NoVoc -LangHun: én pirosabb vagyok a macskáknál amik azoknak nőknek vannak +LangHun: én pirosabb vagyok a macskák &+ nál amik azoknak a nők &+ nek vannak diff --git a/src/slovak/LexiconSlo.gf b/src/slovak/LexiconSlo.gf index e4e27d48d..ef99eb7bf 100644 --- a/src/slovak/LexiconSlo.gf +++ b/src/slovak/LexiconSlo.gf @@ -5,26 +5,28 @@ concrete LexiconSlo of Lexicon = ResSlo, ParadigmsSlo in { + lin - boy_N = declPAN "kluk" ; - man_N = declMUZ "muž" ; - teacher_N = declMUZ "učitel" ; - horse_N = declMUZ "kůň" ; - father_N = declMUZ "otec" ; - husband_N = declPAN "manžel" ; + boy_N = mkN "chlapec" ; + man_N = mkN "muž" ; + teacher_N = mkN "učiteľ" ; + horse_N = mkN "kôň" ; + father_N = mkN "otec" ; + husband_N = mkN "manžel" ; - castle_N = declHRAD "hrad" ; - forest_N = declHRAD "les" ; - machine_N = declSTROJ "stroj" ; + castle_N = mkN "hrad" ; + forest_N = mkN "les" ; + machine_N = mkN "stroj" ; - woman_N = declZENA "žena" ; - school_N = declZENA "škola" ; ---- - skirt_N = declRUZE "sukně"; - street_N = declRUZE "ulice" ; - rose_N = declRUZE "růže" ; - song_N = declPISEN "píseň" ; - bed_N = declPISEN "postel" ; - door_N = declRUZE "dveře" ; + woman_N = mkN "žena" ; + school_N = mkN "učilište" ; + skirt_N = mkN "sukňa"; + street_N = mkN "ulica" ; + rose_N = mkN "ruže" ; + song_N = mkN "pieseň" ; + bed_N = mkN "posteľ" ; +{- + door_N = mkN "dveře" ; bone_N = declKOST "kost" ; village_N = declKOST "ves" ; ---- @@ -43,17 +45,20 @@ concrete LexiconSlo of Lexicon = beautiful_A = mkA "krásný" ; clean_A = mkA "čistý" ; dirty_A = mkA "špinavý" ; - - white_A = mkA "bílý" ; - black_A = mkA "černý" ; - red_A = mkA "červený" ; - brown_A = mkA "hnědý" ; - blue_A = mkA "modrý" ; - green_A = mkA "zelený" ; - yellow_A = mkA "žlutý" ; +-} - buy_V2 = mkV2 (iii_kupovatVerbForms "kupovat") ; - love_V2 = mkV2 (iii_kupovatVerbForms "milovat") ; +--- from Google translate dictionary + + white_A = mkA "biely" ; + black_A = mkA "čierny" ; + red_A = mkA "červený" ; + brown_A = mkA "hnedý" ; + blue_A = mkA "modrý" ; --- belasý + green_A = mkA "zelený" ; + yellow_A = mkA "žltý" ; + + buy_V2 = mkV2 (iii_kupovatVerbForms "kupovať") ; + love_V2 = mkV2 (iii_kupovatVerbForms "milovať") ; } diff --git a/src/slovak/NounSlo.gf b/src/slovak/NounSlo.gf index 2e60e38a8..d888c4ce1 100644 --- a/src/slovak/NounSlo.gf +++ b/src/slovak/NounSlo.gf @@ -29,7 +29,7 @@ lin UsePron pron = { s = table { - Nom | Voc => pron.nom ; + Nom => pron.nom ; Gen => pron.gen ; Dat => pron.dat ; Acc => pron.acc ; @@ -38,7 +38,6 @@ lin } ; clit = table { Nom => pron.cnom ; - Voc => pron.nom ; Gen => pron.cgen ; Dat => pron.cdat ; Acc => pron.cacc ; @@ -46,7 +45,7 @@ lin Ins => pron.ins } ; prep = table { - Nom | Voc => pron.nom ; + Nom => pron.nom ; Gen => pron.pgen ; Dat => pron.pdat ; Acc => pron.pacc ; diff --git a/src/slovak/NumeralSlo.gf b/src/slovak/NumeralSlo.gf index 19538c46e..96b2229fc 100644 --- a/src/slovak/NumeralSlo.gf +++ b/src/slovak/NumeralSlo.gf @@ -35,31 +35,31 @@ oper mk2Num : Determiner -> Str -> Str -> Str -> LinDigit = \unit, teenbase, tenbase, hundred -> mkNum unit teenbase (tenbase + "cet") hundred ; -oper mk5Num : Str -> Str -> Str -> Str -> LinDigit = - \unit,uniti, teenbase, tenbase -> - mkNum (regNumeral unit uniti) teenbase (tenbase + "desát") (unit ++ "set") ; +oper mk5Num : Str -> Str -> Str -> Str -> Str -> Str -> LinDigit = + \unit,unitich,unitim,unitimi, teenbase, tenbase -> + mkNum (regNumeral unit unitich unitim unitimi) teenbase (tenbase + "desiat") (unit ++ "sto") ; oper bigNumeral : Str -> LinNumeral = \s -> invarNumeral s ; lin num x = x ; -lin n2 = mk2Num twoNumeral "dva" "dva" ("dvě" ++ "stě") ; -lin n3 = mk2Num threeNumeral "tři" "tři" ("tři" ++ "sta") ; -lin n4 = mk2Num fourNumeral "čtr" "čtyři" ("čtyři" ++ "sta") ; -lin n5 = mk5Num "pět" "pěti" "pat" "pa" ; -lin n6 = mk5Num "šest" "šesti" "šest" "še" ; -lin n7 = mk5Num "sedm" "sedmi" "sedm" "sedm"; -lin n8 = mk5Num "osm" "osmi" "osm" "osm"; -lin n9 = mk5Num "devět" "devíti" "devate" "deva" ; +lin n2 = mk2Num twoNumeral "dva" "dva" ("dve" ++ "sto") ; +lin n3 = mk2Num threeNumeral "tri" "tri" ("tri" ++ "sto") ; +lin n4 = mk2Num fourNumeral "štr" "štyři" ("styri" ++ "sto") ; +lin n5 = mk5Num "päť" "piatich" "piatim" "piatimi" "pät" "pät" ; ---- +lin n6 = mk5Num "šest" "šestich" "šestim" "šestimi" "šest" "šest" ; ---- +lin n7 = mk5Num "sedem" "sedemich" "sedemim" "sedemimi" "sedem" "sedem"; ---- +lin n8 = mk5Num "osem" "osemich" "osemim" "osemimi" "osem" "osem"; +lin n9 = mk5Num "deväť" "deviatich" "deviatim" "deviatimi" "deväť" "deväť" ; lin pot01 = { - unit = oneNumeral.s ; hundred = "sto" ; ten = "deset" ; teen = "jedenáct" ; + unit = oneNumeral.s ; hundred = "sto" ; ten = "desať" ; teen = "jedenásť" ; size = Num1 } ; lin pot0 d = d ; -lin pot110 = bigNumeral "deset" ; -lin pot111 = bigNumeral "jedenáct" ; +lin pot110 = bigNumeral "desať" ; +lin pot111 = bigNumeral "jedenásť" ; lin pot1to19 d = bigNumeral d.teen ; lin pot0as1 n = {s = n.unit ; size = n.size} ; @@ -91,8 +91,8 @@ oper tfSize : NumSize -> NumSize = \sz -> oper mkTh : Str -> NumSize -> Str = \attr,size -> case size of { Num1 => "tisíc" ; - Num2_4 => attr ++ "tisíce" ; - Num5 => attr ++ "tisíc" + Num2_4 => attr ++ "tisíc" ; + Num5 => attr ++ "tisí" } ; oper determinerStr : Determiner -> Str = \d -> d.s ! Masc Anim ! Nom ; diff --git a/src/slovak/ParadigmsSlo.gf b/src/slovak/ParadigmsSlo.gf index 542d3a931..82f98ea06 100644 --- a/src/slovak/ParadigmsSlo.gf +++ b/src/slovak/ParadigmsSlo.gf @@ -1,4 +1,4 @@ -resource ParadigmsSlo = open CatSlo, ResSlo, Prelude in { +resource ParadigmsSlo = open CatSlo, ResSlo, (R=ResSlo), Prelude in { ---------------- -- Parameters @@ -26,8 +26,6 @@ oper = Dat ; accusative : Case = Acc ; - vocative : Case - = ResSlo.Voc ; locative : Case = Loc ; instrumental : Case @@ -37,6 +35,7 @@ oper -- Nouns oper + mkN = overload { mkN : (nom : Str) -> N = \nom -> lin N (guessNounForms nom) ; @@ -48,35 +47,36 @@ oper -- However, they have some defaults that may have to be overwritten. -- This can be done easily by overriding those formes with record extension (**). -- The default extensions are shown in comments; if the default is correct, no extension is needed. +-- Notice that some paradigms take two arguments, some take one. - panN : Str -> N -- default ** {pnom = +i} - = \s -> lin N (declPAN s) ; - predsedaN : Str -> N -- default ** {sgen = +i} - = \s -> lin N (declPREDSEDA s) ; - hradN : Str -> N -- default ** {sgen,sloc = +u} - = \s -> lin N (declHRAD s) ; - zenaN : Str -> N -- default ** {pgen = zen} - = \s -> lin N (declZENA s) ; - mestoN : Str -> N -- default ** {sloc = +u ; pgen = mest ; ploc = +ech} - = \s -> lin N (declMESTO s) ; - muzN : Str -> N - = \s -> lin N (declMUZ s) ; - soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i} - = \s -> lin N (declSOUDCE s) ; + chlapN : Str -> N + = \s -> lin N (R.chlapN s) ; + hrdinaN : Str -> N + = \s -> lin N (R.hrdinaN s) ; + dubN : Str -> N + = \s -> lin N (R.dubN s) ; strojN : Str -> N - = \s -> lin N (declSTROJ s) ; - ruzeN : Str -> N - = \s -> lin N (declRUZE s) ; - pisenN : Str -> N - = \s -> lin N (declPISEN s) ; - kostN : Str -> N - = \s -> lin N (declKOST s) ; - kureN : Str -> N - = \s -> lin N (declKURE s) ; - moreN : Str -> N -- default ** {pgen = +í} - = \s -> lin N (declMORE s) ; - staveniN : Str -> N - = \s -> lin N (declSTAVENI s) ; + = \s -> lin N (R.strojN s) ; + ponyN : Str -> N + = \s -> lin N (R.ponyN s) ; + zenaN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.zenaN s) ** {pgen = p} ; + ulicaN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.ulicaN s) ** {pgen = p} ; + dlanN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.dlanN s p) ; + kostN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.kostN s p) ; + mestoN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.mestoN s) ** {pgen = p} ; + srdceN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.srdceN s) ** {pgen = p} ; + vysvedcenieN : Str -> N + = \s -> lin N (R.vysvedcenieN s) ; + dievcaN : Str -> N + = \s -> lin N (R.dievcaN s) ; + dievceniecN : Str -> N + = \s -> lin N (R.dievceniecN s) ; -- The full definition of the noun record is -- { @@ -92,27 +92,31 @@ oper mkA = overload { mkA : Str -> A - = \s -> lin A (case s of { - _ + "ý" => mladyAdjForms s ; - _ + "í" => jarniAdjForms s ; - _ + "ův" => otcuvAdjForms s ; - _ + "in" => matcinAdjForms s ; - _ => Predef.error ("no mkA for" ++ s) - }) ; + = \s -> lin A (guessAdjForms s) } ; - mladyA : Str -> A - = \s -> lin A (mladyAdjForms s) ; - jarniA : Str -> A - = \s -> lin A (jarniAdjForms s) ; - otcuvA : Str -> A - = \s -> lin A (otcuvAdjForms s) ; - matcinA : Str -> A - = \s -> lin A (matcinAdjForms s) ; + peknyA : Str -> A + = \s -> lin A (R.peknyA s) ; + krasnyA : Str -> A + = \s -> lin A (R.krasnyA s) ; + cudziA : Str -> A + = \s -> lin A (R.cudziA s) ; + rydziA : Str -> A + = \s -> lin A (R.rydziA s) ; + otcovA : Str -> A + = \s -> lin A (R.otcovA s) ; + mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (a ** {c = p}) ; +-- the full definition of the adjective record is +-- { +-- msnom, fsnom, nsnom, msgen, fsgen, msdat, fsacc, msloc, msins, fsins, +-- ampnom, pgen, pins : Str +-- } +-- + ------------------------- -- Verbs diff --git a/src/slovak/PhraseSlo.gf b/src/slovak/PhraseSlo.gf index 4510ff084..5fce3c4d7 100644 --- a/src/slovak/PhraseSlo.gf +++ b/src/slovak/PhraseSlo.gf @@ -14,6 +14,6 @@ lin PConjConj conj = {s = conj.s2} ; NoVoc = {s = []} ; - VocNP np = {s = np.s ! Voc} ; + VocNP np = {s = np.s ! Nom} ; } diff --git a/src/slovak/ResSlo.gf b/src/slovak/ResSlo.gf index be2179529..531125255 100644 --- a/src/slovak/ResSlo.gf +++ b/src/slovak/ResSlo.gf @@ -13,7 +13,7 @@ param Animacy = Anim | Inanim ; Gender = Masc Animacy | Fem | Neutr ; - Case = Nom | Gen | Dat | Acc | Voc | Loc | Ins ; -- traditional order + Case = Nom | Gen | Dat | Acc | Loc | Ins ; -- traditional order Person = P1 | P2 | P3 ; @@ -25,74 +25,34 @@ param oper hardConsonant : pattern Str = #("d"|"t"|"g"|"h"|"k"|"n"|"r") ; - softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"ř"|"š"|"c"|"č"|"ž") ; + softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"š"|"c"|"č"|"ž"|"ľ"|"ĺ"|"ŕ"|"dz") ; neutralConsonant : pattern Str = #("b"|"f"|"l"|"m"|"p"|"s"|"v") ; consonant : pattern Str = #( "d" | "t" | "g" | "h" | "k" | "n" | "r" | - "ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" | - "b" | "f" | "l" | "m" | "p" | "s" | "v" + "ť" | "ď" | "j" | "ň" | "š" | "c" | "č" | "ž" | + "b" | "f" | "l" | "m" | "p" | "s" | "v" | "ľ" | "ĺ" | "ŕ" | "dz" ) ; - dropFleetingE : Str -> Str = \s -> case s of { - x + "e" + c@("k"|"c"|"n") => x + c ; - x + "e" + "ň" => x + "n" ; - _ => s - } ; + accentedVowel : pattern Str = #("á"|"é"|"í"|"ú"|"ý") ; - shortenVowel : Str -> Str = \s -> case s of { - x + "á" + y => x + "a" + y ; - x + "é" + y => x + "e" + y ; - x + "í" + y => x + "i" + y ; - x + "ý" + y => x + "y" + y ; - x + "ó" + y => x + "o" + y ; - x + "ú" + y => x + "u" + y ; - x + "ů" + y => x + "o" + y ; - _ => s - } ; + diphthong : pattern Str = #("ia"|"ie"|"iu"|"ô") ; - addI : Str -> Str = \s -> case s of { - klu + "k" => klu + "ci" ; - vra + "h" => vra + "zi" ; - ce + "ch" => ce + "ši" ; - dokto + "r" => dokto + "ři" ; - pan => pan + "i" - } ; - - addAdjI : Str -> Str = \s -> case s of { - angli + "ck" => angli + "čtí" ; - ce + "sk" => ce + "ští" ; - _ => init (addI s) + "í" - } ; - - -- 3.4.10, in particular when also final 'a' is dropped - addE : Str -> Str = \s -> case s of { - re + "k" => re + "ce" ; - pra + ("g"|"h") => pra + "ze" ; - stre + "ch" => stre + "še" ; - sest + "r" => sest + "ře" ; - pan => pan + "ě" - } ; - - addEch : Str -> Str = \s -> case s of { - klu + "k" => klu + "cich" ; - vra + ("h"|"g") => vra + "zich" ; - ce + "ch" => ce + "šich" ; - pan => pan + "ech" - } ; - - shortFemPlGen : Str -> Str = \s -> case s of { - ul + "ice" => ul + "ic" ; - koleg + "yně" => koleg + "yň" ; - ruz + "e" => ruz + "í" ; - _ => Predef.error ("shortFemPlGen does not apply to" ++ s) - } ; + addAccented : (stem,long,short : Str) -> Str = \stem,long,short -> + case stem of { + _ + (#accentedVowel | #diphthong) + ? + ? => stem + short ; + _ + (#accentedVowel | #diphthong) + ? => stem + short ; + _ => stem + long + } ; --------------- -- Nouns --------------- +-- https://en.wikipedia.org/wiki/Slovak_declension +-- http://www.angelfire.com/sk3/quality/Slovak_declension.html + -- novel idea (for RGL): lexical items stored as records rather than tables -- advantages: -- - easier to make exceptions to paradigms (by ** {}) @@ -101,7 +61,7 @@ oper -- so this is the lincat of N - NounForms : Type = {snom,sgen,sdat,sacc,svoc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ; g : Gender} ; + NounForms : Type = {snom,sgen,sdat,sacc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ; g : Gender} ; -- But traditional tables make agreement easier to handle in syntax -- so this is the lincat of CN @@ -118,12 +78,11 @@ oper Gen => forms.sgen ; Dat => forms.sdat ; Acc => forms.sacc ; - Voc => forms.svoc ; Loc => forms.sloc ; Ins => forms.sins } ; Pl => table { - Nom | Voc => forms.pnom ; + Nom => forms.pnom ; Gen => forms.pgen ; Dat => forms.pdat ; Acc => forms.pacc ; @@ -134,291 +93,351 @@ oper g = forms.g } ; + -- terminology of CEG DeclensionType : Type = Str -> NounForms ; - declensionNounForms : (nom,gen : Str) -> Gender -> NounForms - = \nom,gen,g -> - let decl : DeclensionType = case of { - => declPAN ; - => declPREDSEDA ; - => declHRAD ; - => declZENA ; - => declMESTO ; - => declMUZ ; - => declMUZ ; - => declSOUDCE ; - => declSTROJ ; - => declRUZE ; - => declPISEN ; - => declKOST ; --- also many other "st" 3.6.3 - => declKURE ; - => declMORE ; - => declSTAVENI ; - _ => Predef.error ("cannot infer declension type for" ++ nom ++ gen) - } - in decl nom ; + declensionNounForms : (snom,pgen : Str) -> Gender -> NounForms + = \snom,pgen,g -> case of { + => hrdinaN snom ; + => ponyN snom ; ---- + => hrdinaN snom ; + + => strojN snom ; + => dubN snom ; + => dubN snom ; + + => zenaN snom ; + => zenaN snom ; + => ulicaN snom ; + => ulicaN snom ; + => kostN snom pgen ; + => dlanN snom pgen ; + + => mestoN snom ; + => vysvedcenieN snom ; + => srdceN snom ; + => dievceniecN snom ; + => dievcaN snom ; + + _ => dubN ("??"+snom) ** {pgen = pgen} ---- Predef.error ("cannot infer declension type for" ++ snom ++ pgen) + } ** {pgen = pgen ; g = g} ; -- the "smartest" one-argument mkN guessNounForms : Str -> NounForms - = \s -> case s of { - _ + "ost" => declKOST s ; - _ + "tel" => declMUZ s ; - _ + #hardConsonant => declHRAD s ; - _ + #softConsonant => declSTROJ s ; - _ + "a" => declZENA s ; - _ + "o" => declMESTO s ; - _ + "ce" => declSOUDCE s ; - _ + "e" => declMORE s ; - _ + "í" => declSTAVENI s ; - _ => Predef.error ("cannot guess declension type for" ++ s) + = \snom -> case snom of { + _ + ("i"|"y"|"e") => ponyN snom ; + _ + #softConsonant => strojN snom ; + _ + #hardConsonant => dubN snom ; + _ + #neutralConsonant => dubN snom ; + _ + #hardConsonant + "a" => zenaN snom ; + _ + #neutralConsonant + "a" => zenaN snom ; + _ + #softConsonant + "a" => ulicaN snom ; + _ + ("ia"|"ya") => ulicaN snom ; + _ + "o" => mestoN snom ; + _ + "ie" => vysvedcenieN snom ; + _ + "e" => srdceN snom ; + _ + "ä" => dievcaN snom ; + + _ => dubN ("??"+snom) ---- Predef.error ("cannot guess declension type for" ++ snom) } ; + -- the traditional declensions, in both CEG and Wiki --- they are also exported in ParadigmsSlo with names panN etc +-- they are also exported in ParadigmsSlo with names chlapN etc - declPAN : DeclensionType = \pan -> --- plural nom ové|i|é can be changed with ** {pnom = ...} CEG 3.5.1 + chlapN : DeclensionType = \chlap -> { - snom = pan ; - sgen,sacc = pan + "a" ; - sdat,sloc = pan + "ovi" ; --- pánu - svoc = shortenVowel pan + "e" ; --- "irregular shortening" 3.5.1 - sins = pan + "em" ; + snom = chlap ; + sgen,sacc = chlap + "a" ; + sdat,sloc = chlap + "ovi" ; + sins = chlap + "om" ; - pnom = addI pan ; -- pani, kluk-kluci --- panové, host-hosté - pgen = pan + "ů" ; - pdat = pan + "ům" ; - pacc,pins = pan + "y" ; - ploc = addEch pan ; + pnom = chlap + "i" ; + pgen,pacc = chlap + "ov" ; + pdat = chlap + "om" ; + ploc = chlap + "och" ; + pins = chlap + "mi" ; g = Masc Anim } ; - declPREDSEDA : DeclensionType = \predseda -> --- 3.5.4: sgen y/i - let predsed = init predseda + hrdinaN : DeclensionType = \hrdina -> + let hrdin = init hrdina in { - snom = predseda ; - sgen = predsed + "y" ; -- pacc,pins --- i - sdat,sloc = predsed + "ovi" ; - sacc = predsed + "u" ; - svoc = predsed + "o" ; - sins = predsed + "ou" ; + snom = hrdina ; + sgen,sacc = hrdin + "u" ; + sdat,sloc = hrdin + "ovi" ; + sins = hrdin + "om" ; + + pnom = hrdin + "ovia" ; + pgen,pacc = hrdin + "ov" ; + pdat = hrdin + "om" ; + ploc = hrdin + "och" ; + pins = hrdin + "ami" ; - pnom = case predseda of { - tur + "ista" => tur + "isté" ; - _ => predsed + "ové" - } ; - pgen = predsed + "ů" ; - pdat = predsed + "ům" ; - pacc,pins = predsed + "y" ; - ploc = addEch predsed ; g = Masc Anim } ; - - declHRAD : DeclensionType = \hrad -> --- 3.5.2: sloc u/ě/e extra arg, sport-u, hrad-ě ; sgen u/a - let hrd = dropFleetingE hrad - in + + dubN : DeclensionType = \dub -> { - snom,sacc = hrad ; - sgen,sdat = hrd + "u" ; --- Berlín-a - sloc = hrd + "u" ; --- addE hrad ; -- stůl-stole - svoc = hrd + "e" ; - sins = hrd + "em" ; + snom = dub ; + sgen = dub + "a" ; + sdat = dub + "u" ; + sacc = dub + "" ; + sloc = dub + "e" ; + sins = dub + "om" ; + + pnom = dub + "y" ; + pgen = dub + "ov" ; + pdat = dub + "om" ; + pacc = dub + "y" ; + ploc = dub + "och" ; + pins = dub + "mi" ; - pnom,pacc,pins = hrd + "y" ; - pgen = hrd + "ů" ; - pdat = hrd + "ům" ; - ploc = addEch hrd ; g = Masc Inanim } ; - declZENA : DeclensionType = \zena -> --- 3.6.1 sge y/i ; pgen sometimes shortening - let zen = init zena + strojN : DeclensionType = \stroj -> + { + snom = stroj ; + sgen = stroj + "a" ; + sdat = stroj + "u" ; + sacc = stroj + "" ; + sloc = stroj + "i" ; + sins = stroj + "om" ; + + pnom = stroj + "e" ; + pgen = stroj + "ov" ; + pdat = stroj + "om" ; + pacc = stroj + "e" ; + ploc = stroj + "och" ; + pins = stroj + "mi" ; + + g = Masc Inanim + } ; + +-- "fifth type" + ponyN : DeclensionType = \pony -> + { + snom = pony ; + sgen = pony + "ho" ; + sdat = pony + "mu" ; + sacc = pony + "ho" ; + sloc = pony + "m" ; + sins = pony + "m" ; + + pnom = pony + "ovia" ; + pgen = pony + "ov" ; + pdat = pony + "om" ; + pacc = pony + "ov" ; + ploc = pony + "och" ; + pins = pony + "mi" ; + + g = Masc Anim + } ; + + zenaN : DeclensionType = \zena -> + let + zen = init zena ; + zien : Str = case zen of { + z + "e" + c@? => z + "ie" + c ; + _ => zen ---- TODO: many more rules + } ; + zenaa = addAccented zen "á" "a" ; in { snom = zena ; - sgen = zen + "y" ; --- i after soft cons sometimes - sdat,sloc = zen + "ě" ; --- i after soft cons sometimes ; skol+e + sgen = zen + "y" ; + sdat = zen + "e" ; sacc = zen + "u" ; - svoc = shortenVowel zen + "o" ; ---- shorten ? + sloc = zen + "e" ; sins = zen + "ou" ; - pnom,pacc = zen + "y" ; --- also sgen - pgen = zen ; --- sometimes with vowel shortening - pdat = zen + "ám" ; - ploc = zen + "ách" ; + pnom = zen + "y" ; + pgen = zien ; + pdat = zenaa + "m" ; + pacc = zen + "y" ; + ploc = zenaa + "ch" ; pins = zen + "ami" ; + g = Fem } ; - declMESTO : DeclensionType = \mesto -> --- 3.7.1 sloc u/e ; pgen vowel shortening sometimes ; ploc variations - let mest = init mesto + ulicaN : DeclensionType = \ulica -> + let + ulic = init ulica ; + ulíc : Str = case ulic of { + ul + "i" + c@? => ul + "í" + c ; + _ => ulic + } in { - snom,sacc,svoc = mesto ; + snom = ulica ; + sgen = ulic + "e" ; + sdat = ulic + "i" ; + sacc = ulic + "u" ; + sloc = ulic + "i" ; + sins = ulic + "ou" ; + + pnom = ulic + "e" ; + pgen = ulíc ; + pdat = ulic + "iam" ; + pacc = ulic + "e" ; + ploc = ulic + "iach" ; + pins = ulic + "ami" ; + + g = Fem + } ; + + dlanN : Str -> DeclensionType = \dlanj,dlani -> + let dlan : Str = init dlani + in + { + snom = dlanj ; + sgen = dlan + "e" ; + sdat = dlan + "i" ; + sacc = dlanj ; + sloc = dlan + "i" ; + sins = dlanj + "ou" ; + + pnom = dlan + "e" ; + pgen = dlani ; + pdat = dlan + "iam" ; + pacc = dlan + "e" ; + ploc = dlan + "iach" ; + pins = dlanj + "ami" ; + + g = Fem + } ; + + kostN : Str -> DeclensionType = \kost',kosti -> + let kost = init kosti + in + { + snom = kost' ; + sgen = kost + "i" ; + sdat = kost + "i" ; + sacc = kost' ; + sloc = kost + "i" ; + sins = kost' + "ou" ; + + pnom = kost + "i" ; + pgen = kosti ; + pdat = kost + "iam" ; + pacc = kost + "i" ; + ploc = kost + "iach" ; + pins = kost' + "ami" ; + + g = Fem + } ; + + mestoN : DeclensionType = \mesto -> + let + mest = init mesto ; + miest : Str = case mest of { + m + "e" + c@(? | (? + ?)) => m + "ie" + c ; + _ => mest ---- TODO: many more rules + } ; + mesta = addAccented mest "á" "a" + + in + { + snom = mesto ; sgen = mest + "a" ; sdat = mest + "u" ; - sloc = mest + "u" ; --- "ě" - sins = mest + "em" ; + sacc = mesto ; + sloc = mest + "e" ; + sins = mest + "om" ; + + pnom = mesta ; + pgen = miest ; + pdat = mesta + "m" ; + pacc = mesta ; + ploc = mesta + "ch" ; + pins = mest + "ami" ; - pnom,pacc = mest + "a" ; - pgen = mest ; --- léta - let - pdat = mest + "ům" ; - ploc = mest + "ech" ; --- with variations - pins = mest + "y" ; g = Neutr } ; - declMUZ : DeclensionType = \muz_ -> --- 3.5.3 : sdat,sloc ; pnom - let muz = dropFleetingE muz_ + srdceN : DeclensionType = \srdce -> + let srdc = init srdce in { - snom = muz_ ; - sgen,sacc = muz + "e" ; --- pacc - sdat,sloc = muz + "i" ; --- muzovi - svoc = case muz_ of { - chlap + "ec" => chlap + "če" ; - _ => muz + "i" - } ; - sins = muz + "em" ; + snom = srdce ; + sgen = srdc + "a" ; + sdat = srdc + "u" ; + sacc = srdce ; + sloc = srdc + "i" ; + sins = srdc + "om" ; - pnom = case muz_ of { - uci + "tel" => uci + "telé" ; - _ => muz + "i" --- muzové - } ; - pgen = muz + "ů" ; - pacc = muz + "e" ; - pdat = muz + "ům" ; - ploc = muz + "ích" ; - pins = muz + "i" ; - g = Masc Anim - } ; + pnom = srdc + "ia" ; + pgen = srdc ; ---- TODO sŕdc + pdat = srdc + "iam" ; + pacc = srdc + "ia" ; + ploc = srdc + "iach" ; + pins = srdc + "ami" ; - declSOUDCE : DeclensionType = \soudce -> --- 3.5.3: sdat/sloc i,ovi ; pnom i/ové - let soudc = init soudce - in - { - snom,sgen,sacc,svoc = soudce ; ---- pacc - sdat,sloc = soudc + "i" ; --- soudcovi - sins = soudc + "em" ; - - pnom = soudc + "i" ; --- soudcové - pgen = soudc + "ů" ; - pdat = soudc + "ům" ; - pacc = soudce ; - ploc = soudc + "ích" ; - pins = soudc + "i" ; - g = Masc Anim - } ; - - declSTROJ : DeclensionType = \stroj -> - { - snom,sacc = stroj ; - sgen = stroj + "e" ; --- pnom,pacc - sdat,svoc,sloc = stroj + "i" ; --- pins ---- svoc shorten? - sins = stroj + "em" ; - - pnom,pacc = stroj + "e" ; - pgen = stroj + "ů" ; - pdat = stroj + "ům" ; - ploc = stroj + "ích" ; - pins = stroj + "i" ; - g = Masc Inanim - } ; - - declRUZE : DeclensionType = \ruze -> --- 3.6.2: pgen ulice-ulic, chvile-cvil - let ruz = init ruze - in - { - snom,sgen,svoc = ruze ; --- pnom,pacc - sdat,sacc,sloc = ruz + "i" ; - sins = ruz + "í" ; - - pnom,pacc = ruze ; - pgen = shortFemPlGen ruze ; - pdat = ruz + "ím" ; - ploc = ruz + "ích" ; - pins = ruz + "emi" ; - g = Fem - } ; - - declPISEN : DeclensionType = \pisen -> - let pisn = dropFleetingE pisen - in - { - snom,sacc = pisen ; - sgen = pisn + "ě" ; - sdat,svoc,sloc = pisn + "i" ; -- not shortened - sins = pisn + "í" ; - - pnom,pacc = pisn + "ě" ; - pgen = pisn + "í" ; - pdat = pisn + "ím" ; - ploc = pisn + "ích" ; - pins = pisn + "ěmi" ; - g = Fem - } ; - - declKOST : DeclensionType = \kost -> - { - snom,sacc = kost ; - sgen,sdat,svoc,sloc = kost + "i" ; --- pnom,pacc - sins = kost + "í" ; --- pgen - - pnom,pacc = kost + "i" ; - pgen = kost + "í" ; - pdat = kost + "em" ; - ploc = kost + "ech" ; - pins = kost + "mi" ; - g = Fem - } ; - - declKURE : DeclensionType = \kure -> - let kur = init kure - in - { - snom,sacc,svoc = kure ; - sgen = kur + "ete" ; - sdat,sloc = kur + "eti" ; - sins = kur + "etem" ; - - pnom,pacc = kur + "ata" ; - pgen = kur + "at" ; - pdat = kur + "atům" ; - ploc = kur + "atech" ; - pins = kur + "aty" ; g = Neutr } ; - declMORE : DeclensionType = \more -> --- 3.7.2 pgen zero sometimes - let mor = init more + vysvedcenieN : DeclensionType = \vysvedcenie -> + let + vysvedceni = init vysvedcenie ; + vysvedcen = init vysvedceni in { - snom,sgen,sacc,svoc = more ; --- pnom - sdat,sloc = mor + "i" ; --- pins - sins = mor + "em" ; + snom = vysvedcenie ; + sgen = vysvedceni + "a" ; + sdat = vysvedceni + "u" ; + sacc = vysvedcenie ; + sloc = vysvedcen + "í" ; + sins = vysvedcen + "ím" ; + + pnom = vysvedceni + "a" ; + pgen = vysvedcen + "í" ; + pdat = vysvedceni + "am" ; + pacc = vysvedceni + "a" ; + ploc = vysvedceni + "ach" ; + pins = vysvedceni + "ami" ; - pnom,pacc = more ; - pgen = mor + "í" ; --- - pdat = mor + "ím" ; - ploc = mor + "ích" ; - pins = mor + "i" ; g = Neutr } ; - declSTAVENI : DeclensionType = \staveni -> + dievcaN : DeclensionType = \dievca -> + let dievc = init dievca + in { - snom,sgen,sdat,sacc,svoc,sloc = staveni ; - sins = staveni + "m" ; + snom = dievca ; + sgen = dievca + "ťa" ; + sdat = dievca + "ťu" ; + sacc = dievca ; + sloc = dievca + "ti" ; + sins = dievca + "ťom" ; + + pnom = dievca + "tá" ; + pgen = dievc + "iat" ; + pdat = dievca + "tám" ; + pacc = dievca + "tá" ; + ploc = dievca + "tách" ; + pins = dievca + "tami" ; - pnom,pgen,pacc = staveni ; - pdat = staveni + "m" ; - ploc = staveni + "ch" ; - pins = staveni + "mi" ; g = Neutr } ; + -- with variant plural forms of the previous + dievceniecN : DeclensionType = \dievca -> + let dievc = init dievca + in dievcaN dievca ** { + pnom = dievc + "ence" ; + pgen = dievc + "eniec" ; + pdat = dievc + "encom" ; + pacc = dievc + "ence" ; + ploc = dievc + "encoch" ; + pins = dievc + "encami" ; + } ; + --------------------------- -- Adjectives @@ -429,15 +448,16 @@ oper ---- TODO other degrees than positive AdjForms : Type = { - msnom, fsnom, nsnom : Str ; -- svoc = snom - msgen, fsgen : Str ; -- nsgen = msgen, pacc = fsgen - msdat, fsdat : Str ; -- nsdat = msdat + msnom, fsnom, nsnom : Str ; + msgen, fsgen : Str ; -- nsgen = msgen + msdat : Str ; -- nsdat = msdat fsacc : Str ; -- amsacc = msgen, imsacc = msnom, nsacc = nsnom msloc : Str ; -- fsloc = fsdat, nsloc = msloc msins, fsins : Str ; -- nsins = msins, pdat = msins - mpnom,fpnom : Str ; -- pvoc = pnom, impnom = fpnom, npnom = fsnom - pgen : Str ; -- ploc = pgen + ampnom : Str ; -- *pnom = nsnom + pgen : Str ; -- + -- pdat = msins, ampacc = pgen, *pacc = nsnom, ploc = pgen pins : Str ; } ; @@ -446,103 +466,142 @@ oper adjFormsAdjective : AdjForms -> Adjective = \afs -> { s = \\g,n,c => case of { - - | => afs.msnom ; - - | => afs.fsnom ; - => afs.nsnom ; - + + | => afs.msnom ; + => afs.fsnom ; + + | => afs.nsnom ; | => afs.msgen ; - - | => afs.fsgen ; - + => afs.fsgen ; => afs.msdat ; - => afs.fsdat ; => afs.fsacc ; - => afs.msloc ; - | => afs.msins ; => afs.fsins ; - => afs.mpnom ; - => afs.fpnom ; - - => afs.pgen ; + => afs.ampnom ; + + | => afs.pgen ; => afs.pins } } ; --- hard declension + guessAdjForms : Str -> AdjForms + = \s -> case s of { + _ + "ý" => peknyA s ; + _ + "y" => krasnyA s ; + _ + "í" => cudziA s ; + _ + "i" => rydziA s ; + _ + ("ov"|"in") => otcovA s ; + _ => otcovA ("??"+s) ---- Predef.error ("no mkA for" ++ s) + } ; - mladyAdjForms : Str -> AdjForms = \mlady -> - let mlad = init mlady + +-- hard consonant + y + + peknyA : Str -> AdjForms = \pekny -> + let pekn = init pekny in { - msnom = mlad + "ý" ; - fsnom = mlad + "á" ; - nsnom,fsgen,fsdat,fpnom = mlad + "é" ; - msgen = mlad + "ého" ; - msdat = mlad + "ému" ; - fsacc,fsins = mlad + "ou" ; - msloc = mlad + "ém" ; - msins,pdat = mlad + "ým" ; - mpnom = addAdjI mlad ; - pgen = mlad + "ých" ; - pins = mlad + "ými" ; + msnom = pekn + "ý" ; + fsnom = pekn + "á" ; + nsnom = pekn + "é" ; + msgen = pekn + "ého" ; + fsgen = pekn + "ej" ; + msdat = pekn + "ému" ; + fsacc = pekn + "ú" ; + msloc = pekn + "om" ; + msins = pekn + "ým" ; + fsins = pekn + "ou" ; + ampnom = pekn + "í" ; + pgen = pekn + "ých" ; + pins = pekn + "ými" ; } ; --- soft declension +-- if the penultimate has accent, e.g. krásny, the last accent disappears + krasnyA : Str -> AdjForms = \krasny -> + let + krasn = init krasny ; + in peknyA krasny ** { + msnom = krasn + "y" ; + fsnom = krasn + "a" ; + nsnom = krasn + "e" ; + msgen = krasn + "eho" ; + msdat = krasn + "emu" ; + fsacc = krasn + "u" ; + msins = krasn + "ym" ; + ampnom = krasn + "i" ; + pgen = krasn + "ych" ; + pins = krasn + "ymi" ; + } ; - jarniAdjForms : Str -> AdjForms = \jarni -> - { - msnom,fsnom,nsnom, - fsgen,fsdat,fsacc,fsins, - mpnom,fpnom = jarni ; - msgen = jarni + "ho" ; - msdat = jarni + "mu" ; - msloc,msins = jarni + "m" ; - pgen = jarni + "ch" ; - pins = jarni + "mi" ; +-- soft consonant + i + + cudziA : Str -> AdjForms = \cudzi -> + let cudz = init cudzi + in { + msnom = cudz + "í" ; + fsnom = cudz + "ia" ; + nsnom = cudz + "ie" ; + msgen = cudz + "ieho" ; + fsgen = cudz + "ej" ; + msdat = cudz + "iemu" ; + fsacc = cudz + "iu" ; + msloc = cudz + "om" ; + msins = cudz + "ím" ; + fsins = cudz + "ou" ; + ampnom = cudz + "í" ; + pgen = cudz + "ích" ; + pins = cudz + "ími" ; + } ; + +-- accented vowel + soft consonant + i + rydziA : Str -> AdjForms = \rydzi -> + let rydz = init rydzi + in peknyA rydzi ** { + msnom = rydz + "i" ; + fsnom = rydz + "a" ; + nsnom = rydz + "e" ; + msgen = rydz + "eho" ; + msdat = rydz + "emu" ; + fsacc = rydz + "u" ; + msins = rydz + "im" ; + ampnom = rydz + "i" ; + pgen = rydz + "ich" ; + pins = rydz + "imi" ; } ; -- masculine possession: the same endings as in feminine - otcuvAdjForms : Str -> AdjForms = \otcuv -> - let otcov = Predef.tk 2 otcuv + "ov" - in - matcinAdjForms otcov ** {msnom = otcuv} ; - --- feminine possession - - matcinAdjForms : Str -> AdjForms = \matcin -> + otcovA : Str -> AdjForms = \otcov -> { - msnom = matcin ; - fsnom,msgen = matcin + "a" ; - nsnom = matcin + "o" ; - fsgen,fpnom = matcin + "y" ; - msdat,fsacc = matcin + "u" ; - fsdat,msloc = matcin + "ě" ; - msins = matcin + "ým" ; - fsins = matcin + "ou" ; - mpnom = matcin + "i" ; - pgen = matcin + "ých" ; - pins = matcin + "ými" ; + msnom = otcov ; + fsnom = otcov + "a" ; + nsnom = otcov + "o" ; + msgen = otcov + "ho" ; + fsgen = otcov + "ej" ; + msdat = otcov + "mu" ; + fsacc = otcov + "u" ; + msloc = otcov + "om" ; + msins = otcov + "ým" ; + fsins = otcov + "ou" ; + ampnom = otcov + "i" ; + pgen = otcov + "ých" ; + pins = otcov + "ými" ; } ; --------------------- -- Verbs +-- https://en.wikipedia.org/wiki/Slovak_language#Verbs - VerbForms : Type = { ---- TODO more forms to add + VerbForms : Type = { ---- TODO more forms to add ? inf, pressg1, pressg2, pressg3, prespl1, prespl2, prespl3, - pastpartsg, pastpartpl, ----- passpart, - negpressg3 : Str -- matters only for copula + pastpmasc, pastpfem, pastpneutr : Str } ; ComplementCase : Type = {s : Str ; c : Case ; hasPrep : Bool} ; @@ -551,38 +610,36 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { = \vf,a,b -> case a of { Ag _ Sg P1 => vf.pressg1 ; Ag _ Sg P2 => vf.pressg2 ; - Ag _ Sg P3 => case b of { - True => vf.pressg3 ; - False => vf.negpressg3 -- matters only for copula - } ; + Ag _ Sg P3 => vf.pressg3 ; Ag _ Pl P1 => vf.prespl1 ; Ag _ Pl P2 => vf.prespl2 ; Ag _ Pl P3 => vf.prespl3 } ; copulaVerbForms : VerbForms = { - inf = "být" ; - pressg1 = "jsem" ; - pressg2 = "jsi" ; + inf = "byť" ; + pressg1 = "som" ; + pressg2 = "si" ; pressg3 = "je" ; - prespl1 = "jsme" ; - prespl2 = "jste" ; - prespl3 = "jsou" ; - pastpartsg = "byl" ; - pastpartpl = "byli" ; - negpressg3 = "ní" ; -- ne is added to this + prespl1 = "sme" ; + prespl2 = "ste" ; + prespl3 = "sú" ; + pastpmasc = "bol" ; + pastpfem = "bola" ; + pastpneutr = "bolo" ; } ; haveVerbForms : VerbForms = { - inf = "mít" ; + inf = "mať" ; pressg1 = "mám" ; pressg2 = "máš" ; - pressg3, negpressg3 = "má" ; + pressg3 = "má" ; prespl1 = "máme" ; prespl2 = "máte" ; - prespl3 = "mají" ; - pastpartsg = "měl" ; - pastpartpl = "měli" ; + prespl3 = "majú" ; + pastpmasc = "mal" ; + pastpfem = "mala" ; + pastpneutr = "malo" ; } ; -- just an example of a traditional paradigm @@ -595,14 +652,15 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { in { inf = kupovat ; - pressg1 = kupu + "ji" ; --- kupuju + pressg1 = kupu + "jem" ; pressg2 = kupu + "ješ" ; - pressg3, negpressg3 = kupu + "je" ; + pressg3 = kupu + "je" ; prespl1 = kupu + "jeme" ; prespl2 = kupu + "jete" ; - prespl3 = kupu + "jí" ; --- kupujou - pastpartsg = kupo + "val" ; - pastpartpl = kupo + "vali" ; + prespl3 = kupu + "jú" ; + pastpmasc = "kupoval" ; + pastpfem = "kupovala" ; + pastpneutr = "kupovalo" ; } ; @@ -625,52 +683,51 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { {a = a ; cnom = []} ** case a of { Ag _ Sg P1 => { - nom = "já" ; - gen,acc,pgen,pacc = "mne" ; - cgen,cacc = "mě" ; - dat,pdat,loc = "mně" ; + nom = "ja" ; + gen,acc,pgen,pacc = "mňa" ; + cgen,cacc = "ma" ; + dat,pdat,loc = "mne" ; cdat = "mi" ; ins,pins = "mnou" } ; Ag _ Sg P2 => { nom = "ty" ; - gen,acc,pgen,pacc = "tebe" ; - cgen,cacc = "tě" ; - dat,pdat,loc = "tobě" ; + gen,acc,pgen,pacc = "teba" ; + cgen,cacc = "ťa" ; + dat,pdat,loc = "tebe" ; cdat = "ti" ; ins,pins = "tebou" } ; Ag (Masc _) Sg P3 => { nom = "on" ; - gen,acc = "jeho" ; + gen,acc = "jeho" ; ---- + other forms cgen,cacc = "ho" ; - pgen,pacc = "něho" ; + pgen,pacc = "neho" ; ---- + other forms dat = "jemu" ; cdat = "mu" ; - pdat = "němu" ; - loc = "něm" ; - ins = "jím" ; - pins = "ním" ; + pdat = "nemu" ; + loc = "ňom" ; + ins,pins = "ním" ; } ; Ag Fem Sg P3 => { nom = "ona" ; - gen = "její" ; - dat,acc,cgen,cacc,cdat,ins = "ji" ; - pgen,pdat,pacc,loc,pins = "ní" ; + gen,cgen,pgen,acc,cacc,pacc = "ju" ; + cdat = "jej" ; + dat,pdat,loc = "nej" ; + ins,pins = "ní" ; } ; Ag Neutr Sg P3 => { nom = "ono" ; gen = "jeho" ; cgen,cacc = "ho" ; - pgen = "něho" ; + pgen = "neho" ; dat = "jemu" ; acc = "je" ; - pacc = "ně" ; + pacc = "eň" ; ---- bind? cdat = "mu" ; - pdat = "němu" ; - loc = "něm" ; - ins = "jím" ; - pins = "ním" ; + pdat = "nemu" ; + loc = "ňom" ; + ins,pins = "ním" ; } ; Ag _ Pl P1 => { nom = "my" ; @@ -679,7 +736,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { pgen,pacc, loc = "nás" ; dat,cdat,pdat = "nám" ; - ins,pins = "námi" ; + ins,pins = "nami" ; } ; Ag _ Pl P2 => { nom = "vy" ; @@ -688,23 +745,25 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { pgen,pacc, loc = "vás" ; dat,cdat,pdat = "vám" ; - ins,pins = "vámi" ; + ins,pins = "vami" ; } ; - Ag g Pl P3 => { - nom = case g of { - Masc _ => "oni" ; - Fem => "ony" ; - Neutr => "ona" - } ; - gen,cgen = "jich" ; - pgen = "nich" ; - dat,cdat = "jim" ; + Ag (Masc Anim) Pl P3 => { + nom = "oni" ; + gen,cgen,acc,cacc = "ich" ; + pgen,pacc = "nich" ; + dat,cdat = "im" ; pdat = "nim" ; - acc,cacc = "je" ; - pacc = "ně" ; loc = "nich" ; - ins = "jimi" ; - pins = "nimi" ; + ins,pins = "nimi" ; + } ; + Ag _ Pl P3 => { + nom = "ony" ; + gen,cgen,acc,cacc = "ich" ; + pgen,pacc = "ne" ; + dat,cdat = "im" ; + pdat = "nim" ; + loc = "nich" ; + ins,pins = "nimi" ; } } ; @@ -714,13 +773,13 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { oper DemPronForms : Type = { - msnom, fsnom, nsnom, - msgen, fsgen, + msnom, fsnom, nsnom, + msgen, fsgen, pgen, msdat, -- fsdat = fsgen unlike AdjForms fsacc, msloc, msins, fsins, - mpnom, fpnom, -- mpacc = fpacc = fpnom + ampnom, fpnom, -- mpacc = fpacc = fpnom pgen, pdat, -- NOT msins like AdjForms pins : Str @@ -744,45 +803,45 @@ oper size : NumSize } ; - mkDemPronForms : Str -> DemPronForms = \t -> { - msnom = t + "en" ; - fsnom = t + "a" ; - nsnom = t + "o" ; - msgen = t + "oho" ; - fsgen = t + "é" ; - msdat = t + "omu" ; - fsacc = t + "u" ; - msloc = t + "om" ; - msins = t + "ím" ; - fsins = t + "ou" ; - mpnom = t + "i" ; - fpnom = t + "y" ; - pgen = t + "ěch" ; - pdat = t + "ěm" ; - pins = t + "ěmi" ; + mkDemPronForms : Str -> DemPronForms = \jedn -> { + msnom = jedn + "y" ; + fsnom = jedn + "a" ; + nsnom = jedn + "o" ; + msgen = jedn + "ého" ; + fsgen = jedn + "ej" ; + msdat = jedn + "ému" ; + fsacc = jedn + "u" ; + msloc = jedn + "om" ; + msins = jedn + "ým" ; + fsins = jedn + "ou" ; + ampnom = jedn + "i" ; + fpnom = jedn + "é" ; ---- ? + pgen = jedn + "ých" ; + pdat = jedn + "ým" ; + pins = jedn + "ými" ; } ; invarDemPronForms : Str -> DemPronForms = \s -> { msnom, fsnom, nsnom, msgen, fsgen, msdat, fsacc, msloc, msins, fsins, - mpnom, fpnom, pgen, pdat, pins = s ; + ampnom, fpnom, pgen, pdat, pins = s ; } ; -- interrogatives kdoForms : Case => Str = table { - Nom => "kdo" ; - Gen | Acc | Voc => "koho" ; + Nom => "kto" ; + Gen | Acc => "koho" ; Dat => "komu" ; Loc => "kom" ; Ins => "kým" } ; coForms : Case => Str = table { - Nom|Acc|Voc => "co" ; - Gen => "čeho" ; + Nom|Acc => "čo" ; + Gen => "čoho" ; Dat => "čemu" ; - Loc => "čem" ; + Loc => "čom" ; Ins => "čím" } ; @@ -790,6 +849,7 @@ oper -- singular forms of demonstratives NumeralForms : Type = { + ---- amsnom, msnom, fsnom, nsnom, msgen, fsgen, msdat, @@ -802,11 +862,14 @@ oper \nume,size -> let dem = nume ** - {mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used + {ampnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used demAdj = dem ** {fsdat = dem.fsgen} ; adjAdj = adjFormsAdjective demAdj in { - s = \\g,c => adjAdj.s ! g ! Sg ! c ; + s = \\g,c => case of { +---- => nume.amsnom ; + _ => adjAdj.s ! g ! Sg ! c + } ; size = size } ; @@ -816,41 +879,48 @@ oper -- numbers 2,3,4 ---- to check if everything comes out right with the determiner type twoNumeral : Determiner = let forms = { - msnom = "dva" ; fsnom, nsnom, fsacc = "dvě" ; - msgen, fsgen, msloc = "dvou" ; - msdat, msins, fsins = "dvěma" +---- amsnom = "dvaja" ; + msnom = "dva" ; fsnom, nsnom, fsacc = "dve" ; + msgen, fsgen, msloc = "dvoch" ; + msdat = "dvom" ; + msins, fsins = "dvoma" } in numeralFormsDeterminer forms Num2_4 ; threeNumeral : Determiner = let forms = { - msnom, fsnom, nsnom, fsacc, msgen, fsgen = "tři" ; - msdat = "třem" ; - msloc = "třech" ; - msins,fsins = "třemi" ; + ---- amsnom = "traja" ; + msnom, fsnom, nsnom, fsacc = "tri" ; ---- amsacc = "troch" + msgen, fsgen = "troch" ; + msdat = "trom" ; + msloc = "troch" ; + msins,fsins = "tromi" ; } in numeralFormsDeterminer forms Num2_4 ; fourNumeral : Determiner = - let forms = { - msnom, fsnom, nsnom, fsacc = "čtyři" ; - msgen, fsgen = "čtyř" ; - msdat = "čtyřem" ; - msloc = "čtyřech" ; - msins,fsins = "čtyřmi" ; + let forms = { + ---- amsnom = "štiraja" ; + msnom, fsnom, nsnom, fsacc = "štiri" ; ---- amsacc = "štiroch" + msgen, fsgen = "štiroch" ; + msdat = "štirom" ; + msloc = "štiroch" ; + msins,fsins = "štiromi" ; } in numeralFormsDeterminer forms Num2_4 ; -- for the numbers 5 upwards - regNumeral : Str -> Str -> Determiner = \pet,peti -> + regNumeral : Str -> Str -> Str -> Str -> Determiner = \pät,piatich,piatim,piatimi -> let forms = { - msnom,fsnom,nsnom = pet ; - msgen, fsgen, msdat, fsacc, msloc, msins, fsins = peti + msnom,fsnom,nsnom, fsacc = pät ; + msgen, fsgen, msloc = piatich ; + msdat = piatim ; + msins, fsins = piatimi ; } in numeralFormsDeterminer forms Num5 ; invarDeterminer : Str -> NumSize -> Determiner = \sto,size -> - regNumeral sto sto ; + regNumeral sto sto sto sto ; invarNumeral : Str -> Determiner = \s -> invarDeterminer s Num5 ; diff --git a/src/slovak/StructuralSlo.gf b/src/slovak/StructuralSlo.gf index 6fea21060..214ca9fe2 100644 --- a/src/slovak/StructuralSlo.gf +++ b/src/slovak/StructuralSlo.gf @@ -4,20 +4,20 @@ concrete StructuralSlo of Structural = CatSlo ** lin and_Conj = mkConj "a" ; by8agent_Prep = mkPrep "od" Gen ; ---- TODO this means "from", there might be no good translation - few_Det = invarNumeral "málo" ; -- CEG 6.8 --- TODO genitive mála + few_Det = invarNumeral "málo" ; ----- for_Prep = mkPrep "pro" accusative ; - from_Prep = mkPrep (pre {"s"|"z" => "ze" ; _ => "z"}) Gen ; ---- consonant clusters + from_Prep = mkPrep (pre {"s"|"z" => "zo" ; _ => "z"}) Gen ; ---- consonant clusters have_V2 = mkV2 haveVerbForms ; - in_Prep = mkPrep (pre {"v"|"m" => "ve" ; _ => "v"}) Loc ; ---- - many_Det = regNumeral "mnoho" "mnoha" ; -- CEG 6.8 ---- - or_Conj = mkConj "nebo" ; - somePl_Det = regNumeral "několik" "několika" ; -- CEG 6.8 ---- - something_NP = {s,clit,prep = \\c => "ně" + coForms ! c ; a = Ag Neutr Sg P3 ; hasClit = False} ; -- CEG 5.6.3 + in_Prep = mkPrep (pre {"v"|"m" => "vo" ; _ => "v"}) Loc ; ---- + many_Det = regNumeral "mnoho" "mnohých" "mnohým" "mnohými" ; -- CEG 6.8 ---- + or_Conj = mkConj "alebo" ; + somePl_Det = {s = \\g,c => (demPronFormsAdjective (mkDemPronForms "nektor") "").s ! g ! Pl ! c ; size = Num5} ; + something_NP = {s,clit,prep = \\c => "nie" + coForms ! c ; a = Ag Neutr Sg P3 ; hasClit = False} ; -- CEG 5.6.3 possess_Prep = mkPrep "" Gen ; that_Quant = demPronFormsAdjective (mkDemPronForms "tamt") "" ; this_Quant = demPronFormsAdjective (mkDemPronForms "t") "to" ; to_Prep = mkPrep "do" Gen ; - with_Prep = mkPrep (pre {"s"|"z" => "se" ; _ => "s"}) Ins ; ---- + with_Prep = mkPrep (pre {"s"|"z" => "so" ; _ => "s"}) Ins ; ---- i_Pron = personalPron (Ag (Masc Anim) Sg P1) ; youSg_Pron = personalPron (Ag (Masc Anim) Sg P2) ; diff --git a/src/turkish/AllTur.gf b/src/turkish/AllTur.gf index 343381bf1..fb1524e2a 100644 --- a/src/turkish/AllTur.gf +++ b/src/turkish/AllTur.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common:../prelude concrete AllTur of AllTurAbs = - LangTur, - ExtendTur + LangTur +-- ,ExtendTur ** {} ;