diff --git a/src/hungarian/AdverbHun.gf b/src/hungarian/AdverbHun.gf index 78a9bbb59..ed7b74737 100644 --- a/src/hungarian/AdverbHun.gf +++ b/src/hungarian/AdverbHun.gf @@ -12,7 +12,7 @@ lin -- : Prep -> NP -> Adv ; PrepNP prep np = { - s = np.s ! prep.c ++ prep.s ; + s = prep.pr ++ np.s ! prep.c ++ prep.s ; } ; -- Adverbs can be modified by 'adadjectives', just like adjectives. diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 159b97ad7..287dc7182 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -87,7 +87,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { -- Constructed in StructuralHun. Conj = ResHun.Conj ; Subj = SS ; - Prep = ResHun.Postposition ; + Prep = ResHun.Adposition ; diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index ddf556728..f7bac7224 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -32,7 +32,7 @@ lincat 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 ; + ConjNP co xs = conjunctDistrTable Case co xs ** xs ** {agr = }; -- Relative sentences lincat diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 79336d236..80fa8dc9a 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -5,12 +5,12 @@ concrete LexiconHun of Lexicon = CatHun ** -- A -- lin add_V3 = mkV3 "" ; --- lin airplane_N = mkN "" ; +lin airplane_N = mkN "repülőgép" "repülőgépet" ; -- lin alas_Interj = mkInterj "" ; -- lin already_Adv = mkA "" ; --- lin animal_N = mkN "" ; ---lin answer_V2S = mkV2S "válasz" ; --- lin apartment_N = mkN "" ; +lin animal_N = mkN "állat" ; +-- lin answer_V2S = mkV2S "válasz" ; +lin apartment_N = mkN "lakás" ; lin apple_N = mkN "alma" ; lin art_N = mkN "müvészet" ; -- lin ashes_N = mkN "" ; @@ -21,79 +21,79 @@ lin art_N = mkN "müvészet" ; lin baby_N = mkN "bébi" ; -- lin back_N = mkN "" ; --- lin bad_A = mkA "" ; +lin bad_A = mkA "rossz" ; lin bank_N = mkN "bank" ; -- lin bark_N = mkN "" ; --- lin beautiful_A = mkA "" ; +lin beautiful_A = mkA "szép" ; -- lin become_VA = mkVA "" ; -lin beer_N = mkN "sör" ; +lin beer_N = mkN "sör" "sört" ; -- lin beg_V2V = mkV2 "" ; lin belly_N = mkN "has" ; lin big_A = mkA "nagy" ; --- lin bike_N = mkN "" ; +lin bike_N = mkN "bicikli" ; lin bird_N = mkN "madár" ; -- lin bite_V2 = mkV2 "" ; lin black_A = mkA "fekete" ; --- lin blood_N = mkN "" ; +lin blood_N = mkN "vér" ; -- lin blow_V = mkV "" ; lin blue_A = mkA "kék" ; --- lin boat_N = mkN "" ; +lin boat_N = mkN "hajó" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; --- lin book_N = mkN "" ; +lin book_N = mkN "könyv" ; lin boy_N = mkN "fiú" ; --- lin bread_N = mkN "" ; --- lin break_V2 = mkV2 "" ; --- lin breast_N = mkN "" ; +lin bread_N = mkN "kenyér" ; +lin break_V2 = mkV2 "szünet" ; +lin breast_N = mkN "mell" ; -- lin breathe_V = mkV "" ; -- lin broad_A = mkA "" ; --- lin brother_N2 = mkN "" ; --- lin brown_A = mkA "" ; +-- lin brother_N2 = mkN "öccsém" ; (possessive form?) +lin brown_A = mkA "barna" ; -- lin burn_V = mkV "" ; --- lin butter_N = mkN "" ; +lin butter_N = mkN "vaj" ; -- lin buy_V2 = mkV2 "" ; ---- -- C --- lin camera_N = mkN "" ; +lin camera_N = mkN "fényképezőgép" ; -- lin cap_N = mkN "" ; --- lin car_N = mkN "" ; --- lin carpet_N = mkN "" ; +lin car_N = mkN "autó" ; +lin carpet_N = mkN "szőnyeg" ; lin cat_N = mkN "macska" ; --- lin ceiling_N = mkN "" ; --- lin chair_N = mkN "" ; --- lin cheese_N = mkN "" ; +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 "" ; +lin church_N = mkN "templom" ; lin city_N = mkN "város" ; --- lin clean_A = mkA "" ; --- lin clever_A = mkA "" ; --- lin close_V2 = mkV2 "" ; --- lin cloud_N = mkN "" ; +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 cold_A = mkA "" ; +lin cold_A = mkA "hideg" ; -- lin come_V = mkV "" ; --- lin computer_N = mkN "" ; --- lin correct_A = mkA "" ; +lin computer_N = mkN "számítógép" ; +lin correct_A = mkA "igaz" ; -- lin count_V2 = mkV2 "" ; lin country_N = mkN "ország" ; --- lin cousin_N = mkN "" ; --- lin cow_N = mkN "" ; +lin cousin_N = mkN "unokatestvér" ; --short "unoka" +lin cow_N = mkN "tehén" ; -- lin cut_V2 = mkV2 "" ; -- -- ---- -- -- D -- --- lin day_N = mkN "" ; +lin day_N = mkN "nap" ; -- 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 "" ; --- lin dog_N = mkN "" ; +lin doctor_N = mkN "orvos" ; +lin dog_N = mkN "kutya" ; lin door_N = mkN "ajtó" ; -- lin drink_V2 = mkV2 "" ; -- lin dry_A = mkA "" ; @@ -103,44 +103,44 @@ lin door_N = mkN "ajtó" ; ---- -- E --- lin ear_N = mkN "" ; --- lin earth_N = mkN "" ; +lin ear_N = mkN "fül" ; +lin earth_N = mkN "föld" ; -- lin eat_V2 = mkV2 "" ; --- lin egg_N = mkN "" ; --- lin empty_A = mkA "" ; --- lin enemy_N = mkN "" ; +lin egg_N = mkN "tojás" ; +lin empty_A = mkA "üres" ; +lin enemy_N = mkN "ellenség" ; lin eye_N = mkN "szem" ; ---- -- F --- lin factory_N = mkN "" ; +lin factory_N = mkN "gyár" ; -- lin fall_V = mkV "" ; -- lin far_Adv = mkA "" ; --- lin fat_N = mkN "" ; --- lin father_N2 = mkN2 "" ; +lin fat_N = mkN "kövér" ; +lin father_N2 = mkN2 "apa" ; -- lin fear_V2 = mkV2 "" ; -- lin fear_VS = mkVS "" ; --- lin feather_N = mkN "" ; +lin feather_N = mkN "madártoll" ; -- lin fight_V2 = mkV2 "" ; -- lin find_V2 = mkV2 "" ; --- lin fingernail_N = mkN "" ; --- lin fire_N = mkN "" ; +lin fingernail_N = mkN "köröm" ; +lin fire_N = mkN "tűz" ; lin fish_N = mkN "hal" ; -- lin float_V = mkV "" ; --- lin floor_N = mkN "" ; +lin floor_N = mkN "padló" ; -- lin flow_V = mkV "" ; --- lin flower_N = mkN "" ; +lin flower_N = mkN "vírág" ; lin fly_V = mkV "repül" ; --- lin fog_N = mkN "" ; --- lin foot_N = mkN "" ; --- lin forest_N = mkN "" ; +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 forget_V2 = mkV2 "" ; -- lin freeze_V = mkV "" ; --- lin fridge_N = mkN "" ; --- lin friend_N = mkN "" ; +lin fridge_N = mkN "hűtő" ; +lin friend_N = mkN "barát" ; lin fruit_N = mkN "gyümölcs" ; --- lin full_A = mkA "" ; +lin full_A = mkA "tele" ; -- --lin fun_AV ---- @@ -149,48 +149,48 @@ lin fruit_N = mkN "gyümölcs" ; lin garden_N = mkN "kert" ; lin girl_N = mkN "lány" ; -- lin give_V3 = mkV3 "" ; --- lin glove_N = mkN "" ; +lin glove_N = mkN "kesztyű" ; -- lin go_V = mkV "" ; lin gold_N = mkN "arany" ; --- lin good_A = mkA "" ; --- lin grammar_N = mkN "" ; --- lin grass_N = mkN "" ; --- lin green_A = mkA "" ; +lin good_A = mkA "jó" ; +lin grammar_N = mkN "nyelvtan" ; +lin grass_N = mkN "fű" ; +lin green_A = mkA "zöld" ; ---- -- H --- lin hair_N = mkN "" ; +lin hair_N = mkN "haj" ; lin hand_N = mkN "kéz" ; -- lin harbour_N = mkN "" ; --- lin hat_N = mkN "" ; +lin hat_N = mkN "kalap" ; -- lin hate_V2 = mkV2 "" ; lin head_N = mkN "fej" ; -- lin hear_V2 = mkV2 "" ; --- lin heart_N = mkN "" ; --- lin heavy_A = mkA "" ; +lin heart_N = mkN "szív" ; +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 hot_A = mkA "" ; +lin hot_A = mkA "forró" ; lin house_N = mkN "ház" ; -- lin hunt_V2 = mkV2 "" ; --- lin husband_N = mkN "" ; +lin husband_N = mkN "férj" ; -------- -- I - K --- lin ice_N = mkN "" ; --- lin industry_N = mkN "" ; --- lin iron_N = mkN "" ; +lin ice_N = mkN "jég" ; +lin industry_N = mkN "ipar" ; +lin iron_N = mkN "vas" ; -- lin john_PN = mkPN "" ; -- lin jump_V = mkV "" ; -- lin kill_V2 = mkV2 "" ; --- lin king_N = mkN "" ; --- lin knee_N = mkN "" ; +lin king_N = mkN "király" ; +lin knee_N = mkN "térd" ; -- lin know_V2 = mkV2 "" ; -- lin know_VQ = mkVQ "" ; -- lin know_VS = mkV "" ; @@ -199,15 +199,15 @@ lin house_N = mkN "ház" ; ---- -- L --- lin lake_N = mkN "" ; --- lin lamp_N = mkN "" ; --- lin language_N = mkN "" ; +lin lake_N = mkN "tó" ; +lin lamp_N = mkN "lámpa" ; +lin language_N = mkN "nyelv" ; -- lin laugh_V = mkV "" ; --- lin leaf_N = mkN "" ; +lin leaf_N = mkN "levél" ; -- lin learn_V2 = mkV2 "" ; --- lin leather_N = mkN "" ; +lin leather_N = mkN "bőr" ; -- lin leave_V2 = mkV2 "" ; --- lin leg_N = mkN "" ; +lin leg_N = mkN "láb" ; -- lin lie_V = mkV "" ; -- lin like_V2 = mkV2 "" ; -- lin listen_V2 = mkV2 "" ; @@ -216,7 +216,7 @@ lin house_N = mkN "ház" ; -- lin long_A = mkA "" ; -- lin lose_V2 = mkV2 "" ; -- lin louse_N = mkN "" ; --- lin love_N = mkN "" ; +lin love_N = mkN "szerelem" ; -- lin love_V2 = mkV2 "" ; ---- @@ -224,46 +224,46 @@ lin house_N = mkN "ház" ; 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 "" ; --- lin milk_N = mkN "" ; --- lin moon_N = mkN "" ; +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 "" ; --- lin mouth_N = mkN "" ; --- lin music_N = mkN "" ; +lin mountain_N = mkN "hegy" ; +lin mouth_N = mkN "száj" ; +lin music_N = mkN "zene" ; ---- -- N -lin name_N = mkN "név" ; --- lin narrow_A = mkA "" ; --- lin near_A = mkA "" ; --- lin neck_N = mkN "" ; --- lin new_A = mkA "" ; --- lin newspaper_N = mkN "" ; --- lin night_N = mkN "" ; --- lin nose_N = mkN "" ; +lin name_N = mkN "név" "nevet" ; +lin narrow_A = mkA "keskeny" ; --also "szűk" +lin near_A = mkA "közel" ; +lin neck_N = mkN "nyak" ; +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 now_Adv = mkAdv "most" ; --- lin number_N = mkN "" ; +lin number_N = mkN "szám" ; -- -- -------- -- -- O - P -- -- lin oil_N = mkN "olaj" ; --- lin old_A = mkA "" ; +lin old_A = mkA "öreg" ; --also "idős" -- lin open_V2 = mkV2 "" ; -- lin paint_V2A = mkV2A "" ; --- lin paper_N = mkN "" ; +lin paper_N = mkN "papír" ; -- lin paris_PN = mkPN "Paris" ; lin peace_N = mkN "béke" ; --- lin pen_N = mkN "" ; +lin pen_N = mkN "toll" ; lin person_N = mkN "ember" ; --- lin planet_N = mkN "" ; --- lin plastic_N = mkN "" ; +lin planet_N = mkN "bolygó" ; +lin plastic_N = mkN "műanyag" ; -- lin play_V = mkV "" ; --- lin policeman_N = mkN "" ; --- lin priest_N = mkN "" ; +lin policeman_N = mkN "rendőr" ; --the police "rendőrség" +lin priest_N = mkN "pap" ; -- lin pull_V2 = mkV2 "" ; -- lin push_V2 = mkV2 "" ; -- lin put_V2 = mkV2 "" ; @@ -271,42 +271,42 @@ lin person_N = mkN "ember" ; -- -------- -- -- Q - R -- --- lin queen_N = mkN "" ; +lin queen_N = mkN "kírálynő" ; lin question_N = mkN "kérdés" ; --- lin radio_N = mkN "" ; --- lin rain_N = mkN "" ; +lin radio_N = mkN "rádió" ; +lin rain_N = mkN "eső" ; -- lin rain_V0 = mkV "" ; -- lin read_V2 = mkV2 "" ; --- lin ready_A = mkA "" ; --- lin reason_N = mkN "" ; +lin ready_A = mkA "kész" ; +lin reason_N = mkN "ok" ; lin red_A = mkA "piros" ; --- lin religion_N = mkN "" ; --- lin restaurant_N = mkN "" ; --- lin river_N = mkN "" ; +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 "" ; --- lin roof_N = mkN "" ; --- lin root_N = mkN "" ; --- lin rope_N = mkN "" ; +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 rotten_A = mkA "" ; -- lin round_A = mkA "" ; -- lin rub_V2 = mkV2 "" ; --- lin rubber_N = mkN "" ; --- lin rule_N = mkN "" ; +lin rubber_N = mkN "gumi" ; +lin rule_N = mkN "szabály" ; -- lin run_V = mkV "" ; ---- -- S --- lin salt_N = mkN "" ; --- lin sand_N = mkN "" ; +lin salt_N = mkN "só" ; +lin sand_N = mkN "homok" ; -- lin say_VS = mkVS "" ; --- lin school_N = mkN "" ; --- lin science_N = mkN "" ; +lin school_N = mkN "iskola" ; +lin science_N = mkN "tudomány" ; -- lin scratch_V2 = mkV2 "" ; --- lin sea_N = mkN "" ; +lin sea_N = mkN "tenger" ; lin see_V2 = mkV2 "lát" ; --- lin seed_N = mkN "" ; +lin seed_N = mkN "mag" ; -- lin seek_V2 = mkV2 "" ; -- lin sell_V3 = mkV3 "" ; -- lin send_V3 = mkV3 "" ; @@ -314,42 +314,42 @@ lin see_V2 = mkV2 "lát" ; -- lin sharp_A = mkA "" ; -- lin sheep_N = mkN "" fem ; -- lin ship_N = mkN "" ; -lin shirt_N = mkN "ing" ; +lin shirt_N = mkN "ing" ; --shirt like t-shirt or the more formal? lin shoe_N = mkN "cipő" ; --- lin shop_N = mkN "" ; --- lin short_A = mkA "" ; --- lin silver_N = mkN "" ; +lin shop_N = mkN "üzlet" ; +lin short_A = mkA "rövid" ; --in short text, if human length then "alacsony" +lin silver_N = mkN "ezüst" ; -- lin sing_V = mkV "" ; -- lin sister_N = mkN "" ; -- lin sit_V = mkV "" ; --- lin skin_N = mkN "" ; --- lin sky_N = mkN "" ; +lin skin_N = mkN "bőr" ; +lin sky_N = mkN "ég" ; -- lin sleep_V = mkV "" ; --- lin small_A = mkA "" ; +lin small_A = mkA "kicsi" ; -- lin smell_V = mkV "" ; --- lin smoke_N = mkN "" ; --- lin smooth_A = mkA "" ; --- lin snake_N = mkN "" ; --- lin snow_N = mkN "" ; --- lin sock_N = mkN "" ; --- lin song_N = mkN "" ; +lin smoke_N = mkN "füst" ; +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 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 "" ; --- lin steel_N = mkN "" ; --- lin stick_N = mkN "" ; +lin star_N = mkN "csillag" ; +lin steel_N = mkN "acél" ; +lin stick_N = mkN "rúd" ; lin stone_N = mkN "kő"; -- lin stop_V = mkV "" ; -- lin stove_N = mkN "" ; --- lin straight_A = mkA "" ; --- lin student_N = mkN "" ; --- lin stupid_A = mkA "" ; +lin straight_A = mkA "egyenes" ; +lin student_N = mkN "diák" ; +lin stupid_A = mkA "buta" ; --also "hülye" -- lin suck_V2 = mkV2 "" ; --- lin sun_N = mkN "" ; +lin sun_N = mkN "nap" ; --same as day -- lin swell_V = mkV "" ; -- lin swim_V = mkV "" ; @@ -358,31 +358,31 @@ lin stone_N = mkN "kő"; lin table_N = mkN "asztal" ; --- lin tail_N = mkN "" ; +lin tail_N = mkN "farok" ; lin talk_V3 = mkV3 "beszél" ; -- lin teach_V2 = mkV2 "" ; lin teacher_N = mkN "tanár" ; --- lin television_N = mkN "" ; --- lin thick_A = mkA "" ; --- lin thin_A = mkA "" ; +lin television_N = mkN "tévé" ; --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 "" ; --- lin tooth_N = mkN "" ; --- lin train_N = mkN "" ; +lin tongue_N = mkN "nyelv" ; --same as language +lin tooth_N = mkN "fog" ; +lin train_N = mkN "vonat" ; -- lin travel_V = mkV "" ; --- lin tree_N = mkN "" ; +lin tree_N = mkN "fa" ; -- lin turn_V = mkV "" ; -------- -- U - V --- lin ugly_A = mkA "" ; +lin ugly_A = mkA "csúf" ; -- lin uncertain_A = mkA "" ; -- lin understand_V2 = mkV2 "" ; --- lin university_N = mkN "" ; +lin university_N = mkN "egyetem" ; lin village_N = mkN "falu" ; -- lin vomit_V = mkV2 "" ; @@ -391,28 +391,29 @@ lin village_N = mkN "falu" ; -- lin wait_V2 = mkV2 "" ; -- lin walk_V = mkV "" ; --- lin war_N = mkN "" ; --- lin warm_A = mkA "" ; +lin war_N = mkN "háború" ; +lin warm_A = mkA "meleg" ; -- lin wash_V2 = mkV2 "" ; -- lin watch_V2 = mkV2 "" ; lin water_N = mkN "víz" ; --- lin wet_A = mkA "" ; --- lin white_A = mkA "" ; --- lin wide_A = mkA "" ; --- lin wife_N = mkN "" ; +lin wet_A = mkA "nedves" ; +lin white_A = mkA "fehér" ; +lin wide_A = mkA "széles" ; +lin wife_N = mkN "feleség" ; -- lin win_V2 = mkV2 "" ; --- lin wind_N = mkN "" ; +lin wind_N = mkN "szél" ; lin window_N = mkN "ablak" ; lin wine_N = mkN "bor" ; --- lin wing_N = mkN "" ; +lin wing_N = mkN "szárny" ; -- lin wipe_V2 = mkV2 "" ; -lin woman_N = mkN "nő" "k" harmO ; +--lin woman_N = mkN "nő" "k" harmO ; +lin woman_N = mkN "nő" "nőket" ; -- lin wonder_VQ = mkVQ "" ; --- lin wood_N = mkN "" ; --- lin worm_N = mkN "" ; +lin wood_N = mkN "fa" ; --same as tree +lin worm_N = mkN "féreg" ; --also "kukac" -- lin write_V2 = mkV2 "" ; --- lin year_N = mkN "" ; --- lin yellow_A = mkA "" ; --- lin young_A = mkA "" ; +lin year_N = mkN "év" ; +lin yellow_A = mkA "sárga" ; +lin young_A = mkA "fiatal" ; } diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index d26722630..b995be70a 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -8,7 +8,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : Det -> CN -> NP DetCN det cn = emptyNP ** det ** { - s = \\c => det.s ! c ++ cn.s ! det.n ! c ; + s = \\c => det.s ! Nom ++ cn.s ! det.n ! c ; agr = ; } ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index b09c33c68..40acfc2aa 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -6,9 +6,9 @@ oper -- Paradigm functions -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf - -- Words like alma, kefe: - dAlma : Str -> Noun = \alma -> - let almá : Str = lengthen alma ; + -- Words like "alma, kefe, apa, anya, fa": + dAlma : (nom : Str) -> (acc : Str) -> Noun = \alma,almát -> + let almá : Str = init almát ; -- Apply mkNoun to the lengthened stem "almá" or "kefé" nAlmá : Noun = mkNoun almá ; @@ -24,12 +24,8 @@ oper -- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural -- No special case here - dMadár : Str -> Noun = \madár -> - let r = last madár ; - madá = init madár ; - mada = shorten madá ; -- shortens vowels - a = last mada ; - madara = mada + r + a ; + 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 { @@ -44,26 +40,19 @@ oper } ; --Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. - -- "lovon" instead of "lón" fixed but that gives the following problems: - --TODO: special case "lén" not "leven" - --TODO: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting - dLó : Str -> Noun = \ló -> - let lo = shorten ló ; - lov = lo + "v" ; - ak : Str = case ló of { - _ + ("ö" | "ő") => "ek" ; - _ + ("o" | "ó") => "ak" ; - lé => shorten (last lé) + "k"} ; - harmonyPlural : Harm = case ló of { - _ + ("ö" | "ő") => H_e ; -- All plural allomorphs have E harmony, singular ones have O. - _ + ("o" | "ó") => H_a ; - lé => getHarm (lé)} ; - nLov = mkNounHarm harmonyPlural ak lov ; + --Also handles "tó, hó" which are "tavak, havak" in plural! + -- "lovon" instead of "lón" fixed + dLó : (nom : Str) -> (acc : Str) -> Noun = \ló, lovat -> + let lova = init lovat ; + lov = init lova ; + nLov = mkNoun lov ; + nLova = mkNoun lova ; nLó = mkNoun ló ; in {s = \\n,c => case of { - -- All plural forms and Sg Acc, Sg Sup use the "lov" stem - | | => nLov.s ! n ! c ; + -- All plural forms and Sg Acc, Sg Sup use the "lova" stem + | => nLova.s ! n ! c ; + => nLov.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "ló" as the stem. @@ -72,52 +61,21 @@ oper } ; } ; - --Handles words like "tó, hó"" which are "tavak, havak" in plural. - --(Since I only have these examples for now I do a simplified case with ó, a) - -- "tavon" instead of "tón" case fixed, works automatically with the Sup rules - --TODO: szó special case which fulfills the plural cases but not the or case ("szót" not "szavat") - dTó : Str -> Noun = \tó -> - let t = init tó ; - tav = t + "av" ; - nTav = mkNounHarm H_a "ak" tav ; - nTó = mkNoun tó ; - in {s = \\n,c => case of { - - -- All plural forms and Sg Acc use the "tav" stem - || => nTav.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "tó" as the stem. - _ => nTó.s ! n ! c - - } ; - } ; - --Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) --More examples: "ajak, bokor, cukor, csokor, eper, fészek, fodor, gödör, haszon, iker, izom, kölyök, köröm, méreg, piszok, sarok, selyem, szeder, szobor, takony, terem, titok, torok, torony, tükör, vödör" -> -- "ajkat, bokrot, cukrot, csokrot, epret, fészket, fodrot, gödröt, hasznot, ikret, izmot, kölyköt, körmet, mérget, piszkot, sarkot, selymet, szedret, szobrot, taknyot, termet, titkot, torkot, tornyot, tükröt, vödröt" + --ALso handles words like "sátor, álom, alkalom, farok, halom, vászon" + -- "sátrat, álmat, alkalmat, farkat, halmat, vásznat" -- case handled - dMajom : Str -> Noun = \majom -> - -- Str*Str is syntactic sugar for {p1 : Str ; p2 : Str} ; - -- confusing syntax: you can't write let : Str*Str = … - -- it has to be called something else, and then you - -- can get "tako" and "ny" with p1, p2. - let tako_ny : Str*Str = case majom of { - x + dzs@#trigraph => ; - x + zs@#digraph => ; - -- ? pattern matches exactly 1 character - x + s@? => } ; - tako = tako_ny.p1 ; - ny = tako_ny.p2 ; - - nyo = ny + last tako ; - tak = init tako ; - taknyo = tak + nyo ; - nMajmo = mkNounHarm (getHarm taknyo) "k" taknyo ; + dMajom : (nom : Str) -> (acc : Str) -> Noun = \majom, majmot -> + let majmo = init majmot ; + 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 ; + => nMajmo.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "majom" as the stem. @@ -125,25 +83,6 @@ oper } ; } ; - --Handles words like "sátor, álom, alkalom, farok, halom, vászon" - -- "sátrat, álmat, alkalmat, farkat, halmat, vásznat" - -- (bátor not noun) - dFarok : Str -> Noun = \farok -> - let k = last farok ; - far = init (init farok) ; - fark = far + k ; - nFark = mkNounHarm (getHarm fark) "ak" fark ; - nFarok = mkNoun farok ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc and Sg Sup use the "fark" stem - | | => nFark.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "farok" as the stem. - _ => nFarok.s ! n ! c - } ; - } ; - -- More words not covered by current paradigms: -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf -- TODO: falu ~ falva-k (v-case) @@ -152,19 +91,79 @@ oper -- regNoun is a /smart paradigm/: it takes one or a couple of forms, -- and decides which (non-smart) paradigm is the most likely to match. - regNoun : Str -> Noun = \sgnom -> case sgnom of { - _ + "a"|"e" => dAlma sgnom ; - _ + ("á"|"é") + ? => dMadár sgnom ; - _ + ("ó"|"ő") => dLó sgnom ; - _ + "alom" => dFarok sgnom ; - _ + "elem" => dMajom sgnom ; +regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> + case of { + -- alma, almát + <_ + "a", _ + "át"> + |<_ + "e" ,_ + "ét"> => dAlma n a ; - -- TODO: more non-smart paradigms + more pattern matching - -- TODO: smart paradigms with >1 form. Which forms are the most descriptive? - _ => mkNoun sgnom -- Fall back to the regular paradigm + <_ + "á" + #c, -- madár, madarat + _ + "a" + #c + #v + "t"> + + |<_ + "é" + #c, -- név, nevet + _ + "e" + #c + #v + "t"> + + |<_ + "í" + #c, -- víz, vizet + _ + "i" + #c + #v + "t"> => dMadár n a ; + + + <_ + #v + #c, -- majom, majmot + _ + #c + #v + "t"> => dMajom n a ; + + + <_ + "ó", -- ló, lovat + _ + "o" + #c + #v + "t"> + + |<_ + "ő", -- kő, követ + _ + "ö" + #c + #v + "t"> + + |<_ + "é", -- lé, levet + _ + "e" + #c + #v + "t"> => dLó n a ; + + _ => mkNoun n } ; + 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); + _ => mkNoun sgnom -- Fall back to the regular paradigm + } where { + név2nevet : Str -> Str = \név -> + let né_v : Str*Str = case név of {né + v@#c => } ; + né = né_v.p1 ; + v = né_v.p2 ; + ne = shorten né ; + e = case last ne of { + "i" => "e" ; + _ => last ne } ; + in ne + v + e + "t" ; + ló2lovat : Str -> Str = \ló -> + let lo = shorten ló ; + lov = lo + "v" ; + at : Str = case ló of { + _ + "ó" => "at" ; + _ => "et" } ; + in lov + at ; + majom2majmo : Str -> Str = \majom -> + let majo_m : Str*Str = case majom of {majo + m@#c => } ; + majo = majo_m.p1 ; + m = majo_m.p2 ; + mo = m + last majo ; + maj = init majo ; + in maj + mo + } ; + +--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 @@ -177,6 +176,16 @@ oper -- Vowels as a pattern. v : pattern Str = #("a" | "e" | "i" | "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") ; + + -- 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") ; + -- Digraphs digraph : pattern Str = #("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") ; @@ -194,7 +203,7 @@ oper x + "ty" => x + "tty" ; x + "zs" => x + "zzs" ; - -- Base cacse: just duplicate the single letter + -- Base case: just duplicate the single letter x + s@? => x + s + s } ; -- Function to test if a string ends in a vowel @@ -274,6 +283,13 @@ oper _ => endCaseCons c } ; + -- Variant where accusative has the allomorph -t for consonants + -- Examples: "pénz, bor, orr, szín, lány, kés, dal" + endCaseConsAcc : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + _ => endCaseCons c + } ; + -- Variant of case forms when the noun stem ends in vowel. endCaseVow : Case -> HarmForms = \c -> case c of { Acc => harm1 "t" ; @@ -286,12 +302,16 @@ oper } ; -- Function to return a plural allomorph given the stem (e.g. név, almá). - -- TODO: seems to be many "ak" cases, add? - -- Examples: ág, ágy, ár, díj, fal, fog, gyár, hal, has, hát, ház, hold, láz, lyuk, nyak, olaj, oldal, toll, ujj, vonal - pluralAllomorph : (stem : Str) -> Str = \stem -> - case vowFinal stem of { - True => "k" ; - False => harm3 "ok" "ek" "ök" ! getHarm stem + pluralAllomorph : (stem : Str) -> Str = pluralAllomorphLowStem False ; + + -- Function to return a plural allomorph given lowering stem or not + -- Examples of lowering stems: ág, ágy, ár, fal, fog, gyár, hal, has, hát, ház, hold, láz, lyuk, nyak, olaj, oldal, toll, ujj, vonal + -- Examples of lowering stems: férj, fej, hely, fül, könny, könyv, mell, szög + pluralAllomorphLowStem : (low : Bool) -> (stem : Str) -> Str = \low,stem -> + case of { + <_,True> => "k" ; + => harm "ak" "ek" ! getHarm stem ; + _ => harm3 "ok" "ek" "ök" ! getHarm stem } ; @@ -303,10 +323,14 @@ 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 { - => endCaseVow ; - => endCaseConsAccAt ; - _ => endCaseCons} ; + 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 ; diff --git a/src/hungarian/NounMorphoHunOneArgument.gf b/src/hungarian/NounMorphoHunOneArgument.gf new file mode 100644 index 000000000..979b63269 --- /dev/null +++ b/src/hungarian/NounMorphoHunOneArgument.gf @@ -0,0 +1,361 @@ +resource NounMorphoHunOneArgument = ParamHun ** open Prelude, Predef in { + +oper + Noun = {s : Number => Case => Str} ; + + -- Paradigm functions + -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf + + -- Words like "alma, kefe, apa, anya, fa": + dAlma : Str -> Noun = \alma -> + let almá : Str = lengthen alma; + + nAlmá : Noun = mkNoun almá ; + in {s = \\n,c => case of { + -- Singular nominative uses the given form, e.g. "alma" or "kefe" + => alma ; + + -- The rest of the forms are formed with the regular constructor, + -- using "almá" or "kefé" as the stem. + _ => nAlmá.s ! n ! c + } ; + } ; + +-- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural +-- No special case here +-- dMadár: "víz" has wovel shortening but "vizek" not "vizik", implement differently? +dMadár : Str -> Noun = \madár -> + let r = last madár ; + madá = init madár ; + mada = shorten madá ; -- shortens vowels + a = last mada ; + a = case a of { + "e"|"i" => "e" ; + a => a + } ; + madara = mada + r + a ; + nMadara = mkNounHarm (getHarm madara) "k" madara ; + nMadár = mkNoun madár ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc use the "madara"/"neve" stem + | => nMadara.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "madár"/"név" as the stem. + _ => nMadár.s ! n ! c + + } ; + } ; + +--Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. +-- "lovon" instead of "lón" fixed but that gives the following problems: +dLó : Str -> Noun = \ló -> + let lo = shorten ló ; + lov = lo + "v" ; + ak : Str = case ló of { + _ + ("ö" | "ő") => "ek" ; + _ + ("o" | "ó") => "ak" ; + lé => shorten (last lé) + "k"} ; + harmonyPlural : Harm = case ló of { + _ + ("ö" | "ő") => H_e ; -- All plural allomorphs have E harmony, singular ones have O. + _ + ("o" | "ó") => H_a ; + lé => getHarm (lé)} ; + nLov = mkNounHarm harmonyPlural ak lov ; + nLó = mkNoun ló ; + in {s = \\n,c => case of { + + -- All plural forms and Sg Acc, Sg Sup use the "lov" stem + | | => nLov.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "ló" as the stem. + _ => nLó.s ! n ! c + + } ; + } ; + +--Handles words like "tó, hó"" which are "tavak, havak" in plural. +--(Since I only have these examples for now I do a simplified case with ó, a) +-- "tavon" instead of "tón" case fixed, works automatically with the Sup rules +dTó : Str -> Noun = \tó -> + let t = init tó ; + tav = t + "av" ; + nTav = mkNounHarm H_a "ak" tav ; + nTó = mkNoun tó ; + in {s = \\n,c => case of { + + -- All plural forms and Sg Acc use the "tav" stem + || => nTav.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "tó" as the stem. + _ => nTó.s ! n ! c + + } ; + } ; + +--Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) +--More examples: "ajak, bokor, cukor, csokor, eper, fészek, fodor, gödör, haszon, iker, izom, kölyök, köröm, méreg, piszok, sarok, selyem, szeder, szobor, takony, terem, titok, torok, torony, tükör, vödör" -> +-- "ajkat, bokrot, cukrot, csokrot, epret, fészket, fodrot, gödröt, hasznot, ikret, izmot, kölyköt, körmet, mérget, piszkot, sarkot, selymet, szedret, szobrot, taknyot, termet, titkot, torkot, tornyot, tükröt, vödröt" +-- case handled +dMajom : Str -> Noun = \majom -> + -- Str*Str is syntactic sugar for {p1 : Str ; p2 : Str} ; + -- confusing syntax: you can't write let : Str*Str = … + -- it has to be called something else, and then you + -- can get "tako" and "ny" with p1, p2. + let tako_ny : Str*Str = case majom of { + x + dzs@#trigraph => ; + x + zs@#digraph => ; + -- ? pattern matches exactly 1 character + x + s@? => } ; + tako = tako_ny.p1 ; + ny = tako_ny.p2 ; + + nyo = ny + last tako ; + tak = init tako ; + taknyo = tak + nyo ; + nMajmo = mkNounHarm (getHarm taknyo) "k" taknyo ; + nMajom = mkNoun majom ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem + | | => nMajmo.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "majom" as the stem. + _ => nMajom.s ! n ! c + } ; + } ; + +--Handles words like "sátor, álom, alkalom, farok, halom, vászon" +-- "sátrat, álmat, alkalmat, farkat, halmat, vásznat" +-- (bátor not noun) +dFarok : Str -> Noun = \farok -> + let k = last farok ; + far = init (init farok) ; + fark = far + k ; + nFark = mkNounHarm (getHarm fark) "ak" fark ; + nFarok = mkNoun farok ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc and Sg Sup use the "fark" stem + | | => nFark.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "farok" as the stem. + _ => nFarok.s ! n ! c + } ; + } ; + +-- More words not covered by current paradigms: +-- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf +-- TODO: falu ~ falva-k (v-case) +-- TODO: teher ~ terhet (consonant-crossing) +-- TODO: do we need possessive forms? e.g. fiú ~ fia{m,d,tok} + +-- regNoun is a /smart paradigm/: it takes one or a couple of forms, +-- and decides which (non-smart) paradigm is the most likely to match. +regNoun : Str -> Noun = \sgnom -> case sgnom of { + _ + "a"|"e" => dAlma sgnom ; + (? | #digraph | #trigraph) + ("á"|"é") + (? | #digraph | #trigraph) => mkNoun sgnom ; + _ + ("á"|"é") + ? => dMadár sgnom ; + _ + "é"|"ő"|"ű" => dLó sgnom ; + _ + "ó" => dTó sgnom ; + _ + "alom" => dFarok sgnom ; + _ + "elem" => dMajom sgnom ; + + -- TODO: more non-smart paradigms + more pattern matching + -- TODO: smart paradigms with >1 form. Which forms are the most descriptive? + + _ => mkNoun sgnom -- Fall back to the regular paradigm +} ; + +--TODO: Special cases (enter these words manually to not complicate the paradigms): +--dTó: szó special case which fulfills the plural cases but not the or case ("szót" not "szavat") +--dLó: special case "lén" not "leven" +--dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting +--endCaseConsAcc: "falat, fület, várat, könnyet", +--also special in superessive case "falon, fülek, vizen" +--pattern matching in regNoun: one-syllable words that in fact belong to dMadár: "nyár, név" +--------------------------------------------------------------------------------------------- +-- Following code by EG in 2009 (?), comments and some additions by IL 2020 + +param + -- Harmony types + Harm = H_a | H_e | H_o ; + +oper + + -- Vowels as a pattern. + v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | + "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; + -- Digraphs + digraph : pattern Str = #("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") ; + + -- Trigraphs + trigraph : pattern Str = #("dzs") ; + + duplicateLast : Str -> Str = \str -> case str of { + x + "dzs" => x + "ddzs" ; + x + "ny" => x + "nny" ; -- takony : takonnyal + x + "cs" => x + "ccs" ; + x + "dz" => x + "ddz" ; + x + "gy" => x + "ggy" ; + x + "ly" => x + "lly" ; + x + "sz" => x + "ssz" ; + x + "ty" => x + "tty" ; + x + "zs" => x + "zzs" ; + + -- Base cacse: just duplicate the single letter + x + s@? => x + s + s } ; + + -- Function to test if a string ends in a vowel + vowFinal : Str -> Bool = \str -> + case str of { + _ + #v => True ; -- Matching a string against a pattern. + _ => False + } ; + + lengthen : Str -> Str = \str -> case str of { + x + "a" => x + "á" ; + x + "e" => x + "é" ; + x + "i" => x + "í" ; + x + "o" => x + "ó" ; + x + "u" => x + "ú" ; + x + "ö" => x + "ő" ; + x + "ü" => x + "ű" ; + _ => Predef.error "Lengthening not applicable to" ++ str + } ; + + shorten : Str -> Str = \str -> case str of { + x + "á" => x + "a" ; + x + "é" => x + "e" ; + x + "í" => x + "i" ; + x + "ó" => x + "o" ; + x + "ú" => x + "u" ; + x + "ő" => x + "ö" ; + x + "ű" => x + "ü" ; + _ => Predef.error "Shortening not applicable to" ++ str + } ; + + -- Function to get a harmony from a string + getHarm : Str -> Harm = \s -> case s of { + _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; + _ + ("ö" | "ő" | "ü") + _ => H_o ; + _ => H_e + } ; + + -- Used as a table of allomorphs for a give case. + HarmForms : Type = Harm => Str ; + + -- Functions for constructing a HarmForms table. + harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> table { + H_a => a ; + H_e => e ; + H_o => o + } ; + harm : Str -> Str -> HarmForms = \a,e -> harm3 a e e ; + harm1 : Str -> HarmForms = \i -> harm i i ; + + -- Variant of case forms when the noun stem ends in consonant. + endCaseCons : Case -> HarmForms = \c -> case c of { + Nom => harm1 [] ; + Acc => harm3 "ot" "et" "öt" ; + Dat => harm "nak" "nek" ; + Ill => harm "ba" "be" ; + Ine => harm "ban" "ben" ; + Ela => harm "ból" "ből" ; + All => harm3 "hoz" "hez" "höz" ; + Ade => harm "nál" "nél" ; + Abl => harm "tól" "től" ; + Sub => harm "ra" "re" ; + Sup => harm3 "on" "en" "ön" ; + Del => harm "ról" "ről" ; + Cau => harm1 "ért" ; + Ins => harm "al" "el" ; + Tra => harm "á" "é" + -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' + -- Ter => harm1 "ig" ; -- Terminative 'as far as ' + -- For => harm1 "ként" ; -- Formal 'as ' + -- Tem => harm1 "kor" -- Temporal 'at '. Only used with numerals. + } ; + + -- Variant where accusative has the allomorph -at + endCaseConsAccAt : Case -> HarmForms = \c -> case c of { + Acc => harm3 "at" "et" "öt" ; + _ => endCaseCons c + } ; + + -- Variant where accusative has the allomorph -t for consonants + -- Examples: "pénz, bor, orr, szín, lány, kés, dal" + endCaseConsAcc : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + _ => endCaseCons c + } ; + + -- Variant of case forms when the noun stem ends in vowel. + endCaseVow : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + Sup => harm1 "n" ; + Ins => harm "val" "vel" ; + Tra => harm "vá" "vé" ; + + -- Other forms are shared with endCaseCons. + _ => endCaseCons c + } ; + + -- Function to return a plural allomorph given the stem (e.g. név, almá). + pluralAllomorph : (stem : Str) -> Str = pluralAllomorphLowStem False ; + + -- Function to return a plural allomorph given lowering stem or not + -- Examples of lowering stems: ág, ágy, ár, fal, fog, gyár, hal, has, hát, ház, hold, láz, lyuk, nyak, olaj, oldal, toll, ujj, vonal + -- Examples of lowering stems: férj, fej, hely, fül, könny, könyv, mell, szög + pluralAllomorphLowStem : (low : Bool) -> (stem : Str) -> Str = \low,stem -> + case of { + <_,True> => "k" ; + => harm "ak" "ek" ! getHarm stem ; + _ => harm3 "ok" "ek" "ök" ! getHarm stem + } ; + + + -- Harmony and plural allomorph read from the singular nominative + mkNoun : Str -> Noun = \w -> + mkNounHarm (getHarm w) (pluralAllomorph w) w ; + + -- Harmony and plural allomorph given explicitly (check if the True makes it bad) + mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = mkNounHarmAcc True ; + + mkNounHarmAcc : (useAt : Bool) -> Harm -> (plural : Str) -> Str -> Noun = \useAt,h,plural,w -> + let endCaseSg : Case -> HarmForms = case of { + <_,_ + #v> => endCaseVow ; + <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j" + |"ly"|"l"|"r"|"n"|"ny"|"ssz"|"zz" + |"ss"|"ll"|"rr"|"nn"|"ns"|"nsz" + |"nz")> => endCaseConsAcc ; + => endCaseConsAccAt ; + _ => endCaseCons } ; + endCasePl : Case -> HarmForms = case of { + <"ak",_> => endCaseConsAccAt ; + <_,True> => endCaseConsAccAt ; + _ => endCaseCons } ; + -- Last consonant doubles before instrumental and translative + duplConsStem : Str = case vowFinal w of { + True => w ; + False => duplicateLast w } ; + + -- Noun is {s : Number => Case => Str}, we construct nested tables. + in {s = table { + Sg => table { + -- Double the last letter (if consonant) before Ins, Tra + c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; + c@_ => w + endCaseSg c ! h } ; + + Pl => table { + -- Double the plural k before Ins, Tra + c@(Ins|Tra) => w + plural + "k" + endCasePl c ! h ; + + -- endCaseCons, because we only use -k as plural morpheme. + -- If we add possessive forms with allomorph -i, then revise. + c@_ => w + plural + endCasePl c ! h } + } + } ; + +} diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 247fe301f..da89f54f8 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -1,4 +1,5 @@ -resource ParadigmsHun = open CatHun, ResHun, ParamHun, NounHun, Prelude in { +resource ParadigmsHun = open + CatHun, ResHun, ParamHun, NounHun, Prelude in { oper @@ -17,8 +18,8 @@ oper --2 Nouns mkN : overload { - mkN : (sgnom : Str) -> N ; -- Predictable nouns - mkN : (madár : Str) -> (ak : Str) -> N ; -- Noun with unpredictable plural allomorph + 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 : (férfi : Str) -> (harm : Harmony) -> (ak : Str) -> N ; -- Noun with unpredictable vowel harmony and plural allomorph } ; @@ -37,7 +38,8 @@ oper mkA2 : overload { mkA2 : Str -> Prep -> A2 ; - mkA2 : Str -> Case -> A2 + mkA2 : Str -> Case -> A2 ; + mkA2 : A -> Prep -> A2 ; } ; --2 Verbs @@ -85,6 +87,9 @@ oper mkPrep : Str -> Case -> Prep ; -- Postposition and case } ; + prePrep : Str -> Case -> Prep -- Preposition + = \s,c -> lin Prep {pr=s ; s=[] ; c=c} ; + casePrep : Case -> Prep ; -- No postposition, only case -- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num -> @@ -118,7 +123,7 @@ oper \s -> lin N (regNoun s) ; mkN : Str -> Str -> N = - \s,ak -> lin N (mkNounHarm (getHarm s) ak s) ; + \n,a-> lin N (regNounNomAcc n a) ; mkN : Str -> Harmony -> N = \s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ; @@ -146,10 +151,13 @@ oper } ; mkA2 = overload { + mkA2 : A -> A2 = \a -> a ** {c2 = casePrep Nom} ; mkA2 : Str -> Prep -> A2 = \s,p -> lin A2 {s = (mkAdj s).s ; c2 = p} ; mkA2 : Str -> Case -> A2 = \s,c -> - lin A2 {s = (mkAdj s).s ; c2 = {s = [] ; c = c}} + lin A2 {s = (mkAdj s).s ; c2 = casePrep c} ; + mkA2 : A -> Prep -> A2 = \a,p -> + lin A2 (a ** {c2 = p}) ; } ; mkV = overload { diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 4d6697933..5426e0d24 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -102,14 +102,18 @@ oper } ; -------------------------------------------------------------------------------- --- Postpositions +-- Adpositions -- TODO: personal suffixes, e.g. felettem, általam, not *felett/által én - Postposition : Type = {s : Str ; c : Case} ; + Adposition : Type = { + pr : Str ; -- Preposition + s : Str ; -- Postposition + c : Case ; + } ; - mkPrep : Str -> Postposition = \str -> {s=str ; c=Nom} ; + mkPrep : Str -> Adposition = \str -> {s=str ; c=Nom ; pr=[]} ; - emptyPP : Postposition = mkPrep [] ; + emptyAdp : Adposition = mkPrep [] ; ------------------ -- Conj @@ -144,7 +148,7 @@ oper s : Degree => Number => Str } ; Adjective2 : Type = Adjective ** { - c2 : Postposition ; + c2 : Adposition ; } ; mkAdj : Str -> Adjective = \sg -> { @@ -274,6 +278,10 @@ oper "vannak" "lenni" ; + megvan : Verb = copula ** { + s = \\vf => "meg" + copula.s ! vf ; + } ; + ------------------ -- VP @@ -326,9 +334,14 @@ oper Sentence : Type = {s : Str} ; predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** { - s = let rel : RClause = relVP' (np2rp np) vp ; - in \\t,a,p => rel.s ! t ! a ! p ! np.agr.p2 ! sc2case vp.sc - ++ np.empty ; -- standard trick for prodrop+metavariable problem + s = \\t,a,p => let subjcase : Case = case vp.sc of { + SCNom => Nom ; + SCDat => Dat } + in np.s ! subjcase + ++ vp.s ! agr2vf np.agr + ++ vp.obj + ++ vp.adv + ++ np.empty -- standard trick for prodrop+metavariable problem } ; -- Relative @@ -344,12 +357,12 @@ oper relVP' : RP ** {agr : Person*Number} -> VerbPhrase -> RClause = \rp,vp -> { s = \\t,a,p,n,c => let subjcase : Case = case vp.sc of { - SCNom => c ; + SCNom => Nom ; SCDat => Dat } in rp.s ! n ! subjcase - ++ vp.s ! VFin rp.agr.p1 n -- variable by number ++ vp.obj ++ vp.adv + ++ vp.s ! VFin rp.agr.p1 n -- variable by number } ; relSlash : RP -> ClSlash -> RClause = \rp,cls -> { diff --git a/src/hungarian/SentenceHun.gf b/src/hungarian/SentenceHun.gf index 7cbafa7c4..82f884ca0 100644 --- a/src/hungarian/SentenceHun.gf +++ b/src/hungarian/SentenceHun.gf @@ -15,7 +15,7 @@ lin --2 Clauses missing object noun phrases -- : NP -> VPSlash -> ClSlash ; - SlashVP np vps = predVP np (vps ** {s = vps.s ! Def ; obj = []}) ; + SlashVP np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = []}) ; {- -- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today AdvSlash cls adv = cls ** insertAdv adv cls ; diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index c74115449..d95b845e3 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -65,8 +65,8 @@ lin few_Det = mkDet "kevés" Def Sg ; -- TODO check lin many_Det = mkDet "sok" Def Sg ; -- TODO check --lin much_Det = -lin somePl_Det = mkDet "némely" Indef Pl ; -lin someSg_Det = mkDet "némely" Indef Sg ; +lin somePl_Det = mkDet "néhány" Indef Sg ; +lin someSg_Det = mkDet "néhány" Indef Sg ; --lin no_Quant = lin that_Quant = mkQuant "az" "az" ; @@ -215,6 +215,11 @@ lin yes_Utt = ss "igen" ; -- Verb lin have_V2 = datV2 copula ; +-- uncomment if prefer def obj with megvan +-- ** { +-- s = table {Indef => copula.s } ; +-- - Def => megvan.s } ; +-- } ; {-lin can8know_VV = can_VV ; -- can (capacity) lin can_VV = mkVV "" ; -- can (possibility) lin must_VV = mkVV "" ; diff --git a/src/hungarian/unittest/adjective.gftest b/src/hungarian/unittest/adjective.gftest index 242363533..c153d8675 100644 --- a/src/hungarian/unittest/adjective.gftest +++ b/src/hungarian/unittest/adjective.gftest @@ -23,12 +23,12 @@ LangHun: én pirosabb vagyok nálad ------------------ -- LangEng: I am reddest Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompAP (AdjOrd (OrdSuperl red_A))))))) NoVoc -LangHun: én legpirosabb vagyok +LangHun: én vagyok legpirosabb -- LangEng: I am the reddest Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompNP (DetNP (DetQuantOrd DefArt NumSg (OrdSuperl red_A)))))))) NoVoc -LangHun: én a legpirosabb vagyok +LangHun: én vagyok a legpirosabb --- !! I suspect this is nonsense +-- It works! Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompNP (DetNP (DetQuantOrd DefArt NumPl (OrdSuperl red_A)))))))) NoVoc LangHun: én a legpirosabbok vagyok diff --git a/src/hungarian/unittest/dative.gftest b/src/hungarian/unittest/dative.gftest index 2e81c531a..990bfc0fd 100644 --- a/src/hungarian/unittest/dative.gftest +++ b/src/hungarian/unittest/dative.gftest @@ -1,7 +1,17 @@ -- 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 macska +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 van a macska +LangHun: nekem megvan a macska + +--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 + +-- 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" diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 741ec01a1..0ceffde72 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -38,10 +38,10 @@ 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 +--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öröt +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 diff --git a/src/hungarian/unittest/relative.gftest b/src/hungarian/unittest/relative.gftest index 01a9c4d85..5a2dce4d5 100644 --- a/src/hungarian/unittest/relative.gftest +++ b/src/hungarian/unittest/relative.gftest @@ -2,40 +2,43 @@ -- These need to be correct -- ------------------------------ +--"ami" instead of "amit" for most examples -- 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 amit repül +LangHun: én látok egy férfit 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 amit repül +LangHun: én látom a férfit 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 amit lát egy macskát +LangHun: én látom a férfit 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 amit látja a macskát +LangHun: én látom a férfit 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 van egy macska +LangHun: én látom a férfit aminek egy macskája 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 van a macska +LangHun: én látom a férfit 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. +-- 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 amit repül és amit 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 amit repül és aminek van egy macska +LangHun: én látom a férfit ami repül és aminek egy macskája van ------------------------------------------------------------- @@ -44,13 +47,14 @@ LangHun: én látom a férfit amit repül és aminek van egy macska -- 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átja +LangHun: én látom a férfit amit a macska lát -- LangEng: I see a man that the cat sees --- Should this be "amit a macska lát"? +-- 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átja +LangHun: én látok egy férfit 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