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..4d70bedf3 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" ; -- 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" ; -- 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" ; -- 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" ; 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" ; -- 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" ; -- 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" ; +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" ; -- 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" ; +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..d214fae30 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,256 @@ 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 ; + 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 - } ; - } ; + SgSup -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem + | PlStem + | SgAccStem => nMajmo.s ! nc ; + + -- 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 * + <_ + #shortv + #c, -- majom, majmot + _ + #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 +369,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 +385,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 +415,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 } ; @@ -237,8 +459,8 @@ oper -- 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 +477,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 +530,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/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index da89f54f8..4da3067a3 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,7 +35,8 @@ oper --2 Adjectives mkA : overload { - mkA : (adj : Str) -> A ; -- Regular adjective, given in ??? form + mkA : (sgnom : Str) -> A ; -- Regular adjective, given in singular nominative + mkA : (sgnom, sgacc : Str) -> A ; -- Singular nominative and accusative -- mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A. } ; @@ -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,29 @@ oper } ; mkA = overload { - mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ; + mkA : (sgnom : Str) -> A = \s -> lin A (mkAdj s) ; + mkA : (sgnom,sgacc : Str) -> A = \n,a -> + lin A (mkAdj2 n (regNounNomAcc n a)) ; -- mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda -> -- jakda ** {s = \\af => kiga ++ jakda.s ! af} ; } ; 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 +199,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