From 7fee10e1e015746e9007b1a9b9626ca9a7f3b7b7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 27 Mar 2020 15:50:19 +0100 Subject: [PATCH 01/97] (Hun) Remove unnecessary files and code from copying English --- src/hungarian/AllEngHun.gf | 13 --- src/hungarian/AllHun.gf | 13 +-- src/hungarian/AllHunAbs.gf | 6 ++ src/hungarian/BackwardHun.gf | 80 --------------- src/hungarian/ExtraEngHun.gf | 40 -------- src/hungarian/ExtraHun.gf | 164 ------------------------------- src/hungarian/IrregHun.gf | 185 ----------------------------------- src/hungarian/IrregHunAbs.gf | 180 ---------------------------------- src/hungarian/MorphoHun.gf | 47 --------- src/hungarian/ParseEngHun.gf | 50 ---------- src/hungarian/ParseHun.gf | 101 ------------------- 11 files changed, 9 insertions(+), 870 deletions(-) delete mode 100644 src/hungarian/AllEngHun.gf create mode 100644 src/hungarian/AllHunAbs.gf delete mode 100644 src/hungarian/BackwardHun.gf delete mode 100644 src/hungarian/ExtraEngHun.gf delete mode 100644 src/hungarian/ExtraHun.gf delete mode 100644 src/hungarian/IrregHun.gf delete mode 100644 src/hungarian/IrregHunAbs.gf delete mode 100644 src/hungarian/MorphoHun.gf delete mode 100644 src/hungarian/ParseEngHun.gf delete mode 100644 src/hungarian/ParseHun.gf diff --git a/src/hungarian/AllEngHun.gf b/src/hungarian/AllEngHun.gf deleted file mode 100644 index edf3b1871..000000000 --- a/src/hungarian/AllEngHun.gf +++ /dev/null @@ -1,13 +0,0 @@ ---# -path=.:../abstract:../common:prelude - -abstract AllHunAbs = - Lang, - IrregHunAbs-[ - blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V, - sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V], - ExtraHunAbs - ** -{ ---{} ; - -} diff --git a/src/hungarian/AllHun.gf b/src/hungarian/AllHun.gf index c8d4c3ed5..0d147c375 100644 --- a/src/hungarian/AllHun.gf +++ b/src/hungarian/AllHun.gf @@ -1,13 +1,6 @@ --# -path=.:../abstract:../common:../prelude -concrete AllHun of AllHunAbs = +concrete AllHun of AllHunAbs = LangHun, - IrregHun-[ - blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V, - sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V], - ExtraHun - ** -{ ---{} ; - -} + ExtendHun + ** {} ; diff --git a/src/hungarian/AllHunAbs.gf b/src/hungarian/AllHunAbs.gf new file mode 100644 index 000000000..4656dcf3b --- /dev/null +++ b/src/hungarian/AllHunAbs.gf @@ -0,0 +1,6 @@ +--# -path=.:../abstract:../common:prelude + +abstract AllHunAbs = + Lang, + Extend + ** {} ; diff --git a/src/hungarian/BackwardHun.gf b/src/hungarian/BackwardHun.gf deleted file mode 100644 index 7d42b77b4..000000000 --- a/src/hungarian/BackwardHun.gf +++ /dev/null @@ -1,80 +0,0 @@ -concrete BackwardHun of Backward = CatHun ** open ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- ----- A repository of obsolete constructs, needed for backward compatibility. ----- They create spurious ambiguities if used in combination with Lang. --- ----- from Verb 19/4/2008 --- --- ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ; --- ComplV3 v np np2 = --- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ; --- ComplV2V v np vp = --- insertObj (\\a => infVP v.isAux vp a) --- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; --- ComplV2S v np s = --- insertObj (\\_ => conjThat ++ s.s) --- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; --- ComplV2Q v np q = --- insertObj (\\_ => q.s ! QIndir) --- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; --- ComplV2A v np ap = --- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ; --- --- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; --- ----- from Sentence 19/4/2008 --- --- SlashV2 np v2 = --- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; --- --- SlashVVV2 np vv v2 = --- mkClause (np.s ! Nom) np.a --- (insertObj (\\a => infVP vv.isAux (predV v2) a) (predVV vv)) ** --- {c2 = v2.c2} ; --- ----- from Noun 19/4/2008 --- --- NumInt n = {s = n.s ; n = Pl} ; --- OrdInt n = {s = n.s ++ "th"} ; --- DEPRECATED --- --- DetSg quant ord = { --- s = quant.s ! Sg ++ ord.s ; --- n = Sg --- } ; --- --- DetPl quant num ord = { --- s = quant.s ! num.n ++ num.s ++ ord.s ; --- n = num.n --- } ; --- --- NoNum = {s = []; n = Pl } ; --- --- DefArt = {s = \\_ => artDef} ; --- --- IndefArt = { --- s = table { --- Sg => artIndef ; --- Pl => [] --- } --- } ; --- --- MassDet = {s = \\_ => []} ; --- --- --- ----- from Structural 19/4/2008 --- --- that_NP = regNP "that" Sg ; --- these_NP = regNP "these" Pl ; --- this_NP = regNP "this" Sg ; --- those_NP = regNP "those" Pl ; --- ---} - -} diff --git a/src/hungarian/ExtraEngHun.gf b/src/hungarian/ExtraEngHun.gf deleted file mode 100644 index 1339ee3a3..000000000 --- a/src/hungarian/ExtraEngHun.gf +++ /dev/null @@ -1,40 +0,0 @@ -abstract ExtraHunAbs = Extra - [ProDrop] ** -{ ---{ --- ----- uncontracted negative polarity; contracted is the default for PNeg --- fun --- UncNeg : Pol ; --- ----- freely compounded nouns --- --- CompoundCN : CN -> CN -> CN ; -- rock album --- --- that_RP : RP ; -- "that" as a relational pronoun (IdRP is "which" / "who") --- --- each_Det : Det ; --- any_Quant : Quant ; --- ----- infinitive without to --- --- UttVPShort : VP -> Utt ; --- ----- emphasizing "do", e.g. "John does walk" --- --- do_VV : VV ; --- --- ------ these are obsolete: use UncNeg : Pol instead --- --- fun --- UncNegCl : Temp -> Pol -> Cl -> S ; --- UncNegQCl : Temp -> Pol -> QCl -> QS ; --- UncNegRCl : Temp -> Pol -> RCl -> RS ; --- --- UncNegImpSg : Pol -> Imp -> Utt; -- do not help yourself --- UncNegImpPl : Pol -> Imp -> Utt; -- do not help yourselves --- --- ---} - -} diff --git a/src/hungarian/ExtraHun.gf b/src/hungarian/ExtraHun.gf deleted file mode 100644 index 072e85f7c..000000000 --- a/src/hungarian/ExtraHun.gf +++ /dev/null @@ -1,164 +0,0 @@ -concrete ExtraHun of ExtraHunAbs = CatHun ** - open ResHun, Coordination, Prelude, MorphoHun, ParadigmsHun in -{ ---{ --- --- lin --- GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_ => np.s ! npGen} ; --- GenIP ip = {s = \\_ => ip.s ! NCase Gen} ; --- GenRP nu cn = { --- s = \\c => "whose" ++ nu.s ! Nom ++ --- case c of { --- RC _ (NCase Gen) => cn.s ! nu.n ! Gen ; --- _ => cn.s ! nu.n ! Nom --- } ; --- a = RAg (agrP3 Sg) --- } ; --- --- ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ; --- --- StrandRelSlash rp slash = { --- s = \\t,a,p,ag => --- rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ; --- c = NPAcc --- } ; --- EmptyRelSlash slash = { --- s = \\t,a,p,_ => slash.s ! t ! a ! p ! ODir ++ slash.c2 ; --- c = NPAcc --- } ; --- --- StrandQuestSlash ip slash = --- {s = \\t,a,b,q => --- (mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2 --- }; --- --- lincat --- VPI = {s : VPIForm => Agr => Str} ; --- [VPI] = {s1,s2 : VPIForm => Agr => Str} ; --- --- lin --- BaseVPI = twoTable2 VPIForm Agr ; --- ConsVPI = consrTable2 VPIForm Agr comma ; --- --- MkVPI vp = { --- s = \\v,a => vp.ad ++ vp.inf ++ vp.s2 ! a --- } ; --- ConjVPI = conjunctDistrTable2 VPIForm Agr ; --- ComplVPIVV vv vpi = ------- insertObj (\\a => infVP vv.typ vpi a) (predVV vv) ; --- let isAux = case vv.typ of {VVAux => True ; _ => False} in --- insertObj (\\a => (if_then_Str isAux [] "to") ++ vpi.s ! VPIInf ! a) (predVV vv) ; --- --- lin --- that_RP = --- { s = table { --- RC _ (NCase Gen) => "whose" ; --- RC _ _ => "that" ; --- _ => "that" ---- "in that" ? ----- RPrep Neutr => "which" ; ----- RPrep _ => "whom" --- } ; --- a = RNoAg --- } ; --- --- each_Det = mkDeterminer Sg "each" ; --- any_Quant = mkQuant "any" "any" ; --- ----- for VP conjunction --- --- param --- VPIForm = VPIInf | VPIPPart ; --- --- lincat --- VPS = {s : Agr => Str} ; --- [VPS] = {s1,s2 : Agr => Str} ; --- --- lin --- BaseVPS = twoTable Agr ; --- ConsVPS = consrTable Agr comma ; --- --- PredVPS np vpi = {s = np.s ! npNom ++ vpi.s ! np.a} ; --- --- MkVPS t p vp = { --- s = \\a => --- let --- verb = vp.s ! t.t ! t.a ! p.p ! ODir ! a ; --- verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ; --- in t.s ++ p.s ++ vp.ad ++ verbf ++ vp.s2 ! a --- } ; --- --- ConjVPS = conjunctDistrTable Agr ; --- --- ICompAP ap = {s = "how" ++ ap.s ! agrP3 Sg} ; ---- IComp should have agr! --- --- IAdvAdv adv = {s = "how" ++ adv.s} ; --- --- PartVP vp = { --- s = \\a => vp.ad ++ vp.prp ++ vp.s2 ! a ; --- isPre = False ---- depends on whether there are complements --- } ; --- --- EmbedPresPart vp = {s = infVP VVPresPart vp (agrP3 Sg)} ; --- agr --- --- UttVPShort vp = {s = infVP VVAux vp (agrP3 Sg)} ; --- --- do_VV = { --- s = table { --- VVF VInf => ["do"] ; --- VVF VPres => "does" ; --- VVF VPPart => ["done"] ; ---- --- VVF VPresPart => ["doing"] ; --- VVF VPast => ["did"] ; --# notpresent --- VVPastNeg => ["didn't"] ; --# notpresent --- VVPresNeg => "doesn't" --- } ; --- typ = VVAux --- } ; --- --- ---lin --- UncNeg = {s = [] ; p = CNeg False} ; --- --- PassVPSlash vps = --- let --- be = predAux auxBe ; --- ppt = vps.ptp --- in { --- s = be.s ; --- prp = be.prp ; --- ptp = be.ptp ; --- inf = be.inf ; --- ad = vps.ad ; --- s2 = \\a => ppt ++ vps.s2 ! a ---- order --- } ; --- --------------- ------ obsolete: use UncNeg : Pol --- --- UncNegCl t p cl = { --- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! ODir --- } ; --- UncNegQCl t p cl = { --- s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! q --- } ; --- UncNegRCl t p cl = { --- s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! r ; --- c = cl.c --- } ; --- --- UncNegImpSg p imp = {s = p.s ++ imp.s ! unc p.p ! ImpF Sg False} ; --- UncNegImpPl p imp = {s = p.s ++ imp.s ! unc p.p ! ImpF Pl False} ; --- --- CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ; --- --- oper --- unc : CPolarity -> CPolarity = \x -> case x of { --- CNeg _ => CNeg False ; --- _ => x --- } ; ---------- --- --- ---} - -} diff --git a/src/hungarian/IrregHun.gf b/src/hungarian/IrregHun.gf deleted file mode 100644 index f113b81e1..000000000 --- a/src/hungarian/IrregHun.gf +++ /dev/null @@ -1,185 +0,0 @@ ---# -path=.:prelude:../abstract:../common - -concrete IrregHun of IrregHunAbs = CatHun ** open ParadigmsHun in -{ ---{ --- ---flags optimize=values ; --- --- lin --- awake_V = irregV "awake" "awoke" "awoken" ; --- bear_V = irregV "bear" "bore" "born" ; --- beat_V = irregV "beat" "beat" "beat" ; --- become_V = irregV "become" "became" "become" ; --- begin_V = irregV "begin" "began" "begun" ; --- bend_V = irregV "bend" "bent" "bent" ; --- beset_V = irregV "beset" "beset" "beset" ; --- bet_V = irregDuplV "bet" "bet" "bet" ; --- bid_V = irregDuplV "bid" (variants {"bid" ; "bade"}) (variants {"bid" ; "bidden"}) ; --- bind_V = irregV "bind" "bound" "bound" ; --- bite_V = irregV "bite" "bit" "bitten" ; --- bleed_V = irregV "bleed" "bled" "bled" ; --- blow_V = irregV "blow" "blew" "blown" ; --- break_V = irregV "break" "broke" "broken" ; --- breed_V = irregV "breed" "bred" "bred" ; --- bring_V = irregV "bring" "brought" "brought" ; --- broadcast_V = irregV "broadcast" "broadcast" "broadcast" ; --- build_V = irregV "build" "built" "built" ; --- burn_V = irregV "burn" (variants {"burned" ; "burnt"}) (variants {"burned" ; "burnt"}) ; --- burst_V = irregV "burst" "burst" "burst" ; --- buy_V = irregV "buy" "bought" "bought" ; --- cast_V = irregV "cast" "cast" "cast" ; --- catch_V = irregV "catch" "caught" "caught" ; --- choose_V = irregV "choose" "chose" "chosen" ; --- cling_V = irregV "cling" "clung" "clung" ; --- come_V = irregV "come" "came" "come" ; --- cost_V = irregV "cost" "cost" "cost" ; --- creep_V = irregV "creep" "crept" "crept" ; --- cut_V = irregDuplV "cut" "cut" "cut" ; --- deal_V = irregV "deal" "dealt" "dealt" ; --- dig_V = irregDuplV "dig" "dug" "dug" ; --- dive_V = irregV "dive" (variants {"dived" ; "dove"}) "dived" ; --- do_V = mk5V "do" "does" "did" "done" "doing" ; --- draw_V = irregV "draw" "drew" "drawn" ; --- dream_V = irregV "dream" (variants {"dreamed" ; "dreamt"}) (variants {"dreamed" ; "dreamt"}) ; --- drive_V = irregV "drive" "drove" "driven" ; --- drink_V = irregV "drink" "drank" "drunk" ; --- eat_V = irregV "eat" "ate" "eaten" ; --- fall_V = irregV "fall" "fell" "fallen" ; --- feed_V = irregV "feed" "fed" "fed" ; --- feel_V = irregV "feel" "felt" "felt" ; --- fight_V = irregV "fight" "fought" "fought" ; --- find_V = irregV "find" "found" "found" ; --- fit_V = irregDuplV "fit" "fit" "fit" ; --- flee_V = irregV "flee" "fled" "fled" ; --- fling_V = irregV "fling" "flung" "flung" ; --- fly_V = irregV "fly" "flew" "flown" ; --- forbid_V = irregDuplV "forbid" "forbade" "forbidden" ; --- forget_V = irregDuplV "forget" "forgot" "forgotten" ; --- forgive_V = irregV "forgive" "forgave" "forgiven" ; --- forsake_V = irregV "forsake" "forsook" "forsaken" ; --- freeze_V = irregV "freeze" "froze" "frozen" ; --- get_V = irregDuplV "get" "got" "gotten" ; --- give_V = irregV "give" "gave" "given" ; --- go_V = mk5V "go" "goes" "went" "gone" "going" ; --- grind_V = irregV "grind" "ground" "ground" ; --- grow_V = irregV "grow" "grew" "grown" ; --- hang_V = irregV "hang" "hung" "hung" ; --- have_V = mk5V "have" "has" "had" "had" "having" ; --- hear_V = irregV "hear" "heard" "heard" ; --- hide_V = irregV "hide" "hid" "hidden" ; --- hit_V = irregDuplV "hit" "hit" "hit" ; --- hold_V = irregV "hold" "held" "held" ; --- hurt_V = irregV "hurt" "hurt" "hurt" ; --- keep_V = irregV "keep" "kept" "kept" ; --- kneel_V = irregV "kneel" "knelt" "knelt" ; --- knit_V = irregDuplV "knit" "knit" "knit" ; --- know_V = irregV "know" "knew" "know" ; --- lay_V = irregV "lay" "laid" "laid" ; --- lead_V = irregV "lead" "led" "led" ; --- leap_V = irregV "leap" (variants {"leaped" ; "lept"}) (variants {"leaped" ; "lept"}) ; --- learn_V = irregV "learn" (variants {"learned" ; "learnt"}) (variants {"learned" ; "learnt"}) ; --- leave_V = irregV "leave" "left" "left" ; --- lend_V = irregV "lend" "lent" "lent" ; --- let_V = irregDuplV "let" "let" "let" ; --- lie_V = irregV "lie" "lay" "lain" ; --- light_V = irregV "light" (variants {"lighted" ; "lit"}) "lighted" ; --- lose_V = irregV "lose" "lost" "lost" ; --- make_V = irregV "make" "made" "made" ; --- mean_V = irregV "mean" "meant" "meant" ; --- meet_V = irregV "meet" "met" "met" ; --- misspell_V = irregV "misspell" (variants {"misspelled" ; "misspelt"}) (variants {"misspelled" ; "misspelt"}) ; --- mistake_V = irregV "mistake" "mistook" "mistaken" ; --- mow_V = irregV "mow" "mowed" (variants {"mowed" ; "mown"}) ; --- overcome_V = irregV "overcome" "overcame" "overcome" ; --- overdo_V = mk5V "overdo" "overdoes" "overdid" "overdone" "overdoing" ; --- overtake_V = irregV "overtake" "overtook" "overtaken" ; --- overthrow_V = irregV "overthrow" "overthrew" "overthrown" ; --- pay_V = irregV "pay" "paid" "paid" ; --- plead_V = irregV "plead" "pled" "pled" ; --- prove_V = irregV "prove" "proved" (variants {"proved" ; "proven"}) ; --- put_V = irregDuplV "put" "put" "put" ; --- quit_V = irregDuplV "quit" "quit" "quit" ; --- read_V = irregV "read" "read" "read" ; --- rid_V = irregDuplV "rid" "rid" "rid" ; --- ride_V = irregV "ride" "rode" "ridden" ; --- ring_V = irregV "ring" "rang" "rung" ; --- rise_V = irregV "rise" "rose" "risen" ; --- run_V = irregDuplV "run" "ran" "run" ; --- saw_V = irregV "saw" "sawed" (variants {"sawed" ; "sawn"}) ; --- say_V = irregV "say" "said" "said" ; --- see_V = irregV "see" "saw" "seen" ; --- seek_V = irregV "seek" "sought" "sought" ; --- sell_V = irregV "sell" "sold" "sold" ; --- send_V = irregV "send" "sent" "sent" ; --- set_V = irregDuplV "set" "set" "set" ; --- sew_V = irregV "sew" "sewed" (variants {"sewed" ; "sewn"}) ; --- shake_V = irregV "shake" "shook" "shaken" ; --- shave_V = irregV "shave" "shaved" (variants {"shaved" ; "shaven"}) ; --- shear_V = irregV "shear" "shore" "shorn" ; --- shed_V = irregDuplV "shed" "shed" "shed" ; --- shine_V = irregV "shine" "shone" "shone" ; --- shoe_V = irregV "shoe" "shoed" (variants {"shoed" ; "shod"}) ; --- shoot_V = irregV "shoot" "shot" "shot" ; --- show_V = irregV "show" "showed" (variants {"showed" ; "shown"}) ; --- shrink_V = irregV "shrink" "shrank" "shrunk" ; --- shut_V = irregDuplV "shut" "shut" "shut" ; --- sing_V = irregV "sing" "sang" "sung" ; --- sink_V = irregV "sink" "sank" "sunk" ; --- sit_V = irregDuplV "sit" "sat" "sat" ; --- sleep_V = irregV "sleep" "slept" "slept" ; --- slay_V = irregV "slay" "slew" "slain" ; --- slide_V = irregV "slide" "slid" "slid" ; --- sling_V = irregV "sling" "slung" "slung" ; --- slit_V = irregDuplV "slit" "slit" "slit" ; --- smite_V = irregV "smite" "smote" "smitten" ; --- sow_V = irregV "sow" "sowed" (variants {"sowed" ; "sown"}) ; --- speak_V = irregV "speak" "spoke" "spoken" ; --- speed_V = irregV "speed" "sped" "sped" ; --- spend_V = irregV "spend" "spent" "spent" ; --- spill_V = irregV "spill" (variants {"spilled" ; "spilt"}) (variants {"spilled" ; "spilt"}) ; --- spin_V = irregDuplV "spin" "spun" "spun" ; --- spit_V = irregDuplV "spit" (variants {"spit" ; "spat"}) "spit" ; --- split_V = irregDuplV "split" "split" "split" ; --- spread_V = irregV "spread" "spread" "spread" ; --- spring_V = irregV "spring" (variants {"sprang" ; "sprung"}) "sprung" ; --- stand_V = irregV "stand" "stood" "stood" ; --- steal_V = irregV "steal" "stole" "stolen" ; --- stick_V = irregV "stick" "stuck" "stuck" ; --- sting_V = irregV "sting" "stung" "stung" ; --- stink_V = irregV "stink" "stank" "stunk" ; --- stride_V = irregV "stride" "strod" "stridden" ; --- strike_V = irregV "strike" "struck" "struck" ; --- string_V = irregV "string" "strung" "strung" ; --- strive_V = irregV "strive" "strove" "striven" ; --- swear_V = irregV "swear" "swore" "sworn" ; --- sweep_V = irregV "sweep" "swept" "swept" ; --- swell_V = irregV "swell" "swelled" (variants {"swelled" ; "swollen"}) ; --- swim_V = irregDuplV "swim" "swam" "swum" ; --- swing_V = irregV "swing" "swung" "swung" ; --- take_V = irregV "take" "took" "taken" ; --- teach_V = irregV "teach" "taught" "taught" ; --- tear_V = irregV "tear" "tore" "torn" ; --- tell_V = irregV "tell" "told" "told" ; --- think_V = irregV "think" "thought" "thought" ; --- thrive_V = irregV "thrive" (variants {"thrived" ; "throve"}) "thrived" ; --- throw_V = irregV "throw" "threw" "thrown" ; --- thrust_V = irregV "thrust" "thrust" "thrust" ; --- tread_V = irregV "tread" "trod" "trodden" ; --- understand_V = irregV "understand" "understood" "understood" ; --- uphold_V = irregV "uphold" "upheld" "upheld" ; --- upset_V = irregDuplV "upset" "upset" "upset" ; --- wake_V = irregV "wake" "woke" "woken" ; --- wear_V = irregV "wear" "wore" "worn" ; --- weave_V = irregV "weave" (variants {"weaved" ; "wove"}) (variants {"weaved" ; "woven"}) ; --- wed_V = irregDuplV "wed" "wed" "wed" ; --- weep_V = irregV "weep" "wept" "wept" ; --- wind_V = irregV "wind" "wound" "wound" ; --- win_V = irregDuplV "win" "won" "won" ; --- withhold_V = irregV "withhold" "withheld" "withheld" ; --- withstand_V = irregV "withstand" "withstood" "withstood" ; --- wring_V = irregV "wring" "wrung" "wrung" ; --- write_V = irregV "write" "wrote" "written" ; ---} - -} diff --git a/src/hungarian/IrregHunAbs.gf b/src/hungarian/IrregHunAbs.gf deleted file mode 100644 index 5c3edd3a7..000000000 --- a/src/hungarian/IrregHunAbs.gf +++ /dev/null @@ -1,180 +0,0 @@ -abstract IrregHunAbs = Cat ** -{ ---{ ---fun --- awake_V : V ; --- bear_V : V ; --- beat_V : V ; --- become_V : V ; --- begin_V : V ; --- bend_V : V ; --- beset_V : V ; --- bet_V : V ; --- bid_V : V ; --- bind_V : V ; --- bite_V : V ; --- bleed_V : V ; --- blow_V : V ; --- break_V : V ; --- breed_V : V ; --- bring_V : V ; --- broadcast_V : V ; --- build_V : V ; --- burn_V : V ; --- burst_V : V ; --- buy_V : V ; --- cast_V : V ; --- catch_V : V ; --- choose_V : V ; --- cling_V : V ; --- come_V : V ; --- cost_V : V ; --- creep_V : V ; --- cut_V : V ; --- deal_V : V ; --- dig_V : V ; --- dive_V : V ; --- do_V : V ; --- draw_V : V ; --- dream_V : V ; --- drive_V : V ; --- drink_V : V ; --- eat_V : V ; --- fall_V : V ; --- feed_V : V ; --- feel_V : V ; --- fight_V : V ; --- find_V : V ; --- fit_V : V ; --- flee_V : V ; --- fling_V : V ; --- fly_V : V ; --- forbid_V : V ; --- forget_V : V ; --- forgive_V : V ; --- forsake_V : V ; --- freeze_V : V ; --- get_V : V ; --- give_V : V ; --- go_V : V ; --- grind_V : V ; --- grow_V : V ; --- hang_V : V ; --- have_V : V ; --- hear_V : V ; --- hide_V : V ; --- hit_V : V ; --- hold_V : V ; --- hurt_V : V ; --- keep_V : V ; --- kneel_V : V ; --- knit_V : V ; --- know_V : V ; --- lay_V : V ; --- lead_V : V ; --- leap_V : V ; --- learn_V : V ; --- leave_V : V ; --- lend_V : V ; --- let_V : V ; --- lie_V : V ; --- light_V : V ; --- lose_V : V ; --- make_V : V ; --- mean_V : V ; --- meet_V : V ; --- misspell_V : V ; --- mistake_V : V ; --- mow_V : V ; --- overcome_V : V ; --- overdo_V : V ; --- overtake_V : V ; --- overthrow_V : V ; --- pay_V : V ; --- plead_V : V ; --- prove_V : V ; --- put_V : V ; --- quit_V : V ; --- read_V : V ; --- rid_V : V ; --- ride_V : V ; --- ring_V : V ; --- rise_V : V ; --- run_V : V ; --- saw_V : V ; --- say_V : V ; --- see_V : V ; --- seek_V : V ; --- sell_V : V ; --- send_V : V ; --- set_V : V ; --- sew_V : V ; --- shake_V : V ; --- shave_V : V ; --- shear_V : V ; --- shed_V : V ; --- shine_V : V ; --- shoe_V : V ; --- shoot_V : V ; --- show_V : V ; --- shrink_V : V ; --- shut_V : V ; --- sing_V : V ; --- sink_V : V ; --- sit_V : V ; --- sleep_V : V ; --- slay_V : V ; --- slide_V : V ; --- sling_V : V ; --- slit_V : V ; --- smite_V : V ; --- sow_V : V ; --- speak_V : V ; --- speed_V : V ; --- spend_V : V ; --- spill_V : V ; --- spin_V : V ; --- spit_V : V ; --- split_V : V ; --- spread_V : V ; --- spring_V : V ; --- stand_V : V ; --- steal_V : V ; --- stick_V : V ; --- sting_V : V ; --- stink_V : V ; --- stride_V : V ; --- strike_V : V ; --- string_V : V ; --- strive_V : V ; --- swear_V : V ; --- sweep_V : V ; --- swell_V : V ; --- swim_V : V ; --- swing_V : V ; --- take_V : V ; --- teach_V : V ; --- tear_V : V ; --- tell_V : V ; --- think_V : V ; --- thrive_V : V ; --- throw_V : V ; --- thrust_V : V ; --- tread_V : V ; --- understand_V : V ; --- uphold_V : V ; --- upset_V : V ; --- wake_V : V ; --- wear_V : V ; --- weave_V : V ; --- wed_V : V ; --- weep_V : V ; --- wind_V : V ; --- win_V : V ; --- withhold_V : V ; --- withstand_V : V ; --- wring_V : V ; --- write_V : V ; ---} - -} diff --git a/src/hungarian/MorphoHun.gf b/src/hungarian/MorphoHun.gf deleted file mode 100644 index fa984088f..000000000 --- a/src/hungarian/MorphoHun.gf +++ /dev/null @@ -1,47 +0,0 @@ ---# -path=.:../../prelude - ---1 A Simple Hunlish Resource Morphology --- --- Aarne Ranta 2002 -- 2005 --- --- This resource morphology contains definitions needed in the resource --- syntax. To build a lexicon, it is better to use $ParadigmsHun$, which --- gives a higher-level access to this module. - -resource MorphoHun = open Prelude, (Predef=Predef), ResHun in -{ ---{ --- --- flags optimize=all ; --- -----2 Determiners --- --- oper --- --- mkDeterminer : Number -> Str -> --- {s : Str ; sp : NPCase => Str; n : Number ; hasNum : Bool} = \n,s -> --- {s = s; --- sp = \\c => regGenitiveS s ! npcase2case c ; --- n = n ; --- hasNum = True ; -- doesn't matter since s = sp --- } ; --- -----2 Pronouns --- --- --- mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender -> --- {s : NPCase => Str ; sp : Case => Str ; a : Agr} = --- \i,me,my,mine,n,p,g -> { --- s = table { --- NCase Nom => i ; --- NPAcc => me ; --- NCase Gen => my --- } ; --- a = toAgr n p g ; --- sp = regGenitiveS mine --- } ; --- ---} ; --- - -} diff --git a/src/hungarian/ParseEngHun.gf b/src/hungarian/ParseEngHun.gf deleted file mode 100644 index b4775d378..000000000 --- a/src/hungarian/ParseEngHun.gf +++ /dev/null @@ -1,50 +0,0 @@ -abstract ParseHunAbs = - Tense, - Cat, - Noun, - Adjective, - Numeral, - Symbol, - Conjunction, - Verb - [SlashV2V, PassV2], - Adverb, - Phrase, - Sentence, - Relative, - Idiom [VP, ProgrVP], - Extra [NP, Quant, VPSlash, VP, GenNP, PassVPSlash], - DictHunAbs ** -{ ---{ --- ---fun CompoundCN : Num -> N -> CN -> CN ; --- DashCN : N -> N -> N ; --- GerundN : V -> N ; --- GerundAP : V -> AP ; --- PastPartAP : V2 -> AP ; --- myself_NP : NP ; --- yourselfSg_NP : NP ; --- himself_NP : NP ; --- herself_NP : NP ; --- itself_NP : NP ; --- ourself_NP : NP ; --- yourselfPl_NP : NP ; --- themself_NP : NP ; --- OrdCompar : A -> Ord ; --- --- PositAdVAdj : A -> AdV ; --- --- UseQuantPN : Quant -> PN -> NP; --- --- SlashV2V : V2V -> Pol -> VP -> VPSlash ; --- --- ComplPredVP : NP -> VP -> Cl ; --- --- that_RP, no_RP : RP ; --- --- CompS : S -> Comp ; --- CompVP : VP -> Comp ; --- ---} - -} diff --git a/src/hungarian/ParseHun.gf b/src/hungarian/ParseHun.gf deleted file mode 100644 index 29263ff26..000000000 --- a/src/hungarian/ParseHun.gf +++ /dev/null @@ -1,101 +0,0 @@ ---# -path=alltenses -concrete ParseHun of ParseHunAbs = - TenseX - [Pol, PNeg, PPos], - CatHun, - NounHun, - AdjectiveHun, - NumeralHun, - SymbolHun, - ConjunctionHun, - VerbHun - [SlashV2V, PassV2], - AdverbHun, - PhraseHun, - SentenceHun, - RelativeHun, - IdiomHun [VP, Tense, ProgrVP], - ExtraHun [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash], - DictHun ** -open MorphoHun, ResHun, ParadigmsHun, Prelude in -{ ---{ --- ---flags --- literal=Symb ; --- ---lin --- myself_NP = regNP "myself" singular ; --- yourselfSg_NP = regNP "yourself" singular ; --- himself_NP = regNP "himself" singular ; --- herself_NP = regNP "herself" singular ; --- itself_NP = regNP "itself" singular ; --- ourself_NP = regNP "ourself" plural ; --- yourselfPl_NP = regNP "yourself" plural ; --- themself_NP = regNP "themself" plural ; --- --- CompoundCN num noun cn = { --- s = \\n,c => num.s ! Nom ++ noun.s ! num.n ! Nom ++ cn.s ! n ! c ; --- g = cn.g --- } ; --- --- DashCN noun1 noun2 = { --- s = \\n,c => noun1.s ! Sg ! Nom ++ "-" ++ noun2.s ! n ! c ; --- g = noun2.g --- } ; --- --- GerundN v = { --- s = \\n,c => v.s ! VPresPart ; --- g = Neutr --- } ; --- --- GerundAP v = { --- s = \\agr => v.s ! VPresPart ; --- isPre = True --- } ; --- --- PastPartAP v = { --- s = \\agr => v.s ! VPPart ; --- isPre = True --- } ; --- --- OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ; --- --- PositAdVAdj a = {s = a.s ! AAdv} ; --- --- UseQuantPN q pn = {s = \\c => q.s ! False ! Sg ++ pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ; --- --- SlashV2V v p vp = insertObjc (\\a => p.s ++ case p.p of {CPos => ""; _ => "not"} ++ --- v.c3 ++ --- infVP v.typ vp a) --- (predVc v) ; --- --- ComplPredVP np vp = { --- s = \\t,a,b,o => --- let --- verb = vp.s ! t ! a ! b ! o ! np.a ; --- compl = vp.s2 ! np.a --- in --- case o of { --- ODir => compl ++ "," ++ np.s ! npNom ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ; --- OQuest => verb.aux ++ compl ++ "," ++ np.s ! npNom ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf --- } --- } ; --- --- that_RP = { --- s = \\_ => "that" ; --- a = RNoAg --- } ; --- no_RP = { --- s = \\_ => "" ; --- a = RNoAg --- } ; --- --- CompS s = {s = \\_ => "that" ++ s.s} ; --- CompVP vp = {s = \\a => infVP VVInf vp a} ; --- ---lin --- PPos = {s = [] ; p = CPos} ; --- PNeg = {s = [] ; p = CNeg True} ; -- contracted: don't --- ---} - -} From e1a94a074147f7e90721cbcce3eccac553ff8701 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 28 Mar 2020 15:43:58 +0100 Subject: [PATCH 02/97] (Hun) Fresh copypaste from generic dummy template. Compiles, isn't good. --- src/hungarian/AdjectiveHun.gf | 113 ++-- src/hungarian/AdverbHun.gf | 58 ++- src/hungarian/CatHun.gf | 209 ++++---- src/hungarian/ConjunctionHun.gf | 147 ++++-- src/hungarian/ConstructionHun.gf | 113 ++++ src/hungarian/ExtendHun.gf | 8 + src/hungarian/GrammarHun.gf | 29 +- src/hungarian/IdiomHun.gf | 79 +-- src/hungarian/LangHun.gf | 16 +- src/hungarian/LexiconHun.gf | 779 +++++++++++++++------------- src/hungarian/NounHun.gf | 348 ++++++++----- src/hungarian/NumeralHun.gf | 188 ++++--- src/hungarian/ParadigmsHun.gf | 860 +++++-------------------------- src/hungarian/ParamHun.gf | 82 +++ src/hungarian/PhraseHun.gf | 57 +- src/hungarian/QuestionHun.gf | 146 +++--- src/hungarian/RelativeHun.gf | 74 +-- src/hungarian/ResHun.gf | 765 +++++++++------------------ src/hungarian/SentenceHun.gf | 150 +++--- src/hungarian/StructuralHun.gf | 312 +++++------ src/hungarian/SymbolHun.gf | 92 ++-- src/hungarian/VerbHun.gf | 197 ++++--- 22 files changed, 2195 insertions(+), 2627 deletions(-) create mode 100644 src/hungarian/ConstructionHun.gf create mode 100644 src/hungarian/ExtendHun.gf create mode 100644 src/hungarian/ParamHun.gf diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index eb4afff4c..484e15d34 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -1,59 +1,58 @@ -concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in -{ ---{ --- --- lin --- --- PositA a = { --- s = \\_ => a.s ! AAdj Posit Nom ; --- isPre = True --- } ; --- ComparA a np = { --- s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! npNom ; --- isPre = False --- } ; --- UseComparA a = { --- s = \\_ => a.s ! AAdj Compar Nom ; --- isPre = True --- } ; --- --- AdjOrd ord = { --- s = \\_ => ord.s ! Nom ; --- isPre = True --- } ; --- --- CAdvAP ad ap np = { --- s = \\a => ad.s ++ ap.s ! a ++ ad.p ++ np.s ! npNom ; --- isPre = False --- } ; --- --- ComplA2 a np = { --- s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! NPAcc ; --- isPre = False --- } ; --- --- ReflA2 a = { --- s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ reflPron ! ag ; --- isPre = False --- } ; --- --- SentAP ap sc = { --- s = \\a => ap.s ! a ++ sc.s ; --- isPre = False --- } ; --- --- AdAP ada ap = { --- s = \\a => ada.s ++ ap.s ! a ; --- isPre = ap.isPre --- } ; --- --- UseA2 a = { --- s = \\_ => a.s ! AAdj Posit Nom ; --- isPre = True --- } ; --- --- AdvAP ap adv = {s = \\a => ap.s ! a ++ adv.s ; isPre = False} ; --- ---} +concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { + + flags optimize=all_subs ; + + lin + + -- : A -> AP ; + PositA a = a ; + + -- : A -> NP -> AP ; + -- ComparA a np = a ** { + -- + -- } ; + + -- : A2 -> NP -> AP ; -- married to her + -- ComplA2 a2 np = a2 ** { } ; + + -- : A2 -> AP ; -- married to itself + -- ReflA2 a2 = a2 ** { } ; + + -- : A2 -> AP ; -- married + -- UseA2 = PositA ; + + -- : A -> AP ; -- warmer + -- UseComparA a = a ** { + -- s = \\af => "???" ++ a.s ! af ; + -- compar = [] + -- } ; + + + -- : CAdv -> AP -> NP -> AP ; -- as cool as John + -- CAdvAP adv ap np = ap ** { } ; + +-- The superlative use is covered in $Ord$. + + -- : Ord -> AP ; -- warmest + AdjOrd ord = ord ** { + s = \\_ => ord.s ; + } ; + +-- Sentence and question complements defined for all adjectival +-- phrases, although the semantics is only clear for some adjectives. + + -- : AP -> SC -> AP ; -- good that she is here + -- SentAP ap sc = ap ** {} ; + +-- An adjectival phrase can be modified by an *adadjective*, such as "very". + + -- : AdA -> AP -> AP ; + AdAP ada ap = ap ** {s = \\af => ada.s ++ ap.s ! af} ; + + +-- It can also be postmodified by an adverb, typically a prepositional phrase. + + -- : AP -> Adv -> AP ; -- warm by nature + -- AdvAP ap adv = ap ** {} ; } diff --git a/src/hungarian/AdverbHun.gf b/src/hungarian/AdverbHun.gf index 30c7864a6..78a9bbb59 100644 --- a/src/hungarian/AdverbHun.gf +++ b/src/hungarian/AdverbHun.gf @@ -1,25 +1,35 @@ -concrete AdverbHun of Adverb = CatHun ** open ResHun, Prelude in -{ ---{ --- --- lin --- PositAdvAdj a = {s = a.s ! AAdv} ; --- ComparAdvAdj cadv a np = { --- s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ np.s ! npNom --- } ; --- ComparAdvAdjS cadv a s = { --- s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ s.s --- } ; --- --- PrepNP prep np = {s = prep.s ++ np.s ! NPAcc} ; --- --- AdAdv = cc2 ; --- PositAdAAdj a = {s = a.s ! AAdv} ; --- --- SubjS = cc2 ; --- --- AdnCAdv cadv = {s = cadv.s ++ cadv.p} ; --- ---} +concrete AdverbHun of Adverb = CatHun ** open ResHun, ParamHun, ParadigmsHun, Prelude in { -} +lin + + -- : A -> Adv ; + --PositAdvAdj adj = { } ; + + -- : CAdv -> A -> NP -> Adv ; -- more warmly than John + -- ComparAdvAdj cadv a np = { } ; + +-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs + + -- : Prep -> NP -> Adv ; + PrepNP prep np = { + s = np.s ! prep.c ++ prep.s ; + } ; + +-- Adverbs can be modified by 'adadjectives', just like adjectives. + + --AdAdv : AdA -> Adv -> Adv ; -- very quickly + -- AdAdv ada adv = adv ** +-- Like adverbs, adadjectives can be produced by adjectives. + + -- : A -> AdA ; -- extremely +-- PositAdAAdj a = { } ; +-- Subordinate clauses can function as adverbs. + + -- : Subj -> S -> Adv ; + -- SubjS subj s = + +-- Comparison adverbs also work as numeral adverbs. + + --AdnCAdv : CAdv -> AdN ; -- less (than five) + --AdnCAdv cadv = {s = } ; +} ; diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 5c6541564..c19eb8a3b 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -1,94 +1,121 @@ -concrete CatHun of Cat = CommonX ** open ResHun, Prelude in -{ +concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { + + flags optimize=all_subs ; + lincat --- ----- exception to CommonX, due to the distinction contracted/uncontracted negation --- --- Pol = {s : Str ; p : CPolarity} ; --- ----- Tensed/Untensed --- --- S = {s : Str} ; --- QS = {s : QForm => Str} ; --- RS = {s : Agr => Str ; c : NPCase} ; -- c for it clefts --- SSlash = {s : Str ; c2 : Str} ; --- ----- Sentence --- --- Cl = {s : ResHun.Tense => Anteriority => CPolarity => Order => Str} ; --- ClSlash = { --- s : ResHun.Tense => Anteriority => CPolarity => Order => Str ; --- c2 : Str --- } ; --- Imp = {s : CPolarity => ImpForm => Str} ; --- ----- Question --- --- QCl = {s : ResHun.Tense => Anteriority => CPolarity => QForm => Str} ; --- IP = {s : NPCase => Str ; n : Number} ; --- IComp = {s : Str} ; --- IDet = {s : Str ; n : Number} ; --- IQuant = {s : Number => Str} ; --- ----- Relative --- --- RCl = { --- s : ResHun.Tense => Anteriority => CPolarity => Agr => Str ; --- c : NPCase --- } ; --- RP = {s : RCase => Str ; a : RAgr} ; --- ----- Verb --- --- VP = ResHun.VP ; --- VPSlash = ResHun.VP ** {c2 : Str} ; --- Comp = {s : Agr => Str} ; --- ----- Adjective --- --- AP = {s : Agr => Str ; isPre : Bool} ; --- ----- Noun --- - N = {s : Number => Case => Str} ; --- NP = {s : NPCase => Str ; a : Agr} ; --- Pron = {s : NPCase => Str ; sp : Case => Str ; a : Agr} ; --- Det = {s : Str ; sp : NPCase => Str ; n : Number ; hasNum : Bool} ; --- Predet = {s : Str} ; --- Ord = { s : Case => Str } ; --- Num = {s : Case => Str ; n : Number ; hasCard : Bool} ; --- Card = {s : Case => Str ; n : Number} ; --- Quant = {s : Bool => Number => Str ; sp : Bool => Number => NPCase => Str} ; --- ----- Numeral --- --- Numeral = {s : CardOrd => Case => Str ; n : Number} ; --- Digits = {s : CardOrd => Case => Str ; n : Number ; tail : DTail} ; --- ----- Structural --- --- Conj = {s1,s2 : Str ; n : Number} ; ------b Conj = {s : Str ; n : Number} ; ------b DConj = {s1,s2 : Str ; n : Number} ; --- Subj = {s : Str} ; --- Prep = {s : Str} ; --- ----- Open lexical classes, e.g. Lexicon --- --- V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ; --- V2, V2A, V2Q, V2S = Verb ** {c2 : Str} ; --- V3 = Verb ** {c2, c3 : Str} ; --- VV = {s : VVForm => Str ; typ : VVType} ; --- V2V = Verb ** {c2,c3 : Str ; typ : VVType} ; --- --- A = {s : AForm => Str} ; --- A2 = {s : AForm => Str ; c2 : Str} ; --- --- N = {s : Number => Case => Str ; g : Gender} ; --- N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ; --- N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ; --- PN = {s : Case => Str ; g : Gender} ; --- ---} + +--2 Sentences and clauses +-- Constructed in SentenceHun, and also in IdiomHun + + S = ResHun.Sentence ; + QS = SS ; + RS = SS ; + -- relative sentence. Tense and polarity fixed, + -- but agreement may depend on the CN/NP it modifies. + + Cl = ResHun.ClSlash ; + ClSlash = ResHun.ClSlash ; + SSlash = ResHun.Sentence ; -- sentence missing NP; e.g. "she has looked at" + Imp = {s : Number => Polarity => Str} ; -- imperative e.g. "look at this" + +--2 Questions and interrogatives + +-- Constructed in QuestionHun. + + QCl = ResHun.QClause ; + IComp = SS ; -- interrogative complement of copula e.g. "where" + IDet = ResHun.Determiner ; -- interrogative determiner e.g. "how many" + IQuant = ResHun.Quant ; -- interrogative quantifier e.g. "which" + IP = ResHun.NounPhrase ; -- interrogative pronoun e.g. "who" + +--2 Subord clauses and pronouns + + --RCl = ResHun.RClause ; + --RP = SS ; + +--2 Verb phrases + +-- Constructed in VerbHun. + + VP = ResHun.VerbPhrase ; + VPSlash = ResHun.VPSlash ; + Comp = ResHun.VerbPhrase ; + + +--2 Adjectival phrases + +-- Constructed in AdjectiveHun. + + AP = ResHun.Adjective ; + + +--2 Nouns and noun phrases + +-- Constructed in NounHun. +-- Many atomic noun phrases e.g. "everybody" +-- are constructed in StructuralHun. +-- The determiner structure is +-- ``` Predet (QuantSg | QuantPl Num) Ord +-- as defined in NounHun. + + CN = ResHun.Noun ; + NP = ResHun.NounPhrase ; + Pron = ResHun.Pronoun ; --Pronouns need enough info to turn it into NP or Quant. + Det = ResHun.Determiner ; + Predet = {s : Str} ; + Quant = ResHun.Quant ; + Num = ResHun.Num ; + Ord = { + s : Str ; -- 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 ; + + +--2 Numerals + +-- Constructed in NumeralHun. + + Card = ResHun.Num ; + Numeral = ResHun.Numeral ; + Digits = {s : CardOrd => Str ; n : Number} ; + + + +--2 Structural words + +-- Constructed in StructuralHun. + Conj = ResHun.Conj ; + Subj = SS ; + Prep = ResHun.Postposition ; + + + +--2 Words of open classes + +-- These are constructed in LexiconHun and in +-- additional lexicon modules. + + VS, -- sentence-complement verb e.g. "claim" + -- TODO: eventually different lincats + VQ, -- question-complement verb e.g. "wonder" + VA, -- adjective-complement verb e.g. "look" + V = ResHun.Verb ; + + VV, -- verb-phrase-complement verb e.g. "want" + V2A, -- verb with NP and AP complement e.g. "paint" + V2V, -- verb with NP and V complement e.g. "cause" + V2S, -- verb with NP and S complement e.g. "tell" + V2Q, -- verb with NP and Q complement e.g. "ask" + V2 = ResHun.Verb2 ; + V3 = ResHun.Verb3 ; + + A = ResHun.Adjective ; + A2 = ResHun.Adjective ; + + N, + N2, + N3 = ResHun.Noun ; + PN = ResHun.NounPhrase ; } diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index 67b83578b..8c6414aef 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -1,58 +1,93 @@ -concrete ConjunctionHun of Conjunction = - CatHun ** open ResHun, Coordination, Prelude in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- --- ConjS = conjunctDistrSS ; --- --- ConjAdv = conjunctDistrSS ; --- --- ConjNP conj ss = conjunctDistrTable NPCase conj ss ** { --- a = conjAgr (agrP3 conj.n) ss.a --- } ; --- --- ConjAP conj ss = conjunctDistrTable Agr conj ss ** { --- isPre = ss.isPre --- } ; --- --- ConjRS conj ss = conjunctDistrTable Agr conj ss ** { --- c = ss.c --- } ; --- --- ConjIAdv = conjunctDistrSS ; --- --- ConjCN co ns = conjunctDistrTable2 Number Case co ns ** {g = Neutr} ; --- gender? --- ----- These fun's are generated from the list cat's. --- --- BaseS = twoSS ; --- ConsS = consrSS comma ; --- BaseAdv = twoSS ; --- ConsAdv = consrSS comma ; --- BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a} ; --- ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ; --- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ; --- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ; --- BaseRS x y = twoTable Agr x y ** {c = y.c} ; --- ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ; --- BaseIAdv = twoSS ; --- ConsIAdv = consrSS comma ; --- BaseCN = twoTable2 Number Case ; --- ConsCN = consrTable2 Number Case comma ; --- --- lincat --- [S] = {s1,s2 : Str} ; --- [Adv] = {s1,s2 : Str} ; --- [IAdv] = {s1,s2 : Str} ; --- [NP] = {s1,s2 : NPCase => Str ; a : Agr} ; --- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ; --- [RS] = {s1,s2 : Agr => Str ; c : NPCase} ; --- [CN] = {s1,s2 : Number => Case => Str} ; --- ---} +concrete ConjunctionHun of Conjunction = + CatHun ** open ResHun, Coordination, Prelude in { + + {- Conjunction for category X needs four things: + lincat [X] + lin BaseX + lin ConsX + lin ConjX + + For example, if X is defined as + + lincat X = {s : Number => Str ; g : Gender} ; + + then [X] will split its s field into two, and retain its other fields as is: + + lincat [X] = {s1,s2 : Number => Str ; g : Gender} ; + + Let us look at a simple case: Adv is of type {s : Str} + Then [Adv] is {s1,s2 : Str}. + BaseAdv, ConsAdv and ConjAdv can all use functions defined in prelude/Coordination: + + BaseAdv = twoSS ; + ConsAdv = consrSS comma ; + ConjAdv = conjunctSS ; + + --} + + +-- Adverb and other simple {s : Str} types. +lincat + [Adv],[AdV],[IAdv] = {s1,s2 : Str} ; + +lin + BaseAdv, BaseAdV, BaseIAdv = twoSS ; + ConsAdv, ConsAdV, ConsIAdv = consrSS comma ; + ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ; + +{- +-- RS depends on X, Y and Z, otherwise exactly like previous. +-- RS can modify CNs, which are open for …, and have inherent … +lincat + [RS] = {s1,s2 : … => Str} ; + +lin + BaseRS = twoTable … ; + ConsRS = consrTable … comma ; + ConjRS = conjunctDistrTable ; + +lincat + [S] = {} ; + +lin + BaseS x y = y ** { } ; + ConsS x xs = + xs ** { } ; + ConjS co xs = {} ; + +lincat + [AP] = {} ; + +lin + BaseAP x y = twoTable … x y ** y ; + ConsAP a as = consrTable … comma as a ** as ; + ConjAP co as = conjunctDistrTable … co as ** as ; + +lincat + [CN] = { } ; + +lin + BaseCN = {} ; + ConsCN = {} ; + ConjCN co cs = conjunctDistrTable … co cs ** cs ; + +lincat + [DAP] = + +lin + BaseDAP x y = x ** + ConsDAP xs x = xs ** + ConjDet conj xs = xs ** + + +-- Noun phrases +lincat + [NP] = + +lin + BaseNP x y = twoTable … x y ** y ; + ConsNP x xs = consrTable … comma as a ** as ; + ConjNP co as = conjunctDistrTable … co as ** as ; +-} } diff --git a/src/hungarian/ConstructionHun.gf b/src/hungarian/ConstructionHun.gf new file mode 100644 index 000000000..51edc500a --- /dev/null +++ b/src/hungarian/ConstructionHun.gf @@ -0,0 +1,113 @@ +concrete ConstructionHun of Construction = CatHun ** open ParadigmsHun in { + +lincat + Timeunit = N ; + Weekday = N ; + Monthday = NP ; + Month = N ; + Year = NP ; +{- +lin + + timeunitAdv n time = + weekdayPunctualAdv w = ; -- on Sunday + weekdayHabitualAdv w = ; -- on Sundays + weekdayNextAdv w = -- next Sunday + weekdayLastAdv w = -- last Sunday + + monthAdv m = mkAdv in_Prep (mkNP m) ; + yearAdv y = mkAdv in_Prep y ; + dayMonthAdv d m = ; -- on 17 May + monthYearAdv m y = ; -- in May 2012 + dayMonthYearAdv d m y = ; -- on 17 May 2013 + + intYear = symb ; + intMonthday = symb ; + +lincat Language = N ; + +lin InLanguage l = mkAdv ???_Prep (mkNP l) ; + +lin + weekdayN w = w ; + monthN m = m ; + + weekdayPN w = mkPN w ; + monthPN m = mkPN m ; + + languageCN l = mkCN l ; + languageNP l = mkNP l ; + + +oper mkLanguage : Str -> N = \s -> mkN s ; + +---------------------------------------------- +---- lexicon of special names + +lin second_Timeunit = mkN "second" ; +lin minute_Timeunit = mkN "minute" ; +lin hour_Timeunit = mkN "hour" ; +lin day_Timeunit = mkN "day" ; +lin week_Timeunit = mkN "week" ; +lin month_Timeunit = mkN "month" ; +lin year_Timeunit = mkN "year" ; + +lin monday_Weekday = mkN "Monday" ; +lin tuesday_Weekday = mkN "Tuesday" ; +lin wednesday_Weekday = mkN "Wednesday" ; +lin thursday_Weekday = mkN "Thursday" ; +lin friday_Weekday = mkN "Friday" ; +lin saturday_Weekday = mkN "Saturday" ; +lin sunday_Weekday = mkN "Sunday" ; + +lin january_Month = mkN "January" ; +lin february_Month = mkN "February" ; +lin march_Month = mkN "March" ; +lin april_Month = mkN "April" ; +lin may_Month = mkN "May" ; +lin june_Month = mkN "June" ; +lin july_Month = mkN "July" ; +lin august_Month = mkN "August" ; +lin september_Month = mkN "September" ; +lin october_Month = mkN "October" ; +lin november_Month = mkN "November" ; +lin december_Month = mkN "December" ; + +lin afrikaans_Language = mkLanguage "Afrikaans" ; +lin amharic_Language = mkLanguage "Amharic" ; +lin arabic_Language = mkLanguage "Arabic" ; +lin bulgarian_Language = mkLanguage "Bulgarian" ; +lin catalan_Language = mkLanguage "Catalan" ; +lin chinese_Language = mkLanguage "Chinese" ; +lin danish_Language = mkLanguage "Danish" ; +lin dutch_Language = mkLanguage "Dutch" ; +lin english_Language = mkLanguage "Euslish" ; +lin estonian_Language = mkLanguage "Estonian" ; +lin finnish_Language = mkLanguage "Finnish" ; +lin french_Language = mkLanguage "French" ; +lin german_Language = mkLanguage "German" ; +lin greek_Language = mkLanguage "Greek" ; +lin hebrew_Language = mkLanguage "Hebrew" ; +lin hindi_Language = mkLanguage "Hindi" ; +lin japanese_Language = mkLanguage "Japanese" ; +lin italian_Language = mkLanguage "Italian" ; +lin latin_Language = mkLanguage "Latin" ; +lin latvian_Language = mkLanguage "Latvian" ; +lin maltese_Language = mkLanguage "Maltese" ; +lin nepali_Language = mkLanguage "Nepali" ; +lin norwegian_Language = mkLanguage "Norwegian" ; +lin persian_Language = mkLanguage "Persian" ; +lin polish_Language = mkLanguage "Polish" ; +lin punjabi_Language = mkLanguage "Punjabi" ; +lin romanian_Language = mkLanguage "Romanian" ; +lin russian_Language = mkLanguage "Russian" ; +lin sindhi_Language = mkLanguage "Sindhi" ; +lin spanish_Language = mkLanguage "Spanish" ; +lin swahili_Language = mkLanguage "Swahili" ; +lin swedish_Language = mkLanguage "Swedish" ; +lin thai_Language = mkLanguage "Thai" ; +lin turkish_Language = mkLanguage "Turkish" ; +lin urdu_Language = mkLanguage "Urdu" ; +-} + +} ; diff --git a/src/hungarian/ExtendHun.gf b/src/hungarian/ExtendHun.gf new file mode 100644 index 000000000..334eef4c0 --- /dev/null +++ b/src/hungarian/ExtendHun.gf @@ -0,0 +1,8 @@ +--# -path=.:../common:../abstract + +concrete ExtendHun of Extend = CatHun + -- ** ExtendFunctor - [] + -- with (Grammar=GrammarHun) + ** open Prelude, ResHun, NounHun in { + +} ; diff --git a/src/hungarian/GrammarHun.gf b/src/hungarian/GrammarHun.gf index b65226d17..325a57e95 100644 --- a/src/hungarian/GrammarHun.gf +++ b/src/hungarian/GrammarHun.gf @@ -1,8 +1,6 @@ ---# -path=.:../abstract:../common:prelude - -concrete GrammarHun of Grammar = - NounHun, - VerbHun, +concrete GrammarHun of Grammar = + NounHun, + VerbHun, AdjectiveHun, AdverbHun, NumeralHun, @@ -11,21 +9,12 @@ concrete GrammarHun of Grammar = RelativeHun, ConjunctionHun, PhraseHun, - TextX - [Pol,PPos,PNeg], + TextX, StructuralHun, IdiomHun, - TenseX - [Pol,PPos,PNeg] - ** open ResHun, Prelude in -{ ---{ --- ---flags startcat = Phr ; unlexer = text ; lexer = text ; --- ---lin --- PPos = {s = [] ; p = CPos} ; --- PNeg = {s = [] ; p = CNeg True} ; -- contracted: don't --- --- ---} ; + TenseX + ** { -} +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/src/hungarian/IdiomHun.gf b/src/hungarian/IdiomHun.gf index 0710d0e4d..ce9f3c6c1 100644 --- a/src/hungarian/IdiomHun.gf +++ b/src/hungarian/IdiomHun.gf @@ -1,36 +1,47 @@ -concrete IdiomHun of Idiom = CatHun ** open Prelude, ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- ImpersCl vp = mkClause "it" (agrP3 Sg) vp ; --- GenericCl vp = mkClause "one" (agrP3 Sg) vp ; --- --- CleftNP np rs = mkClause "it" (agrP3 Sg) --- (insertObj (\\_ => rs.s ! np.a) --- (insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ; --- --- CleftAdv ad s = mkClause "it" (agrP3 Sg) --- (insertObj (\\_ => conjThat ++ s.s) --- (insertObj (\\_ => ad.s) (predAux auxBe))) ; --- --- ExistNP np = --- mkClause "there" (agrP3 (fromAgr np.a).n) --- (insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ; --- --- ExistIP ip = --- mkQuestion (ss (ip.s ! npNom)) --- (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ; --- --- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ; --- --- ImpPl1 vp = {s = "let's" ++ infVP VVAux vp (AgP1 Pl)} ; --- --- ImpP3 np vp = {s = "let" ++ np.s ! NPAcc ++ infVP VVAux vp np.a} ; --- ---} --- + +--1 Idiom: Idiomatic Expressions + +concrete IdiomHun of Idiom = CatHun ** open Prelude, ResHun, VerbHun, NounHun, StructuralHun in { + +-- This module defines constructions that are formed in fixed ways, +-- often different even in closely related languages. + +{- lin + + + -- ImpersCl : VP -> Cl ; -- it is hot + -- GenericCl : VP -> Cl ; -- one sleeps + ImpersCl, + GenericCl = \vp -> predVP impersNP (passVP vp) ; + + CleftNP : NP -> RS -> Cl ; -- it is I who did it + CleftAdv : Adv -> S -> Cl ; -- it is here she slept + + -- : NP -> Cl ; -- there is a house + ExistNP np = + + ExistIP : IP -> QCl ; -- which houses are there + +-- 7/12/2012 generalizations of these + + ExistNPAdv : NP -> Adv -> Cl ; -- there is a house in Paris + ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris + + -- : VP -> VP ; + ProgrVP vp = vp ** { + } ; + + + -- : VP -> Utt ; -- let's go + ImpPl1 vp = { } ; + + ImpP3 : NP -> VP -> Utt ; -- let John walk + +-- 3/12/2013 non-reflexive uses of "self" + + SelfAdvVP : VP -> VP ; -- is at home himself + SelfAdVVP : VP -> VP ; -- is himself at home + SelfNP : NP -> NP ; -- the president himself (is at home) +-} } diff --git a/src/hungarian/LangHun.gf b/src/hungarian/LangHun.gf index a15285fca..0a3113132 100644 --- a/src/hungarian/LangHun.gf +++ b/src/hungarian/LangHun.gf @@ -1,14 +1,4 @@ ---# -path=.:../abstract:../common:../prelude - -concrete LangHun of Lang = +concrete LangHun of Lang = GrammarHun, - LexiconHun - ** -{ ---{ --- ---flags startcat = Phr ; unlexer = text ; lexer = text ; --- ---} ; - -} + LexiconHun, + ConstructionHun ; diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index e068cdacc..c305d78d5 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -1,383 +1,418 @@ ---# -path=.:prelude +concrete LexiconHun of Lexicon = CatHun ** + open ParadigmsHun in { -concrete LexiconHun of Lexicon = CatHun ** - open ParadigmsHun, Prelude in -{ ---{ --- - flags coding = utf8 ; +---- +-- A +-- lin add_V3 = mkV3 "" ; +-- lin airplane_N = mkN "" ; +-- lin alas_Interj = mkInterj "" ; +-- lin already_Adv = mkA "" ; +-- lin animal_N = mkN "" ; +-- lin answer_V2S = mkV2S "" ; +-- lin apartment_N = mkN "" ; +lin apple_N = mkN "alma" ; +-- lin art_N = mkN "" ; +-- lin ashes_N = mkN "" ; +-- lin ask_V2Q = mkV2 "" ; + +---- +-- B + +-- lin baby_N = mkN "" ; +-- lin back_N = mkN "" ; +-- lin bad_A = mkA "" ; +-- lin bank_N = mkN "" ; +-- lin bark_N = mkN "" ; +-- lin beautiful_A = mkA "" ; +-- lin become_VA = mkVA "" ; +lin beer_N = mkN "sör" ; +-- lin beg_V2V = mkV2 "" ; +-- lin belly_N = mkN "" ; +-- lin big_A = mkA "" ; +-- lin bike_N = mkN "" ; +-- lin bird_N = mkN "" ; +-- lin bite_V2 = mkV2 "" ; +-- lin black_A = mkA "" ; +-- lin blood_N = mkN "" ; +-- lin blow_V = mkV "" ; +-- lin blue_A = mkA "" ; +-- lin boat_N = mkN "" ; +-- lin bone_N = mkN "" ; +-- lin boot_N = mkN "" ; +-- lin boss_N = mkN "" ; +-- lin book_N = mkN "" ; +-- lin boy_N = mkN "" ; +-- lin bread_N = mkN "" ; +-- lin break_V2 = mkV2 "" ; +-- lin breast_N = mkN "" ; +-- lin breathe_V = mkV "" ; +-- lin broad_A = mkA "" ; +-- lin brother_N2 = mkN "" ; +-- lin brown_A = mkA "" ; +-- lin burn_V = mkV "" ; +-- lin butter_N = mkN "" ; +-- lin buy_V2 = mkV2 "" ; + +---- +-- C + +-- lin camera_N = mkN "" ; +-- lin cap_N = mkN "" ; +-- lin car_N = mkN "" ; +-- lin carpet_N = mkN "" ; +-- lin cat_N = mkN "" ; +-- lin ceiling_N = mkN "" ; +-- lin chair_N = mkN "" ; +-- lin cheese_N = mkN "" ; +-- lin child_N = mkN "" ; +-- lin church_N = mkN "" ; +-- lin city_N = mkN "" ; +-- lin clean_A = mkA "" ; +-- lin clever_A = mkA "" ; +-- lin close_V2 = mkV2 "" ; +-- lin cloud_N = mkN "" ; +-- lin coat_N = mkN "" ; +-- lin cold_A = mkA "" ; +-- lin come_V = mkV "" ; +-- lin computer_N = mkN "" ; +-- lin correct_A = mkA "" ; +-- lin count_V2 = mkV2 "" ; +-- lin country_N = mkN "" ; +-- lin cousin_N = mkN "" ; +-- lin cow_N = mkN "" ; +-- lin cut_V2 = mkV2 "" ; -- -lin --- airplane_N = regN "airplane" ; --- alas_Interj = ss "alas" ; --- answer_V2S = mkV2S (mkV "answer" "answered") toP ; --- apartment_N = regN "apartment" ; --- apple_N = regN "apple" ; --- art_N = regN "art" ; --- ask_V2Q = mkV2Q (regV "ask") noPrep ; --- baby_N = regN "baby" ; --- bad_A = mkADeg "bad" "worse" "worst" "badly" ; --- bank_N = regN "bank" ; --- beautiful_A = compoundADeg (regA "beautiful") ; --- become_VA = mkVA (irregV "become" "became" "become") ; --- beer_N = regN "beer" ; --- beg_V2V = mkV2V (regDuplV "beg") noPrep toP ; --- -- prevent_V2V = ingV2V (mkV "prevent") noPrep (mkPrep "from") ; --- -- make_V2V = mkV2V make_V noPrep noPrep ; --- big_A = duplADeg "big" ; --- bike_N = regN "bike" ; --- bird_N = regN "bird" ; --- black_A = regADeg "black" ; --- blue_A = regADeg "blue" ; --- boat_N = regN "boat" ; --- book_N = regN "book" ; --- boot_N = regN "boot" ; --- boss_N = mkN human (regN "boss") ; --- boy_N = mkN masculine (regN "boy") ; --- bread_N = regN "bread" ; --- break_V2 = dirV2 (irregV "break" "broke" "broken") ; --- broad_A = regADeg "broad" ; --- brother_N2 = mkN2 (mkN masculine (mkN "brother")) (mkPrep "of") ; --- brown_A = regADeg "brown" ; --- butter_N = regN "butter" ; --- buy_V2 = dirV2 (irregV "buy" "bought" "bought") ; --- camera_N = regN "camera" ; --- cap_N = regN "cap" ; --- car_N = regN "car" ; --- carpet_N = regN "carpet" ; --- cat_N = regN "cat" ; --- ceiling_N = regN "ceiling" ; --- chair_N = regN "chair" ; --- cheese_N = regN "cheese" ; - child_N = mkN "gyerek" ; --- church_N = regN "church" ; --- city_N = regN "city" ; --- clean_A = regADeg "clean" ; --- clever_A = mkA "clever" "cleverer" ; --- close_V2 = dirV2 (regV "close") ; --- coat_N = regN "coat" ; --- cold_A = regADeg "cold" ; --- come_V = (irregV "come" "came" "come") ; --- computer_N = regN "computer" ; --- country_N = regN "country" ; --- cousin_N = mkN human (regN "cousin") ; --- cow_N = regN "cow" ; --- die_V = (regV "die") ; --- dirty_A = regADeg "dirty" ; --- distance_N3 = mkN3 (regN "distance") fromP toP ; --- doctor_N = mkN human (regN "doctor") ; --- dog_N = regN "dog" ; --- door_N = regN "door" ; --- drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ; --- easy_A2V = mkA2V (regA "easy") forP ; --- eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ; --- empty_A = regADeg "empty" ; --- enemy_N = regN "enemy" ; --- factory_N = regN "factory" ; --- father_N2 = mkN2 (mkN masculine (mkN "father")) (mkPrep "of") ; --- fear_VS = mkVS (regV "fear") ; --- find_V2 = dirV2 (irregV "find" "found" "found") ; --- fish_N = mk2N "fish" "fish" ; --- floor_N = regN "floor" ; --- forget_V2 = dirV2 (irregDuplV "forget" "forgot" "forgotten") ; --- fridge_N = regN "fridge" ; --- friend_N = mkN human (regN "friend") ; --- fruit_N = regN "fruit" ; --- fun_AV = mkAV (regA "fun") ; --- garden_N = regN "garden" ; --- girl_N = mkN feminine (regN "girl") ; --- glove_N = regN "glove" ; --- gold_N = regN "gold" ; --- good_A = mkADeg "good" "better" "best" "well" ; --- go_V = mk5V "go" "goes" "went" "gone" "going" ; --- green_A = regADeg "green" ; --- harbour_N = regN "harbour" ; --- hate_V2 = dirV2 (regV "hate") ; --- hat_N = regN "hat" ; --- hear_V2 = dirV2 (irregV "hear" "heard" "heard") ; --- hill_N = regN "hill" ; --- hope_VS = mkVS (regV "hope") ; --- horse_N = regN "horse" ; --- hot_A = duplADeg "hot" ; - house_N = mkN "ház" ; --- important_A = compoundADeg (regA "important") ; --- industry_N = regN "industry" ; --- iron_N = regN "iron" ; --- king_N = mkN masculine (regN "king") ; --- know_V2 = dirV2 (irregV "know" "knew" "known") ; --- know_VQ = mkVQ (irregV "know" "knew" "known") ; --- know_VS = mkVS (irregV "know" "knew" "known") ; --- lake_N = regN "lake" ; --- lamp_N = regN "lamp" ; --- learn_V2 = dirV2 (regV "learn") ; --- leather_N = regN "leather" ; --- leave_V2 = dirV2 (irregV "leave" "left" "left") ; --- like_V2 = dirV2 (regV "like") ; --- listen_V2 = prepV2 (regV "listen") toP ; --- live_V = (regV "live") ; --- long_A = regADeg "long" ; --- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ; --- love_N = regN "love" ; --- love_V2 = dirV2 (regV "love") ; --- man_N = mkN masculine (mk2N "man" "men") ; --- married_A2 = mkA2 (regA "married") toP ; --- meat_N = regN "meat" ; --- milk_N = regN "milk" ; --- moon_N = regN "moon" ; --- mother_N2 = mkN2 (mkN feminine (mkN "mother")) (mkPrep "of") ; --- mountain_N = regN "mountain" ; --- music_N = regN "music" ; --- narrow_A = regADeg "narrow" ; --- new_A = regADeg "new" ; --- newspaper_N = regN "newspaper" ; --- oil_N = regN "oil" ; --- old_A = regADeg "old" ; --- open_V2 = dirV2 (regV "open") ; --- paint_V2A = mkV2A (regV "paint") noPrep ; --- paper_N = regN "paper" ; --- paris_PN = mkPN (mkN nonhuman (mkN "Paris")) ; --- peace_N = regN "peace" ; --- pen_N = regN "pen" ; --- planet_N = regN "planet" ; --- plastic_N = regN "plastic" ; --- play_V2 = dirV2 (regV "play") ; --- policeman_N = mkN masculine (mkN "policeman" "policemen") ; --- priest_N = mkN human (regN "priest") ; --- probable_AS = mkAS (regA "probable") ; --- queen_N = mkN feminine (regN "queen") ; --- radio_N = regN "radio" ; --- rain_V0 = mkV0 (regV "rain") ; --- read_V2 = dirV2 (irregV "read" "read" "read") ; --- red_A = duplADeg "red" ; --- religion_N = regN "religion" ; --- restaurant_N = regN "restaurant" ; --- river_N = regN "river" ; --- rock_N = regN "rock" ; --- roof_N = regN "roof" ; --- rubber_N = regN "rubber" ; --- run_V = (irregDuplV "run" "ran" "run") ; --- say_VS = mkVS (irregV "say" "said" "said") ; --- school_N = regN "school" ; --- science_N = regN "science" ; --- sea_N = regN "sea" ; --- seek_V2 = dirV2 (irregV "seek" "sought" "sought") ; --- see_V2 = dirV2 (irregV "see" "saw" "seen") ; --- sell_V3 = dirV3 (irregV "sell" "sold" "sold") toP ; --- send_V3 = dirV3 (irregV "send" "sent" "sent") toP ; --- sheep_N = mk2N "sheep" "sheep" ; --- ship_N = regN "ship" ; --- shirt_N = regN "shirt" ; --- shoe_N = regN "shoe" ; --- shop_N = regN "shop" ; --- short_A = regADeg "short" ; --- silver_N = regN "silver" ; --- sister_N = mkN feminine (mkN "sister") ; --- sleep_V = (irregV "sleep" "slept" "slept") ; --- small_A = regADeg "small" ; --- snake_N = regN "snake" ; --- sock_N = regN "sock" ; --- speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ; --- star_N = regN "star" ; --- steel_N = regN "steel" ; --- stone_N = regN "stone" ; --- stove_N = regN "stove" ; --- student_N = mkN human (regN "student") ; --- stupid_A = mkA "stupid" ; --- sun_N = regN "sun" ; --- switch8off_V2 = dirV2 (partV (regV "switch") "off") ; --- switch8on_V2 = dirV2 (partV (regV "switch") "on") ; --- table_N = regN "table" ; --- talk_V3 = mkV3 (regV "talk") toP aboutP ; --- teacher_N = mkN human (regN "teacher") ; --- teach_V2 = dirV2 (irregV "teach" "taught" "taught") ; --- television_N = regN "television" ; --- thick_A = regADeg "thick" ; --- thin_A = duplADeg "thin" ; --- train_N = regN "train" ; --- travel_V = (regDuplV "travel") ; --- tree_N = regN "tree" ; --- ---- trousers_N = regN "trousers" ; --- ugly_A = mkA "ugly" ; --- understand_V2 = dirV2 (irregV "understand" "understood" "understood") ; --- university_N = regN "university" ; --- village_N = regN "village" ; --- wait_V2 = prepV2 (regV "wait") forP ; --- walk_V = (regV "walk") ; --- warm_A = regADeg "warm" ; --- war_N = regN "war" ; --- watch_V2 = dirV2 (regV "watch") ; --- water_N = regN "water" ; --- white_A = mkA "white" ; --- window_N = regN "window" ; --- wine_N = regN "wine" ; --- win_V2 = dirV2 (irregDuplV "win" "won" "won") ; --- woman_N = mkN feminine (mk2N "woman" "women") ; --- wonder_VQ = mkVQ (mkV "wonder" "wondered") ; --- wood_N = regN "wood" ; --- write_V2 = dirV2 (irregV "write" "wrote" "written") ; --- yellow_A = mkA "yellow" ; --- young_A = regADeg "young" ; +-- ---- +-- -- D -- --- do_V2 = dirV2 (mk5V "do" "does" "did" "done" "doing") ; --- now_Adv = mkAdv "now" ; --- already_Adv = mkAdv "already" ; --- song_N = regN "song" ; --- add_V3 = dirV3 (regV "add") toP ; --- number_N = regN "number" ; --- put_V2 = prepV2 (irregDuplV "put" "put" "put") noPrep ; --- stop_V = regDuplV "stop" ; --- jump_V = regV "jump" ; +-- lin day_N = mkN "" ; +-- 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 door_N = mkN "" ; +-- lin drink_V2 = mkV2 "" ; +-- lin dry_A = mkA "" ; +-- lin dull_A = mkA "" ; +-- lin dust_N = mkN "" ; + +---- +-- E + +-- lin ear_N = mkN "" ; +-- lin earth_N = mkN "" ; +-- lin eat_V2 = mkV2 "" ; +-- lin egg_N = mkN "" ; +-- lin empty_A = mkA "" ; +-- lin enemy_N = mkN "" ; +-- lin eye_N = mkN "" ; + +---- +-- F + +-- lin factory_N = mkN "" ; +-- lin fall_V = mkV "" ; +-- lin far_Adv = mkA "" ; +-- lin fat_N = mkN "" ; +-- lin father_N2 = mkN2 "" ; +-- lin fear_V2 = mkV2 "" ; +-- lin fear_VS = mkVS "" ; +-- lin feather_N = mkN "" ; +-- lin fight_V2 = mkV2 "" ; +-- lin find_V2 = mkV2 "" ; +-- lin fingernail_N = mkN "" ; +-- lin fire_N = mkN "" ; +-- lin fish_N = mkN "" ; +-- lin float_V = mkV "" ; +-- lin floor_N = mkN "" ; +-- lin flow_V = mkV "" ; +-- lin flower_N = mkN "" ; +-- lin fly_V = mkV "" ; +-- lin fog_N = mkN "" ; +-- lin foot_N = mkN "" ; +-- lin forest_N = mkN "" ; +-- lin forget_V2 = mkV2 "" ; +-- lin freeze_V = mkV "" ; +-- lin fridge_N = mkN "" ; +-- lin friend_N = mkN "" ; +-- lin fruit_N = mkN "" ; +-- lin full_A = mkA "" ; +-- --lin fun_AV + +---- +-- G + +-- lin garden_N = mkN "" ; +-- lin girl_N = mkN "" ; +-- lin give_V3 = mkV3 "" ; +-- lin glove_N = mkN "" ; +-- lin go_V = mkV "" ; +-- lin gold_N = mkN "" ; +-- lin good_A = mkA "" ; +-- lin grammar_N = mkN "" ; +-- lin grass_N = mkN "" ; +-- lin green_A = mkA "" ; + +---- +-- H + +-- lin hair_N = mkN "" ; +-- lin hand_N = mkN "" ; +-- lin harbour_N = mkN "" ; +-- lin hat_N = mkN "" ; +-- lin hate_V2 = mkV2 "" ; +-- lin head_N = mkN "" ; +-- lin hear_V2 = mkV2 "" ; +-- lin heart_N = mkN "" ; +-- lin heavy_A = mkA "" ; +-- lin hill_N = mkN "" ; +-- lin hit_V2 = mkV2 "" ; +-- lin hold_V2 = mkV2 "" ; +-- lin hope_VS = mkV "" ; +-- lin horn_N = mkN "" ; +-- lin horse_N = mkN "" ; +-- lin hot_A = mkA "" ; +lin house_N = mkN "ház" ; +-- lin hunt_V2 = mkV2 "" ; +-- lin husband_N = mkN "" ; + +-------- +-- I - K + +-- lin ice_N = mkN "" ; +-- lin industry_N = mkN "" ; +-- lin iron_N = mkN "" ; +-- lin john_PN = mkPN "" ; +-- lin jump_V = mkV "" ; +-- lin kill_V2 = mkV2 "" ; +-- lin king_N = mkN "" ; +-- lin knee_N = mkN "" ; +-- lin know_V2 = mkV2 "" ; +-- lin know_VQ = mkVQ "" ; +-- lin know_VS = mkV "" ; + + +---- +-- L + +-- lin lake_N = mkN "" ; +-- lin lamp_N = mkN "" ; +-- lin language_N = mkN "" ; +-- lin laugh_V = mkV "" ; +-- lin leaf_N = mkN "" ; +-- lin learn_V2 = mkV2 "" ; +-- lin leather_N = mkN "" ; +-- lin leave_V2 = mkV2 "" ; +-- lin leg_N = mkN "" ; +-- lin lie_V = mkV "" ; +-- lin like_V2 = mkV2 "" ; +-- lin listen_V2 = mkV2 "" ; +-- lin live_V = mkV ""; +-- lin liver_N = mkN "" ; +-- lin long_A = mkA "" ; +-- lin lose_V2 = mkV2 "" ; +-- lin louse_N = mkN "" ; +-- lin love_N = mkN "" ; +-- lin love_V2 = mkV2 "" ; + +---- +-- M + +lin man_N = mkN "férfi" ; +-- lin married_A2 = mkA "" ; +-- lin meat_N = mkN "" ; +-- lin milk_N = mkN "" ; +-- lin moon_N = mkN "" ; +-- lin mother_N2 = mkN2 "" ; +-- lin mountain_N = mkN "" ; +-- lin mouth_N = mkN "" ; +-- lin music_N = mkN "" ; + +---- +-- 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 now_Adv = mkAdv "most" ; +-- lin number_N = mkN "" ; -- --- left_Ord = mkOrd "left" ; --- right_Ord = mkOrd "right" ; --- far_Adv = mkAdv "far" ; --- correct_A = (regA "correct") ; --- dry_A = regA "dry" ; --- dull_A = regA "dull" ; --- full_A = regA "full" ; --- heavy_A = regA "heavy" ; --- near_A = regA "near" ; --- rotten_A = (regA "rotten") ; --- round_A = regA "round" ; --- sharp_A = regA "sharp" ; --- smooth_A = regA "smooth" ; --- straight_A = regA "straight" ; --- wet_A = regA "wet" ; ---- --- wide_A = regA "wide" ; --- animal_N = regN "animal" ; --- ashes_N = regN "ash" ; -- FIXME: plural only? --- back_N = regN "back" ; --- bark_N = regN "bark" ; --- belly_N = regN "belly" ; --- blood_N = regN "blood" ; --- bone_N = regN "bone" ; --- breast_N = regN "breast" ; --- cloud_N = regN "cloud" ; --- day_N = regN "day" ; --- dust_N = regN "dust" ; --- ear_N = regN "ear" ; --- earth_N = regN "earth" ; --- egg_N = regN "egg" ; --- eye_N = regN "eye" ; --- fat_N = regN "fat" ; --- feather_N = regN "feather" ; --- fingernail_N = regN "fingernail" ; --- fire_N = regN "fire" ; --- flower_N = regN "flower" ; --- fog_N = regN "fog" ; --- foot_N = mk2N "foot" "feet" ; --- forest_N = regN "forest" ; --- grass_N = regN "grass" ; --- guts_N = regN "gut" ; -- FIXME: no singular --- hair_N = regN "hair" ; --- hand_N = regN "hand" ; --- head_N = regN "head" ; --- heart_N = regN "heart" ; --- horn_N = regN "horn" ; --- husband_N = mkN masculine (regN "husband") ; --- ice_N = regN "ice" ; --- knee_N = regN "knee" ; --- leaf_N = mk2N "leaf" "leaves" ; --- leg_N = regN "leg" ; --- liver_N = regN "liver" ; --- louse_N = mk2N "louse" "lice" ; --- mouth_N = regN "mouth" ; --- name_N = regN "name" ; --- neck_N = regN "neck" ; --- night_N = regN "night" ; --- nose_N = regN "nose" ; --- person_N = mkN human (regN "person") ; --- rain_N = regN "rain" ; --- road_N = regN "road" ; --- root_N = regN "root" ; --- rope_N = regN "rope" ; --- salt_N = regN "salt" ; --- sand_N = regN "sand" ; --- seed_N = regN "seed" ; --- skin_N = regN "skin" ; --- sky_N = regN "sky" ; --- smoke_N = regN "smoke" ; --- snow_N = regN "snow" ; --- stick_N = regN "stick" ; --- tail_N = regN "tail" ; --- tongue_N = regN "tongue" ; --- tooth_N = mk2N "tooth" "teeth" ; --- wife_N = mkN feminine (mk2N "wife" "wives") ; --- wind_N = regN "wind" ; --- wing_N = regN "wing" ; --- worm_N = regN "worm" ; --- year_N = regN "year" ; --- blow_V = IrregHun.blow_V ; --- breathe_V = dirV2 (regV "breathe") ; --- burn_V = IrregHun.burn_V ; --- dig_V = IrregHun.dig_V ; --- fall_V = IrregHun.fall_V ; --- float_V = regV "float" ; --- flow_V = regV "flow" ; --- fly_V = IrregHun.fly_V ; --- freeze_V = IrregHun.freeze_V ; --- give_V3 = dirV3 give_V toP ; --- laugh_V = regV "laugh" ; --- lie_V = IrregHun.lie_V ; --- play_V = regV "play" ; --- sew_V = IrregHun.sew_V ; --- sing_V = IrregHun.sing_V ; --- sit_V = IrregHun.sit_V ; --- smell_V = regV "smell" ; --- spit_V = IrregHun.spit_V ; --- stand_V = IrregHun.stand_V ; --- swell_V = IrregHun.swell_V ; --- swim_V = IrregHun.swim_V ; --- think_V = IrregHun.think_V ; --- turn_V = regV "turn" ; --- vomit_V = mkV "vomit" "vomited" ; +-- -------- +-- -- O - P -- --- bite_V2 = dirV2 IrregHun.bite_V ; --- count_V2 = dirV2 (regV "count") ; --- cut_V2 = dirV2 IrregHun.cut_V ; --- fear_V2 = dirV2 (regV "fear") ; --- fight_V2 = dirV2 fight_V ; --- hit_V2 = dirV2 hit_V ; --- hold_V2 = dirV2 hold_V ; --- hunt_V2 = dirV2 (regV "hunt") ; --- kill_V2 = dirV2 (regV "kill") ; --- pull_V2 = dirV2 (regV "pull") ; --- push_V2 = dirV2 (regV "push") ; --- rub_V2 = dirV2 (regDuplV "rub") ; --- scratch_V2 = dirV2 (regV "scratch") ; --- split_V2 = dirV2 split_V ; --- squeeze_V2 = dirV2 (regV "squeeze") ; --- stab_V2 = dirV2 (regDuplV "stab") ; --- suck_V2 = dirV2 (regV "suck") ; --- throw_V2 = dirV2 throw_V ; --- tie_V2 = dirV2 (regV "tie") ; --- wash_V2 = dirV2 (regV "wash") ; --- wipe_V2 = dirV2 (regV "wipe") ; -- ----- other_A = regA "other" ; +-- lin oil_N = mkN "" ; +-- lin old_A = mkA "" ; +-- lin open_V2 = mkV2 "" ; +-- lin paint_V2A = mkV2A "" ; +-- lin paper_N = mkN "" ; +-- lin paris_PN = mkPN "Paris" ; +-- lin peace_N = mkN "" ; +-- lin pen_N = mkN "" ; +-- lin person_N = mkN "" ; +-- lin planet_N = mkN "" ; +-- lin plastic_N = mkN "" ; +-- lin play_V = mkV "" ; +-- lin policeman_N = mkN "" ; +-- lin priest_N = mkN "" ; +-- lin pull_V2 = mkV2 "" ; +-- lin push_V2 = mkV2 "" ; +-- lin put_V2 = mkV2 "" ; -- --- grammar_N = regN "grammar" ; --- language_N = regN "language" ; --- rule_N = regN "rule" ; +-- -------- +-- -- Q - R -- ----- added 4/6/2007 --- john_PN = mkPN (mkN masculine (mkN "John")) ; --- question_N = regN "question" ; --- ready_A = regA "ready" ; --- reason_N = regN "reason" ; --- today_Adv = mkAdv "today" ; --- uncertain_A = regA "uncertain" ; --- ---oper --- aboutP = mkPrep "about" ; --- atP = mkPrep "at" ; --- forP = mkPrep "for" ; --- fromP = mkPrep "from" ; --- inP = mkPrep "in" ; --- onP = mkPrep "on" ; --- toP = mkPrep "to" ; --- ---} ; +-- lin queen_N = mkN "" ; +-- lin question_N = mkN "" ; +-- lin radio_N = mkN "" ; +-- lin rain_N = mkN "" ; +-- lin rain_V0 = mkV "" ; +-- lin read_V2 = mkV2 "" ; +-- lin ready_A = mkA "" ; +-- lin reason_N = mkN "" ; +lin red_A = mkA "piros" ; +-- lin religion_N = mkN "" ; +-- lin restaurant_N = mkN "" ; +-- lin river_N = mkN "" ; +-- lin road_N = mkN "" ; +-- lin rock_N = mkN "" ; +-- lin roof_N = mkN "" ; +-- lin root_N = mkN "" ; +-- lin rope_N = mkN "" ; +-- lin rotten_A = mkA "" ; +-- lin round_A = mkA "" ; +-- lin rub_V2 = mkV2 "" ; +-- lin rubber_N = mkN "" ; +-- lin rule_N = mkN "" ; +-- lin run_V = mkV "" ; + +---- +-- S + +-- lin salt_N = mkN "" ; +-- lin sand_N = mkN "" ; +-- lin say_VS = mkVS "" ; +-- lin school_N = mkN "" ; +-- lin science_N = mkN "" ; +-- lin scratch_V2 = mkV2 "" ; +-- lin sea_N = mkN "" ; +-- lin see_V2 = mkV2 "" ; +-- lin seed_N = mkN "" ; +-- lin seek_V2 = mkV2 "" ; +-- lin sell_V3 = mkV3 "" ; +-- lin send_V3 = mkV3 "" ; +-- lin sew_V = mkV "" ; +-- lin sharp_A = mkA "" ; +-- lin sheep_N = mkN "" fem ; +-- lin ship_N = mkN "" ; +-- lin shirt_N = mkN "" ; +-- lin shoe_N = mkN "" ; +-- lin shop_N = mkN "" ; +-- lin short_A = mkA "" ; +-- lin silver_N = mkN "" ; +-- lin sing_V = mkV "" ; +-- lin sister_N = mkN "" ; +-- lin sit_V = mkV "" ; +-- lin skin_N = mkN "" ; +-- lin sky_N = mkN "" ; +-- lin sleep_V = mkV "" ; +-- lin small_A = mkA "" ; +-- 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 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 stone_N = mkN "" ; +-- lin stop_V = mkV "" ; +-- lin stove_N = mkN "" ; +-- lin straight_A = mkA "" ; +-- lin student_N = mkN "" ; +-- lin stupid_A = mkA "" ; +-- lin suck_V2 = mkV2 "" ; +-- lin sun_N = mkN "" ; +-- lin swell_V = mkV "" ; +-- lin swim_V = mkV "" ; + +---- +-- T + + +-- lin table_N = mkN "" ; +-- lin tail_N = mkN "" ; +-- lin talk_V3 = mkV3 "" ; +-- lin teach_V2 = mkV2 "" ; +lin teacher_N = mkN "tanár" ; +-- lin television_N = mkN "" ; +-- lin thick_A = mkA "" ; +-- lin thin_A = mkA "" ; +-- 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 travel_V = mkV "" ; +-- lin tree_N = mkN "" ; +-- lin turn_V = mkV "" ; + +-------- +-- U - V + +-- lin ugly_A = mkA "" ; +-- lin uncertain_A = mkA "" ; +-- lin understand_V2 = mkV2 "" ; +-- lin university_N = mkN "" ; +-- lin village_N = mkN "" ; +-- lin vomit_V = mkV2 "" ; + +-------- +-- W - Y + +-- lin wait_V2 = mkV2 "" ; +-- lin walk_V = mkV "" ; +-- lin war_N = mkN "" ; +-- lin warm_A = mkA "" ; +-- lin wash_V2 = mkV2 "" ; +-- lin watch_V2 = mkV2 "" ; +-- lin water_N = mkNoun "" ; +-- lin wet_A = mkA "" ; +-- lin white_A = mkA "" ; +-- lin wide_A = mkA "" ; +-- lin wife_N = mkN "" ; +-- lin win_V2 = mkV2 "" ; +-- lin wind_N = mkN "" ; +-- lin window_N = mkN "" ; +-- lin wine_N = mkN "" ; +-- lin wing_N = mkN "" ; +-- lin wipe_V2 = mkV2 "" ; +lin woman_N = mkN "nő" ; +-- lin wonder_VQ = mkVQ "" ; +-- lin wood_N = mkN "" ; +-- lin worm_N = mkN "" ; +-- lin write_V2 = mkV2 "" ; +-- lin year_N = mkN "" ; +-- lin yellow_A = mkA "" ; +-- lin young_A = mkA "" ; } diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index be7cc5fe7..54d10cbff 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -1,144 +1,208 @@ -concrete NounHun of Noun = CatHun ** open MorphoHun, ResHun, Prelude in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- DetCN det cn = { --- s = \\c => det.s ++ cn.s ! det.n ! npcase2case c ; --- a = agrgP3 det.n cn.g --- } ; --- --- UsePN pn = {s = \\c => pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ; --- UsePron p = p ; --- --- PredetNP pred np = { --- s = \\c => pred.s ++ np.s ! c ; --- a = np.a --- } ; --- --- PPartNP np v2 = { --- s = \\c => np.s ! c ++ v2.s ! VPPart ; --- a = np.a --- } ; --- --- RelNP np rs = { --- s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; --- a = np.a --- } ; --- --- AdvNP np adv = { --- s = \\c => np.s ! c ++ adv.s ; --- a = np.a --- } ; --- --- DetQuant quant num = { --- s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom; --- sp = \\c => case num.hasCard of { --- False => quant.sp ! num.hasCard ! num.n ! c ++ num.s ! Nom ; --- True => quant.sp ! num.hasCard ! num.n ! npNom ++ num.s ! npcase2case c --- } ; --- n = num.n ; --- hasNum = num.hasCard --- } ; --- --- DetQuantOrd quant num ord = { --- s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! Nom; --- sp = \\c => quant.sp ! num.hasCard ! num.n ! npNom ++ num.s ! Nom ++ ord.s ! npcase2case c ; --- n = num.n ; --- hasNum = True --- } ; --- --- DetNP det = { --- s = case det.hasNum of {True => \\_ => det.s ; _ => \\c => det.sp ! c} ; --- a = agrP3 det.n --- } ; --- --- PossPron p = { --- s = \\_,_ => p.s ! NCase Gen ; --- sp = \\_,_,c => p.sp ! npcase2case c --- } ; --- --- NumSg = {s = \\c => []; n = Sg ; hasCard = False} ; --- NumPl = {s = \\c => []; n = Pl ; hasCard = False} ; ------b NoOrd = {s = []} ; --- --- NumCard n = n ** {hasCard = True} ; --- --- NumDigits n = {s = n.s ! NCard ; n = n.n} ; --- OrdDigits n = {s = n.s ! NOrd} ; --- --- NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; --- OrdNumeral numeral = {s = numeral.s ! NOrd} ; --- --- AdNum adn num = {s = \\c => adn.s ++ num.s!c ; n = num.n} ; --- --- OrdSuperl a = {s = \\c => a.s ! AAdj Superl c } ; --- --- DefArt = { --- s = \\hasCard,n => artDef ; --- sp = \\hasCard,n => case of { --- => table { NCase Gen => "its"; _ => "it" } ; --- => table { NCase Nom => "they"; NPAcc => "them"; NCase Gen => "theirs" } ; --- _ => \\c => artDef --- } --- } ; --- --- IndefArt = { --- s = \\hasCard,n => case of { --- => artIndef ; --- _ => [] --- } ; --- sp = \\hasCard,n => case of { --- => table {NCase Gen => "one's"; _ => "one" }; --- => table {NCase Gen => "ones'"; _ => "ones" } ; --- _ => \\c => [] --- } --- } ; --- --- MassNP cn = { --- s = \\c => cn.s ! Sg ! npcase2case c ; --- a = agrP3 Sg --- } ; --- --- UseN n = n ; --- UseN2 n = n ; ------b UseN3 n = n ; --- --- Use2N3 f = { --- s = \\n,c => f.s ! n ! Nom ; --- g = f.g ; --- c2 = f.c2 --- } ; --- --- Use3N3 f = { --- s = \\n,c => f.s ! n ! Nom ; --- g = f.g ; --- c2 = f.c3 --- } ; --- --- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! NPAcc ; g = f.g} ; --- ComplN3 f x = { --- s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! NPAcc ; --- g = f.g ; --- c2 = f.c3 --- } ; --- --- AdjCN ap cn = { --- s = \\n,c => preOrPost ap.isPre (ap.s ! agrgP3 n cn.g) (cn.s ! n ! c) ; --- g = cn.g --- } ; --- RelCN cn rs = { --- s = \\n,c => cn.s ! n ! c ++ rs.s ! agrgP3 n cn.g ; --- g = cn.g --- } ; --- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s ; g = cn.g} ; --- --- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ; --- --- ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! NCase c ; g = cn.g} ; --- ---} +concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { + + flags optimize=all_subs ; + + lin + +--2 Noun phrases + +-- : Det -> CN -> NP + DetCN det cn = emptyNP ** { + s = \\c => det.s ! c ++ cn.s ! det.n ! c ; + agr = ; + } ; + +{- + -- : PN -> NP ; + UsePN pn = pn ** {} ; + + -- : Pron -> NP ; + UsePron pron = pron ; + + -- : Predet -> NP -> NP ; -- only the man + PredetNP predet np = np ** {s = } ; + +-- A noun phrase can also be postmodified by the past participle of a +-- verb, by an adverb, or by a relative clause + + + -- : NP -> V2 -> NP ; -- the man seen + PPartNP np v2 = np ** { + s = \\c => v2.s ! ??? ++ np.s ! c } ; ---- + + -- : NP -> Adv -> NP ; -- Paris today ; boys, such as .. + AdvNP,ExtAdvNP = \np,adv -> np ** {} ; + + -- : NP -> RS -> NP ; -- Paris, which is here + RelNP np rs = np ** {} ; + +-- Determiners can form noun phrases directly. + + -- : Det -> NP ; + DetNP det = emptyNP ** { + s = det.sp ; + agr = ; + } ; + + -- : CN -> NP ; + MassNP cn = emptyNP ** { + s = \\c => cn.s ! Sg ! c ; + agr = ; + } ; +-} + +--2 Determiners + +-- The determiner has a fine-grained structure, in which a 'nucleus' +-- quantifier and an optional numeral can be discerned. + + -- : Quant -> Num -> Det ; + DetQuant quant num = quant ** num ** { + s = \\c => quant.s ! num.n ! c + ++ num.s ! Attrib ; -- TODO: add inflection table in numbers + sp = \\c => quant.sp ! num.n ! c + ++ num.s ! Indep + } ; + + -- : Quant -> Num -> Ord -> Det ; -- these five best + -- DetQuantOrd quant num ord = + -- let theseFive = DetQuant quant num in theseFive ** { + -- } ; + +-- Whether the resulting determiner is singular or plural depends on the +-- cardinal. + +-- All parts of the determiner can be empty, except $Quant$, which is +-- the "kernel" of a determiner. It is, however, the $Num$ that determines +-- the inherent number. + + NumSg = baseNum ; + NumPl = baseNum ** {n = Pl} ; + + -- : Card -> Num ; + NumCard card = card ; + + -- : Digits -> Card ; + -- NumDigits dig = + + -- : Numeral -> Card ; + NumNumeral num = num ; + +{- + -- : AdN -> Card -> Card ; + AdNum adn card = card ** { s = adn.s ++ card.s } ; + + -- : Digits -> Ord ; + OrdDigits digs = digs ** { s = digs.s ! NOrd } ; + + -- : Numeral -> Ord ; + OrdNumeral num = num ** { + s = \\_ => num.ord + } ; + + -- : A -> Ord ; + OrdSuperl a = { + s = \\af => "제일" ++ a.s ! af ; + n = Sg -- ?? is this meaningful? + } ; + +-- One can combine a numeral and a superlative. + + -- : Numeral -> A -> Ord ; -- third largest + OrdNumeralSuperl num a = num ** { } ; +-} + -- : Quant + DefArt = { + s, + sp = \\_,_ => pre {"a" ; "az" / v } ; + } ; + + + -- : Quant + IndefArt = { + s, + sp = \\_,_ => "egy" ; + } ; + + -- : Pron -> Quant + -- PossPron pron = + -- let p = pron.poss ; + -- in DefArt ** { + -- } ; + +--2 Common nouns + + -- : N -> CN + -- : N2 -> CN ; + UseN,UseN2 = \n -> n ; + + -- : N2 -> NP -> CN ; + -- ComplN2 n2 np = + + -- : N3 -> NP -> N2 ; -- distance from this city (to Paris) + -- ComplN3 n3 np = + + + -- : N3 -> N2 ; -- distance (from this city) + -- Use2N3 n3 = lin N2 n3 ** { c2 = n3.c3 } ; + + -- : N3 -> N2 ; -- distance (to Paris) + -- Use3N3 n3 = lin N2 n3 ; + + -- : AP -> CN -> CN + AdjCN ap cn = cn ** { + s = \\n,c => ap.s ! Sg ++ cn.s ! n ! c + } ; + + -- : CN -> RS -> CN ; + -- RelCN cn rs = cn ** { + -- } ; + +{- + -- : CN -> Adv -> CN ; + AdvCN cn adv = cn ** { } ; + +-- Nouns can also be modified by embedded sentences and questions. +-- For some nouns this makes little sense, but we leave this for applications +-- to decide. Sentential complements are defined in VerbHun. + + -- : CN -> SC -> CN ; -- question where she sleeps + SentCN cn sc = cn ** { } ; + + +--2 Apposition + +-- This is certainly overgenerating. + + -- : CN -> NP -> CN ; -- city Paris (, numbers x and y) + ApposCN cn np = cn ** { s = } ; +-} + +--2 Possessive and partitive constructs + + -- : PossNP : CN -> NP -> CN ; + -- PossNP cn np = cn ** { + -- } ; + + -- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples + -- PartNP cn np = cn ** { + -- } ; + +{- + +-- This is different from the partitive, as shown by many languages. + + -- : Det -> NP -> NP ; + CountNP det np = np ** + { } ; -- Nonsense for DefArt or IndefArt + +--3 Conjoinable determiners and ones with adjectives + + -- : DAP -> AP -> DAP ; -- the large (one) + AdjDAP dap ap = dap ** { } ; + + -- : Det -> DAP ; -- this (or that) + DetDAP det = det ; +-} } diff --git a/src/hungarian/NumeralHun.gf b/src/hungarian/NumeralHun.gf index 680913493..f2be44486 100644 --- a/src/hungarian/NumeralHun.gf +++ b/src/hungarian/NumeralHun.gf @@ -1,99 +1,91 @@ -concrete NumeralHun of Numeral = CatHun [Numeral,Digits] ** open ResHun in -{ ---{ --- ---lincat --- Digit = {s : DForm => CardOrd => Case => Str} ; --- Sub10 = {s : DForm => CardOrd => Case => Str ; n : Number} ; --- Sub100 = {s : CardOrd => Case => Str ; n : Number} ; --- Sub1000 = {s : CardOrd => Case => Str ; n : Number} ; --- Sub1000000 = {s : CardOrd => Case => Str ; n : Number} ; --- ---lin num x = x ; ---lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in --- {s = \\f,o => case of { --- => regGenitiveS "twelfth" ; --- _ => two.s ! f ! o --- } --- } ; --- ---lin n3 = mkNum "three" "thirteen" "thirty" "third" ; ---lin n4 = mkNum "four" "fourteen" "forty" "fourth" ; ---lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ; ---lin n6 = regNum "six" ; ---lin n7 = regNum "seven" ; ---lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ; ---lin n9 = mkNum "nine" "nineteen" "ninety" "ninth" ; --- ---lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ; ---lin pot0 d = d ** {n = Pl} ; ---lin pot110 = regCardOrd "ten" ** {n = Pl} ; ---lin pot111 = regCardOrd "eleven" ** {n = Pl} ; ---lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ; ---lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ; ---lin pot1 d = {s = d.s ! ten} ** {n = Pl} ; ---lin pot1plus d e = { --- s = \\o,c => d.s ! ten ! NCard ! Nom ++ "-" ++ e.s ! unit ! o ! c ; n = Pl} ; ---lin pot1as2 n = n ; ---lin pot2 d = {s = \\o,c => d.s ! unit ! NCard ! Nom ++ mkCard o "hundred" ! c} ** {n = Pl} ; ---lin pot2plus d e = { --- s = \\o,c => d.s ! unit ! NCard ! Nom ++ "hundred" ++ "and" ++ e.s ! o ! c ; n = Pl} ; ---lin pot2as3 n = n ; ---lin pot3 n = { --- s = \\o,c => n.s ! NCard ! Nom ++ mkCard o "thousand" ! c ; n = Pl} ; ---lin pot3plus n m = { --- s = \\o,c => n.s ! NCard ! Nom ++ "thousand" ++ m.s ! o ! c; n = Pl} ; --- ----- numerals as sequences of digits --- --- lincat --- Dig = TDigit ; --- --- lin --- IDig d = d ** {tail = T1} ; --- --- IIDig d i = { --- s = \\o,c => d.s ! NCard ! Nom ++ commaIf i.tail ++ i.s ! o ! c ; --- n = Pl ; --- tail = inc i.tail --- } ; --- --- D_0 = mkDig "0" ; --- D_1 = mk3Dig "1" "1st" Sg ; --- D_2 = mk2Dig "2" "2nd" ; --- D_3 = mk2Dig "3" "3rd" ; --- D_4 = mkDig "4" ; --- D_5 = mkDig "5" ; --- D_6 = mkDig "6" ; --- D_7 = mkDig "7" ; --- D_8 = mkDig "8" ; --- D_9 = mkDig "9" ; --- --- oper --- commaIf : DTail -> Str = \t -> case t of { --- T3 => BIND++","++BIND ; --- _ => BIND --- } ; --- --- inc : DTail -> DTail = \t -> case t of { --- T1 => T2 ; --- T2 => T3 ; --- T3 => T1 --- } ; --- --- mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; --- mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ; --- --- mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { --- s = table {NCard => regGenitiveS c ; NOrd => regGenitiveS o} ; --- n = n --- } ; --- --- TDigit = { --- n : Number ; --- s : CardOrd => Case => Str --- } ; --- ---} +concrete NumeralHun of Numeral = CatHun [Numeral,Digits] ** + open Prelude, ResHun in { -} +lincat + Digit, + Sub10 = LinDigit ; + Sub100, + Sub1000, + Sub1000000 = ResHun.Numeral ; +lin + + -- TODO: Add case inflection and ordinal forms to all numerals + + -- : Sub1000000 -> Numeral + num x = x ; + + -- : Digit + n2 = mkNum5 "kettő" "húsz" "két" "huszon" "második" ; + n3 = mkNum3 "három" "harminc" "harmadik" ; + n4 = mkNum3 "négy" "negyven" "negyedik" ; + n5 = mkNum3 "öt" "ötven" "ötödik" ; + n6 = mkNum3 "hat" "hatvan" "hatodik" ; + n7 = mkNum3 "hét" "hetven" "hetedik" ; + n8 = mkNum3 "nyolc" "nyolcvan" "nyolcadik" ; + n9 = mkNum3 "kilenc" "kilencven" "kilencedik" ; + + -- : Sub10 ; -- 1 + pot01 = mkNum3 "egy" "tíz" "első" ** {n=Sg} ; + -- : Digit -> Sub10 ; -- d * 1 + pot0 d = d ; + + -- : Sub100 ; -- 10 + pot110 = {s = table {p => "tíz"} ; n=Pl} ; + -- : Sub100 ; -- 11 + pot111 = {s = table {p => "tizenegy"} ; n=Pl} ; + -- : Digit -> Sub100 ; -- 10 + d + pot1to19 d = + {s = table {p => "tizen" ++ d.s ! } ; + n = Pl} ; + -- : Sub10 -> Sub100 ; -- coercion of 1..9 + pot0as1 n = + {s = table {p => n.s ! } ; + n = Pl} ; + + -- : Digit -> Sub100 ; -- d * 10 + pot1 d = + {s = table {p => d.s ! } ; + n = Pl} ; + -- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n + pot1plus d e = + {s = table {p => (d.s ! ) ++ e.s ! } ; + n = Pl} ; + + -- : Sub100 -> Sub1000 ; -- coercion of 1..99 + pot1as2 n = n ; + -- : Sub10 -> Sub1000 ; -- m * 100 + pot2 d = + {s = table {p => (d.s ! ) ++ "száz"} ; + n = Pl} ; + -- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n + pot2plus d e = + {s = table {p => (d.s ! ) ++ "száz" ++ e.s ! p} ; + n = Pl} ; + + -- : Sub1000 -> Sub1000000 ; -- coercion of 1..999 + pot2as3 n = n ; + -- : Sub1000 -> Sub1000000 ; -- m * 1000 + pot3 n = + {s = table {p => n.s ! Attrib ++ "ezer"} ; + n = Pl} ; + -- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n + pot3plus n m = + {s = table {p => n.s ! Attrib ++ "ezer" ++ m.s ! p} ; + n = Pl} ; + +oper + LinDigit : Type = {s : DForm*Place => Str ; n : Number} ; + + mkNum3 : (x1,_,x3 : Str) -> LinDigit = \három,harminc,harmadik -> + mkNum5 három harminc három harminc harmadik ; + + mkNum5 : (x1,_,_,_,x5 : Str) -> LinDigit = \ui,ti,ua,ta,ord -> { + s = table { => ui ; + => ti ; + => ua ; + => ta } ; +-- ord = ord ; -- TODO figure out where to use ordinal + n = Pl + } ; + + } diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 5f3da0c56..9191ebf64 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -1,733 +1,141 @@ ---# -path=.:../abstract:../../prelude:../common - ---1 Hunlish Lexical Paradigms --- --- Aarne Ranta 2003--2005 --- --- This is an API for the user of the resource grammar --- for adding lexical items. It gives functions for forming --- expressions of open categories: nouns, adjectives, verbs. --- --- Closed categories (determiners, pronouns, conjunctions) are --- accessed through the resource syntax API, $Structural.gf$. --- --- The main difference with $MorphoHun.gf$ is that the types --- referred to are compiled resource grammar types. We have moreover --- had the design principle of always having existing forms, rather --- than stems, as string arguments of the paradigms. --- --- The structure of functions for each word class $C$ is the following: --- first we give a handful of patterns that aim to cover all --- regular cases. Then we give a worst-case function $mkC$, which serves as an --- escape to construct the most irregular words of type $C$. --- However, this function should only seldom be needed: we have a --- separate module [``IrregHun`` ../../english/IrregHun.gf], --- which covers irregular verbss. - -resource ParadigmsHun = open - (Predef=Predef), - Prelude, - ResHun, - CatHun - in -{ - flags optimize = noexpand ; - ---{ -----2 Parameters ----- ----- To abstract over gender names, we define the following identifiers. --- ---oper --- Gender : Type ; --- --- human : Gender ; --- nonhuman : Gender ; --- masculine : Gender ; --% --- feminine : Gender ; --% --- ----- To abstract over number names, we define the following. --- --- Number : Type ; --- --- singular : Number ; --- plural : Number ; --- ----- To abstract over case names, we define the following. --- --- Case : Type ; --% --- --- nominative : Case ; --% --- genitive : Case ; --% --- ----- Prepositions are used in many-argument functions for rection. ----- The resource category $Prep$ is used. --- ----- The number of a noun phrase can be extracted with the following ----- function. --- --- npNumber : NP -> Number ; -- exctract the number of a noun phrase --- --- -----2 Nouns --- ----- Nouns are constructed by the function $mkN$, which takes a varying ----- number of arguments. --- +resource ParadigmsHun = open CatHun, ResHun, ParamHun, NounHun, Prelude in { oper - mkN = overload { - mkN : Str -> Noun = - \s -> lin N (regNoun s) ; +--2 Parameters +-- +-- To abstract over number, valency and (some) case names, +-- we define the following identifiers. The application programmer +-- should always use these constants instead of the constructors +-- defined in $ResKor$. + + +--2 Nouns + + mkN : overload { + mkN : (noun : Str) -> N ; -- Predictable nouns + } ; + +--2 Adjectives + + mkA : overload { + mkA : (adj : Str) -> A ; -- Regular adjective, given in ??? form + -- mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A. + } ; + + -- mkA2 : Str -> Prep -> A2 ; + +--2 Verbs + + -- Verbs + mkV : overload { + mkV : (sg3 : Str) -> V ; -- Predictable verb. Takes singular P3 form in present tense. + -- mkV : (nore : Str) -> (hada : V) -> V ; -- Add a prefix to an existing verb, e.g. 노래+하다 + } ; + + copula : V ; -- The copula verb '' + + mkV2 : overload { + mkV2 : (sg3 : Str) -> V2 ; -- Predictable verb. Takes singular P3 form in present tense, object case is accusative. + mkV2 : V -> V2 ; -- Takes preconstructed V, object case is accusative. } ; --- ----- The regular function captures the variants for nouns ending with ----- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes"; ----- "fly - flies" (but "toy - toys"), --- --- mkN : (flash : Str) -> N ; -- plural s, incl. flash-flashes, fly-flies --- ----- In practice the worst case is to give singular and plural nominative. --- --- mkN : (man,men : Str) -> N ; -- irregular plural --- ----- The theoretical worst case: give all four forms. --- --- mkN : (man,men,man's,men's : Str) -> N ; -- irregular genitives --- ----- Change gender from the default $nonhuman$. --- --- mkN : Gender -> N -> N ; -- default nonhuman --- -----3 Compound nouns ----- ----- A compound noun is an uninflected string attached to an inflected noun, ----- such as "baby boom", "chief executive officer". --- --- mkN : Str -> N -> N -- e.g. baby + boom --- } ; --- --- -----3 Relational nouns --- --- mkN2 : overload { --- mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --% --- mkN2 : N -> N2 ; -- e.g. wife of (default prep. to) --- mkN2 : N -> Str -> N2 ; -- access to --% --- mkN2 : N -> Prep -> N2 ; -- e.g. access to --- mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --% --- } ; --- ----- Use the function $mkPrep$ or see the section on prepositions below to ----- form other prepositions. ----- ----- Three-place relational nouns ("the connection from x to y") need two prepositions. --- --- mkN3 : N -> Prep -> Prep -> N3 ; -- e.g. connection from x to y --- --- --- -----3 Proper names and noun phrases ----- ----- Proper names, with a regular genitive, are formed from strings. --- --- mkPN : overload { --- --- mkPN : Str -> PN ; --- ----- Sometimes a common noun can be reused as a proper name, e.g. "Bank" --- --- mkPN : N -> PN --% --- } ; --- -----3 Determiners and quantifiers --- --- mkQuant : overload { --- mkQuant : (this, these : Str) -> Quant ; --% --- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant ; --% --- } ; --- --- mkOrd : Str -> Ord ; --% --- -----2 Adjectives --- --- mkA : overload { --- ----- For regular adjectives, the adverbial and comparison forms are derived. This holds ----- even for cases with the variations "happy - happily - happier - happiest", ----- "free - freely - freer - freest", and "rude - rudest". --- --- mkA : (happy : Str) -> A ; -- regular adj, incl. happy-happier, rude-ruder --- ----- However, the duplication of the final consonant cannot be predicted, ----- but a separate case is used to give the comparative --- --- mkA : (fat,fatter : Str) -> A ; -- irreg. comparative --- ----- As many as four forms may be needed. --- --- mkA : (good,better,best,well : Str) -> A -- completely irreg. --- } ; --- ----- Regular comparison is formed by "more - most" for words with two vowels separated ----- and terminated by some other letters. To force this or the opposite, ----- the following can be used: --- --- compoundA : A -> A ; -- force comparison with more/most --- simpleA : A -> A ; -- force comparison with -er,-est --- irregAdv : A -> Str -> A ; -- adverb irreg, e.g. "fast" --- -----3 Two-place adjectives --- --- mkA2 : overload { --- mkA2 : A -> Prep -> A2 ; -- absent from --- mkA2 : A -> Str -> A2 ; -- absent from --% --- mkA2 : Str -> Prep -> A2 ; -- absent from --% --- mkA2 : Str -> Str -> A2 -- absent from --% --- --- } ; --- --- -----2 Adverbs --- ----- Adverbs are not inflected. Most lexical ones have position ----- after the verb. Some can be preverbal (e.g. "always"). --- --- mkAdv : Str -> Adv ; -- e.g. today --- mkAdV : Str -> AdV ; -- e.g. always --- ----- Adverbs modifying adjectives and sentences can also be formed. --- --- mkAdA : Str -> AdA ; -- e.g. quite --- ----- Adverbs modifying numerals --- --- mkAdN : Str -> AdN ; -- e.g. approximately --- -----2 Prepositions ----- ----- A preposition as used for rection in the lexicon, as well as to ----- build $PP$s in the resource API, just requires a string. --- --- mkPrep : Str -> Prep ; -- e.g. "in front of" --- noPrep : Prep ; -- no preposition --- ----- (These two functions are synonyms.) --- -----2 Conjunctions ----- --- --- mkConj : overload { --- mkConj : Str -> Conj ; -- and (plural agreement) --% --- mkConj : Str -> Number -> Conj ; -- or (agrement number given as argument) --% --- mkConj : Str -> Str -> Conj ; -- both ... and (plural) --% --- mkConj : Str -> Str -> Number -> Conj ; -- either ... or (agrement number given as argument) --% --- } ; --- -----2 Verbs ----- --- ----- Verbs are constructed by the function $mkV$, which takes a varying ----- number of arguments. --- --- mkV : overload { --- ----- The regular verb function recognizes the special cases where the last ----- character is "y" ("cry-cries" but "buy-buys") or a sibilant ----- ("kiss-"kisses", "jazz-jazzes", "rush-rushes", "munch - munches", ----- "fix - fixes"). --- --- mkV : (cry : Str) -> V ; -- regular, incl. cry-cries, kiss-kisses etc --- ----- Give the present and past forms for regular verbs where ----- the last letter is duplicated in some forms, ----- e.g. "rip - ripped - ripping". --- --- mkV : (stop, stopped : Str) -> V ; -- reg. with consonant duplication --- ----- There is an extensive list of irregular verbs in the module $IrregularHun$. ----- In practice, it is enough to give three forms, ----- e.g. "drink - drank - drunk". --- --- mkV : (drink, drank, drunk : Str) -> V ; -- ordinary irregular --- ----- Irregular verbs with duplicated consonant in the present participle. --- --- mkV : (run, ran, run, running : Str) -> V ; -- irregular with duplication --% --- ----- Except for "be", the worst case needs five forms: the infinitive and ----- the third person singular present, the past indicative, and the ----- past and present participles. --- --- mkV : (go, goes, went, gone, going : Str) -> V ; -- totally irregular --- ----- Adds a prefix to an exisiting verb. This is most useful to create ----- prefix-variants of irregular verbs from $IrregHun$, e.g. "undertake". --- --- mkV : Str -> V -> V ; -- fix compound, e.g. under+take --- }; --- ----- Verbs with a particle. ----- The particle, such as in "switch on", is given as a string. --- --- partV : V -> Str -> V ; -- with particle, e.g. switch + on --- ----- Reflexive verbs. ----- By default, verbs are not reflexive; this function makes them that. --- --- reflV : V -> V ; -- reflexive e.g. behave oneself --- -----3 Two-place verbs ----- ----- Two-place verbs need a preposition, except the special case with direct object. ----- (transitive verbs). Notice that a particle comes from the $V$. --- --- mkV2 : overload { --- mkV2 : Str -> V2 ; -- kill --% --- mkV2 : V -> V2 ; -- transitive, e.g. hit --- mkV2 : V -> Prep -> V2 ; -- with preposiiton, e.g. believe in --- mkV2 : V -> Str -> V2 ; -- believe in --% --- mkV2 : Str -> Prep -> V2 ; -- believe in --% --- mkV2 : Str -> Str -> V2 -- believe in --% --- }; --- -----3 Three-place verbs ----- ----- Three-place (ditransitive) verbs need two prepositions, of which ----- the first one or both can be absent. --- --- mkV3 : overload { --- mkV3 : V -> V3 ; -- ditransitive, e.g. give,_,_ --- mkV3 : V -> Prep -> Prep -> V3 ; -- two prepositions, e.g. speak, with, about --- mkV3 : V -> Prep -> V3 ; -- give,_,to --% --- mkV3 : V -> Str -> V3 ; -- give,_,to --% --- mkV3 : Str -> Str -> V3 ; -- give,_,to --% --- mkV3 : Str -> V3 ; -- give,_,_ --% --- }; --- -----3 Other complement patterns ----- ----- Verbs and adjectives can take complements such as sentences, ----- questions, verb phrases, and adjectives. --- --- mkV0 : V -> V0 ; --% --- mkVS : V -> VS ; -- sentence-compl e.g. say (that S) --- mkV2S : V -> Prep -> V2S ; -- e.g. tell (NP) (that S) --- mkVV : V -> VV ; -- e.g. want (to VP) --- ingVV : V -> VV ; -- e.g. start (VPing) --- mkV2V : V -> Prep -> Prep -> V2V ; -- e.g. want (noPrep NP) (to VP) --- ingV2V : V -> Prep -> Prep -> V2V ; -- e.g. prevent (noPrep NP) (from VP-ing) --- mkVA : V -> VA ; -- e.g. become (AP) --- mkV2A : V -> Prep -> V2A ; -- e.g. paint (NP) (AP) --- mkVQ : V -> VQ ; -- e.g. wonder (QS) --- mkV2Q : V -> Prep -> V2Q ; -- e.g. ask (NP) (QS) --- --- mkAS : A -> AS ; --% --- mkA2S : A -> Prep -> A2S ; --% --- mkAV : A -> AV ; --% --- mkA2V : A -> Prep -> A2V ; --% --- ----- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$. ----- $V0$ is just $V$; the second argument is treated as adverb. --- --- V0 : Type ; --% --- AS, A2S, AV, A2V : Type ; --% --- -----2 Other categories --- ---mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --% --- -----. -----2 Definitions of paradigms ----- ----- The definitions should not bother the user of the API. So they are ----- hidden from the document. --- --- Gender = ResHun.Gender ; --- Number = ResHun.Number ; --- Case = ResHun.NPCase ; --- human = Masc ; --- nonhuman = Neutr ; --- masculine = Masc ; --- feminine = Fem ; --- singular = Sg ; --- plural = Pl ; --- nominative = npNom ; --- genitive = npGen ; --- --- npNumber np = (fromAgr np.a).n ; --- --- Preposition : Type = Str ; -- obsolete --- --- regN = \ray -> --- let rays = add_s ray --- in --- mk2N ray rays ; --- --- --- add_s : Str -> Str = \w -> case w of { --- _ + ("io" | "oo") => w + "s" ; -- radio, bamboo --- _ + ("s" | "z" | "x" | "sh" | "ch" | "o") => w + "es" ; -- bus, hero --- _ + ("a" | "o" | "u" | "e") + "y" => w + "s" ; -- boy --- x + "y" => x + "ies" ; -- fly --- _ => w + "s" -- car --- } ; --- --- duplFinal : Str -> Str = \w -> case w of { --- _ + ("a" | "e" | "o") + ("a" | "e" | "i" | "o" | "u") + ? => w ; -- waited, needed --- _ + ("a" | "e" | "i" | "o" | "u") + --- c@("b"|"d"|"g"|"m"|"n"|"p"|"r"|"t") => w + c ; -- omitted, manned --- _ => w --- } ; --- --- mk2N = \man,men -> --- let mens = case last men of { --- "s" => men + "'" ; --- _ => men + "'s" --- } --- in --- mk4N man men (man + "'s") mens ; --- --- mk4N = \man,men,man's,men's -> --- lin N (mkNoun man man's men men's ** {g = Neutr}) ; --- --- genderN g man = lin N {s = man.s ; g = g} ; --- --- compoundN s n = lin N {s = \\x,y => s ++ n.s ! x ! y ; g=n.g} ; --- --- mkPN = overload { --- mkPN : Str -> PN = regPN ; --- mkPN : N -> PN = nounPN --- } ; --- --- mkN2 = overload { --- mkN2 : N -> Prep -> N2 = prepN2 ; --- mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPrep s); --- mkN2 : Str -> Str -> N2 = \n,s -> prepN2 (regN n) (mkPrep s); --- mkN2 : N -> N2 = \n -> prepN2 n (mkPrep "of") ; --- mkN2 : Str -> N2 = \s -> prepN2 (regN s) (mkPrep "of") --- } ; --- --- prepN2 = \n,p -> lin N2 (n ** {c2 = p.s}) ; --- regN2 n = prepN2 (regN n) (mkPrep "of") ; --- --- mkN3 = \n,p,q -> lin N3 (n ** {c2 = p.s ; c3 = q.s}) ; --- -----3 Relational common noun phrases ----- ----- In some cases, you may want to make a complex $CN$ into a ----- relational noun (e.g. "the old town hall of"). --- --- cnN2 : CN -> Prep -> N2 ; --- cnN3 : CN -> Prep -> Prep -> N3 ; --- ----- This is obsolete. --- cnN2 = \n,p -> lin N2 (n ** {c2 = p.s}) ; --- cnN3 = \n,p,q -> lin N3 (n ** {c2 = p.s ; c3 = q.s}) ; --- --- regPN n = regGenPN n human ; --- regGenPN n g = lin PN {s = table {Gen => n + "'s" ; _ => n} ; g = g} ; --- nounPN n = lin PN {s = n.s ! singular ; g = n.g} ; --- --- mkQuant = overload { --- mkQuant : (this, these : Str) -> Quant = \sg,pl -> mkQuantifier sg pl sg pl; --- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier; --- } ; --- --- mkQuantifier : Str -> Str -> Str -> Str -> Quant = --- \sg,pl,sg',pl' -> lin Quant { --- s = \\_ => table { Sg => sg ; Pl => pl } ; --- sp = \\_ => table { --- Sg => \\c => regGenitiveS sg' ! npcase2case c ; Pl => \\c => regGenitiveS pl' ! npcase2case c} --- } ; --- --- mkOrd : Str -> Ord = \x -> lin Ord { s = regGenitiveS x}; --- --- mk2A a b = mkAdjective a a a b ; --- regA a = case a of { --- _ + ("a" | "e" | "i" | "o" | "u" | "y") + ? + _ + --- ("a" | "e" | "i" | "o" | "u" | "y") + ? + _ => --- lin A (compoundADeg (regADeg a)) ; --- _ => lin A (regADeg a) --- } ; --- --- prepA2 a p = lin A2 (a ** {c2 = p.s}) ; --- --- ADeg = A ; ---- --- --- mkADeg a b c d = mkAdjective a b c d ; --- --- regADeg happy = --- let --- happ = init happy ; --- y = last happy ; --- happie = case y of { --- "y" => happ + "ie" ; --- "e" => happy ; --- _ => duplFinal happy + "e" --- } ; --- in mkADeg happy (happie + "r") (happie + "st") (adj2adv happy) ; --- --- adj2adv : Str -> Str = \happy -> --- case happy of { --- _ + "ble" => init happy + "y" ; --- _ + "y" => init happy + "ily" ; --- _ + "ll" => happy + "y" ; --- _ => happy + "ly" --- } ; --- --- duplADeg fat = --- mkADeg fat --- (fat + last fat + "er") (fat + last fat + "est") (adj2adv fat) ; --- --- compoundADeg a = --- let ad = (a.s ! AAdj Posit Nom) --- in mkADeg ad ("more" ++ ad) ("most" ++ ad) (a.s ! AAdv) ; --- --- adegA a = a ; --- --- mkAdv x = lin Adv (ss x) ; --- mkAdV x = lin AdV (ss x) ; --- mkAdA x = lin AdA (ss x) ; --- mkAdN x = lin AdN (ss x) ; --- --- mkPrep p = lin Prep (ss p) ; --- noPrep = mkPrep [] ; --- --- mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ; --- --- regV cry = --- let --- cries = (regN cry).s ! Pl ! Nom ; -- ! --- cried : Str = case cries of { --- _ + "es" => init cries + "d" ; --- _ => duplFinal cry + "ed" --- } ; --- crying : Str = case cry of { --- _ + "ee" => cry + "ing" ; --- d + "ie" => d + "ying" ; --- us + "e" => us + "ing" ; --- _ => duplFinal cry + "ing" --- } --- in mk5V cry cries cried cried crying ; --- --- reg2V fit fitted = --- let fitt = Predef.tk 2 fitted ; --- in --- if_then_else V (pbool2bool (Predef.eqStr (last fit) (last fitt))) --- (mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing")) --- (regV fit) ; --- --- regDuplV fit = --- case last fit of { --- ("a" | "e" | "i" | "o" | "u" | "y") => --- Predef.error (["final duplication makes no sense for"] ++ fit) ; --- t => --- let fitt = fit + t in --- mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") --- } ; --- --- irregV x y z = let reg = (regV x).s in --- mk5V x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = []} ; --- --- irreg4V x y z w = let reg = (regV x).s in --- mk5V x (reg ! VPres) y z w ** {s1 = []} ; --- --- irregDuplV fit y z = --- let --- fitting = (regDuplV fit).s ! VPresPart --- in --- mk5V fit (fit + "s") y z fitting ; --- --- partV v p = lin V {s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ; --- reflV v = lin V {s = v.s ; part = v.part ; isRefl = True} ; --- --- prepV2 v p = lin V2 {s = v.s ; s1 = v.s1 ; c2 = p.s ; isRefl = v.isRefl} ; --- dirV2 v = prepV2 v noPrep ; --- --- prepPrepV3 v p q = --- lin V3 {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; isRefl = v.isRefl} ; --- dirV3 v p = prepPrepV3 v noPrep p ; --- dirdirV3 v = dirV3 v noPrep ; --- --- mkVS v = lin VS v ; --- mkVV v = lin VV { --- s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ; --- typ = VVInf --- } ; --- ingVV v = lin VV { --- s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ; --- typ = VVPresPart --- } ; --- mkVQ v = lin VQ v ; --- --- V0 : Type = V ; ----- V2S, V2V, V2Q : Type = V2 ; --- AS, A2S, AV : Type = A ; --- A2V : Type = A2 ; --- --- mkV0 v = v ; --- mkV2S v p = lin V2S (prepV2 v p) ; --- mkV2V v p t = lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVAux}) ; --- ingV2V v p t = lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVPresPart}) ; --- mkVA v = lin VA v ; --- mkV2A v p = lin V2A (prepV2 v p) ; --- mkV2Q v p = lin V2Q (prepV2 v p) ; --- --- mkAS v = v ; --- mkA2S v p = lin A (prepA2 v p) ; --- mkAV v = v ; --- mkA2V v p = prepA2 v p ; --- --- ----- pre-overload API and overload definitions --- --- mk4N : (man,men,man's,men's : Str) -> N ; --- regN : Str -> N ; --- mk2N : (man,men : Str) -> N ; --- genderN : Gender -> N -> N ; --- compoundN : Str -> N -> N ; --- --- mkN = overload { --- mkN : (man,men,man's,men's : Str) -> N = mk4N ; --- mkN : Str -> N = regN ; --- mkN : (man,men : Str) -> N = mk2N ; --- mkN : Gender -> N -> N = genderN ; --- mkN : Str -> N -> N = compoundN --- } ; --- ----- Relational nouns ("daughter of x") need a preposition. --- --- prepN2 : N -> Prep -> N2 ; --- ----- The most common preposition is "of", and the following is a ----- shortcut for regular relational nouns with "of". --- --- regN2 : Str -> N2 ; --- --- mk2A : (free,freely : Str) -> A ; --- regA : Str -> A ; --- --- mkA = overload { --- mkA : Str -> A = regA ; --- mkA : (fat,fatter : Str) -> A = \fat,fatter -> --- mkAdjective fat fatter (init fatter + "st") (adj2adv fat) ; --- mkA : (good,better,best,well : Str) -> A = \a,b,c,d -> --- mkAdjective a b c d --- } ; --- --- compoundA = compoundADeg ; --- simpleA a = --- let ad = (a.s ! AAdj Posit Nom) --- in regADeg ad ; --- --- irregAdv a adv = lin A {s = table {AAdv => adv; aform => a.s ! aform}} ; --- --- prepA2 : A -> Prep -> A2 ; --- --- mkA2 = overload { --- mkA2 : A -> Prep -> A2 = prepA2 ; --- mkA2 : A -> Str -> A2 = \a,p -> prepA2 a (mkPrep p) ; --- mkA2 : Str -> Prep -> A2 = \a,p -> prepA2 (regA a) p; --- mkA2 : Str -> Str -> A2 = \a,p -> prepA2 (regA a) (mkPrep p); --- } ; --- --- mk5V : (go, goes, went, gone, going : Str) -> V ; --- regV : (cry : Str) -> V ; --- reg2V : (stop, stopped : Str) -> V; --- irregV : (drink, drank, drunk : Str) -> V ; --- irreg4V : (run, ran, run, running : Str) -> V ; --- --- -- Use reg2V instead --- regDuplV : Str -> V ; --- -- Use irreg4V instead --- irregDuplV : (get, got, gotten : Str) -> V ; --- --- mkV = overload { --- mkV : (cry : Str) -> V = regV ; --- mkV : (stop, stopped : Str) -> V = reg2V ; --- mkV : (drink, drank, drunk : Str) -> V = irregV ; --- mkV : (run, ran, run, running : Str) -> V = irreg4V ; --- mkV : (go, goes, went, gone, going : Str) -> V = mk5V ; --- mkV : Str -> V -> V = prefixV --- }; --- --- prepV2 : V -> Prep -> V2 ; --- dirV2 : V -> V2 ; --- prefixV : Str -> V -> V = \p,v -> lin V { s = \\vform => p + v.s ! vform; isRefl = v.isRefl } ; --- --- mkV2 = overload { --- mkV2 : V -> V2 = dirV2 ; --- mkV2 : Str -> V2 = \s -> dirV2 (regV s) ; --- mkV2 : V -> Prep -> V2 = prepV2 ; --- mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPrep p) ; --- mkV2 : Str -> Prep -> V2 = \v,p -> prepV2 (regV v) p ; --- mkV2 : Str -> Str -> V2 = \v,p -> prepV2 (regV v) (mkPrep p) --- }; --- --- prepPrepV3 : V -> Prep -> Prep -> V3 ; --- dirV3 : V -> Prep -> V3 ; --- dirdirV3 : V -> V3 ; --- --- mkV3 = overload { --- mkV3 : V -> Prep -> Prep -> V3 = prepPrepV3 ; --- mkV3 : V -> Prep -> V3 = dirV3 ; --- mkV3 : V -> Str -> V3 = \v,s -> dirV3 v (mkPrep s); --- mkV3 : Str -> Str -> V3 = \v,s -> dirV3 (regV v) (mkPrep s); --- mkV3 : V -> V3 = dirdirV3 ; --- mkV3 : Str -> V3 = \v -> dirdirV3 (regV v) ; --- } ; --- --- mkConj = overload { --- mkConj : Str -> Conj = \y -> mk2Conj [] y plural ; --- mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ; --- mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ; --- mkConj : Str -> Str -> Number -> Conj = mk2Conj ; --- } ; --- --- mk2Conj : Str -> Str -> Number -> Conj = \x,y,n -> --- lin Conj (sd2 x y ** {n = n}) ; --- ------- obsolete --- ----- Comparison adjectives may two more forms. --- --- ADeg : Type ; --- --- mkADeg : (good,better,best,well : Str) -> ADeg ; --- ----- The regular pattern recognizes two common variations: ----- "-e" ("rude" - "ruder" - "rudest") and ----- "-y" ("happy - happier - happiest - happily") --- --- regADeg : Str -> ADeg ; -- long, longer, longest --- ----- However, the duplication of the final consonant is nor predicted, ----- but a separate pattern is used: --- --- duplADeg : Str -> ADeg ; -- fat, fatter, fattest --- ----- If comparison is formed by "more", "most", as in general for ----- long adjective, the following pattern is used: --- --- compoundADeg : A -> ADeg ; -- -/more/most ridiculous --- ----- From a given $ADeg$, it is possible to get back to $A$. --- --- adegA : ADeg -> A ; --- --- --- regPN : Str -> PN ; --- regGenPN : Str -> Gender -> PN ; -- John, John's --- ----- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". --- --- nounPN : N -> PN ; --- --- --- ---} ; + -- mkV3 : overload { + -- } ; + + -- mkVV : overload { + -- } ; + + -- + -- mkVA : Str -> VA + -- = \s -> lin VA (regV s) ; + -- mkVQ : Str -> VQ + -- = \s -> lin VQ (regV s) ; + -- mkVS : Str -> VS + -- = \s -> lin VS (regV s) ; + -- + -- mkV2A : Str -> V2A + -- = \s -> lin V2A (regV s ** {c2 = noPrep}) ; + -- mkV2V : Str -> V2V + -- = \s -> lin V2V (regV s ** {c2 = noPrep}) ; + -- mkV2Q : Str -> V2Q + -- = \s -> lin V2Q (regV s ** {c2 = noPrep}) ; + + ----- + +--2 Structural categories + + mkPrep : overload { + mkPrep : Str -> Prep ; -- Postposition, takes nominative + mkPrep : Str -> Case -> Prep ; -- Postposition and case + } ; + + -- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num -> + -- lin Conj { s = s1 ; s2 = s2 } ; + + -- mkSubj : Str -> Bool -> Subj = \s,b -> + -- lin Subj { } ; + + mkAdv : Str -> Adv + = \s -> lin Adv {s = s} ; + + mkAdV : Str -> AdV + = \s -> lin AdV {s = s} ; + + mkAdA : Str -> AdA + = \s -> lin AdA {s = s} ; + + +--. +------------------------------------------------------------------------------- +-- The definitions should not bother the user of the API. So they are +-- hidden from the document. + + mkN = overload { + mkN : Str -> N = \s -> lin N (mkNoun s) ; + } ; + + + mkN2 = overload { + mkN2 : Str -> N2 = \s -> lin N2 (mkNoun s) ; + mkN2 : N -> N2 = \n -> lin N2 n ; + } ; + + -- mkPN = overload { + -- } ; + + mkA = overload { + mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ; + -- mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda -> + -- jakda ** {s = \\af => kiga ++ jakda.s ! af} ; + } ; + + 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} ; + } ; + + copula = ResHun.copula ; + + mkV2 = overload { + mkV2 : (plain : Str) -> V2 = \v2 -> lin V2 (mkVerb2 v2) ; + mkV2 : V -> V2 = vtov2 ; + } ; + + mkV3 = overload { + mkV3 : (plain : Str) -> V3 = \v3 -> lin V3 (mkVerb3 v3) ; + } ; + -- + -- mkVV = overload { + -- } ; + + mkPrep = overload { + mkPrep : (e : Str) -> Prep + = \str -> lin Prep (ResHun.mkPrep str) ; + mkPrep : Str -> Case -> Prep + = \str,c -> lin Prep (ResHun.mkPrep str ** {c = c}) ; + } ; +-------------------------------------------------------------------------------- } diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf new file mode 100644 index 000000000..efe085fe3 --- /dev/null +++ b/src/hungarian/ParamHun.gf @@ -0,0 +1,82 @@ +resource ParamHun = ParamX ** open Prelude in { + +-------------------------------------------------------------------------------- +-- Phonology + +oper + v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | + "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; + + -- not used yet + vowFinal : Str -> Bool = \str -> + case str of {_ + #v => True ; _ => False} ; + +-------------------------------------------------------------------------------- +-- Morphophonology + + + +-------------------------------------------------------------------------------- +-- Nouns + +param + Case = Nom | Acc | Dat | Ins | Ess | Tra | Cau + | Ill | Sub | All | Ine | Sup | Ade | Ela + | Del | Abl | Ter | For | Tem + ; + + Harm = H_a | H_e | H_o ; + +-------------------------------------------------------------------------------- +-- Numerals + +param + DForm = Unit | Ten ; + Place = Indep | Attrib ; + + CardOrd = NOrd | NCard ; -- Not used yet + +-- NumType = NoNum | IsDig | IsNum ; + +-- oper +-- isNum : {numtype : NumType} -> Bool = \nt -> case nt.numtype of { +-- NoNum => False ; +-- _ => True +-- } ; +-------------------------------------------------------------------------------- +-- Adjectives + + +-------------------------------------------------------------------------------- +-- Conjunctions + + + +-------------------------------------------------------------------------------- +-- Verbs +param + + -- TODO: object agreement + VForm = + VInf + | VFin Person Number ; + +oper + + agr2vf : Person*Number -> VForm = \pn -> + case of { + => VFin p n + } ; + +-------------------------------------------------------------------------------- +-- Clauses + +-- param + + -- ClType = + -- Statement + -- | PolarQuestion + -- | WhQuestion + -- | Subord ; + +} diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 4f1fe8131..83931ee5b 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -1,32 +1,29 @@ -concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in -{ ---{ --- --- lin --- PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; --- --- UttS s = s ; --- UttQS qs = {s = qs.s ! QDir} ; --- UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ; --- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ; --- UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ; --- --- UttIP ip = {s = ip.s ! npNom} ; --- Acc also --- UttIAdv iadv = iadv ; --- UttNP np = {s = np.s ! npNom} ; --- UttVP vp = {s = infVP VVInf vp (agrP3 Sg)} ; --- UttAdv adv = adv ; --- UttCN n = {s = n.s ! Sg ! Nom} ; --- UttCard n = {s = n.s ! Nom} ; --- UttAP ap = {s = ap.s ! agrP3 Sg} ; --- UttInterj i = i ; --- --- NoPConj = {s = []} ; --- PConjConj conj = {s = conj.s2} ; --- --- --- NoVoc = {s = []} ; --- VocNP np = {s = "," ++ np.s ! npNom} ; --- ---} +concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { + + lin + PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; + + UttS s = s ; + UttQS qs = qs ; + UttIAdv iadv = iadv ; +{- + UttImpSg pol imp = + UttImpPl pol imp = + UttImpPol = UttImpSg ; + + UttIP ip = {s = ip.s ! } ; + UttNP np = {s = np.s ! } ; + UttVP vp = {s = } ; + UttAdv adv = {s = } ; + UttCN n = {s = } ; + UttCard n = {s = } ; + UttAP ap = { s = ap.s ! } ; + UttInterj i = i ; +-} + NoPConj = {s = []} ; +-- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ; + + NoVoc = {s = []} ; +-- VocNP np = { s = "," ++ np.s ! … } ; -} } diff --git a/src/hungarian/QuestionHun.gf b/src/hungarian/QuestionHun.gf index 1768fff4a..ace6c3a76 100644 --- a/src/hungarian/QuestionHun.gf +++ b/src/hungarian/QuestionHun.gf @@ -1,73 +1,77 @@ -concrete QuestionHun of Question = CatHun ** open ResHun, Prelude in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- --- QuestCl cl = { --- s = \\t,a,p => --- let cls = cl.s ! t ! a ! p --- in table { --- QDir => cls ! OQuest ; --- QIndir => "if" ++ cls ! ODir --- } ---- "whether" in ExtHun --- } ; --- --- QuestVP qp vp = --- let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp --- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; --- --- QuestSlash ip slash = --- mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ; --- --- stranding in ExratHun --- --- QuestIAdv iadv cl = mkQuestion iadv cl ; --- --- QuestIComp icomp np = --- mkQuestion icomp (mkClause (np.s ! npNom) np.a (predAux auxBe)) ; --- --- --- PrepIP p ip = {s = p.s ++ ip.s ! NPAcc} ; --- --- AdvIP ip adv = { --- s = \\c => ip.s ! c ++ adv.s ; --- n = ip.n --- } ; --- --- IdetCN idet cn = { --- s = \\c => idet.s ++ cn.s ! idet.n ! npcase2case c ; --- n = idet.n --- } ; --- --- IdetIP idet = { --- s = \\c => idet.s ; --- n = idet.n --- } ; --- --- IdetQuant idet num = { --- s = idet.s ! num.n ++ num.s ! Nom ; --- n = num.n --- } ; --- --- AdvIAdv i a = ss (i.s ++ a.s) ; --- --- CompIAdv a = a ; --- CompIP p = ss (p.s ! npNom) ; --- --- lincat --- QVP = ResHun.VP ; --- lin --- ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ; --- AdvQVP vp adv = insertObj (\\_ => adv.s) vp ; --- AddAdvQVP vp adv = insertObj (\\_ => adv.s) vp ; --- --- QuestQVP qp vp = --- let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp --- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; --- --- ---} +concrete QuestionHun of Question = CatHun ** open + Prelude, ResHun, ParadigmsHun, (NH=NounHun) in { + +-- A question can be formed from a clause ('yes-no question') or +-- with an interrogative. + +{- + lin + -- : Cl -> QCl ; + QuestCl = + + -- : IP -> VP -> QCl ; + QuestVP ip vp = + + -- : IP -> ClSlash -> QCl ; -- whom does John love + QuestSlash ip cls = + + -- : IAdv -> Cl -> QCl ; -- why does John walk + QuestIAdv iadv cls = + + + -- : IComp -> NP -> QCl ; -- where is John? + QuestIComp icomp np = + + +-- Interrogative pronouns can be formed with interrogative +-- determiners, with or without a noun. + + -- : IDet -> CN -> IP ; -- which five songs + IdetCN idet cn = {…} ** NH.DetCN idet cn ; + + -- : IDet -> IP ; -- which five + IdetIP idet = {…} ** NH.DetNP idet ; + +-- They can be modified with adverbs. + -- : IP -> Adv -> IP ; -- who in Paris + --AdvIP = NH.AdvNP ; + +-- Interrogative quantifiers have number forms and can take number modifiers. + + -- : IQuant -> Num -> IDet ; -- which (five) + IdetQuant = NH.DetQuant ; + +-- Interrogative adverbs can be formed prepositionally. + -- : Prep -> IP -> IAdv ; -- with whom + PrepIP prep ip = ; + +-- They can be modified with other adverbs. + + -- : IAdv -> Adv -> IAdv ; -- where in Paris + -- AdvIAdv iadv adv = + +-- Interrogative complements to copulas can be both adverbs and +-- pronouns. + + -- : IAdv -> IComp ; + CompIAdv iadv = iadv ; -- where (is it) + + -- : IP -> IComp ; + CompIP ip = {s = ip.s ! Abs} ; -- who (is it) + + +-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$. + +-- Wh questions with two or more question words require a new, special category. + + cat + QVP ; -- buy what where + fun + ComplSlashIP : VPSlash -> IP -> QVP ; -- buys what + AdvQVP : VP -> IAdv -> QVP ; -- lives where + AddAdvQVP : QVP -> IAdv -> QVP ; -- buys what where + + QuestQVP : IP -> QVP -> QCl ; -- who buys what where +-} } diff --git a/src/hungarian/RelativeHun.gf b/src/hungarian/RelativeHun.gf index 67316dc16..6f14093bc 100644 --- a/src/hungarian/RelativeHun.gf +++ b/src/hungarian/RelativeHun.gf @@ -1,56 +1,22 @@ -concrete RelativeHun of Relative = CatHun ** open ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- --- RelCl cl = { --- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ; --- c = npNom --- } ; --- --- RelVP rp vp = { --- s = \\t,ant,b,ag => --- let --- agr = case rp.a of { --- RNoAg => ag ; --- RAg a => a --- } ; --- cl = mkClause (rp.s ! RC (fromAgr agr).g npNom) agr vp --- in --- cl.s ! t ! ant ! b ! ODir ; --- c = npNom --- } ; --- ----- Pied piping: "at which we are looking". Stranding and empty ----- relative are defined in $ExtraHun.gf$ ("that we are looking at", ----- "we are looking at"). --- --- RelSlash rp slash = { --- s = \\t,a,p,agr => --- slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ; --- c = NPAcc --- } ; --- --- FunRP p np rp = { --- s = \\c => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ; --- a = RAg np.a --- } ; --- --- IdRP = --- { s = table { --- RC _ (NCase Gen) => "whose" ; --- RC Neutr _ => "which" ; --- RC _ NPAcc => "whom" ; --- RC _ (NCase Nom) => "who" ; --- RPrep Neutr => "which" ; --- RPrep _ => "whom" --- } ; --- a = RNoAg --- } ; --- ---} +concrete RelativeHun of Relative = CatHun ** open + ResHun, Prelude, (NS=NounHun), (SS=StructuralHun) in { + +{- +lin + -- : Cl -> RCl ; -- such that John loves her + -- RelCl cl = ; + + -- : RP -> VP -> RCl ; + RelVP rp vp = + + -- : RP -> ClSlash -> RCl ; -- whom John loves + RelSlash rp cls = + + -- : RP ; + IdRP = {s = ""} ; + + -- : Prep -> NP -> RP -> RP ; -- the mother of whom + --FunRP prep np rp = {} ; +-} } diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 81da3b47d..346970400 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -3,58 +3,43 @@ --1 Hungarian auxiliary operations. -- This module contains operations that are needed to make the --- resource syntax work. +-- resource syntax work. +-- Some parameters, such as $Number$, are inherited from $ParamX$. +resource ResHun = ParamHun ** open Prelude, Predef, ParamHun in { -resource ResHun = ParamX ** open Prelude in { - flags - optimize=noexpand ; - coding = utf8 ; - --- Some parameters, such as $Number$, are inherited from $ParamX$. --- ---2 For $Noun$ --- --- This is case as needed when inflecting nouns. --- - param - Case = Nom | Acc | Dat | Ins | Ess | Tra | Cau - | Ill | Sub | All | Ine | Sup | Ade | Ela - | Del | Abl | Ter | For | Tem - ; - - Harm = H_a | H_e | H_o ; - - oper +-------------------------------------------------------------------------------- +-- Nouns +oper Noun = {s : Number => Case => Str} ; - endCase : Case -> HarmForms = \c -> case c of { - Nom => harm1 [] ; - Acc => harm3 "ot" "et" "öt" ; - Dat => harm "nak" "nek" ; - Ins => harm "al" "el" ; - Ess => harm "stul" "stül" ; - Tra => harm "á" "é" ; - Cau => harm1 "ért" ; - Ill => harm "ba" "be" ; - Sub => harm "ra" "re" ; - All => harm3 "hoz" "hez" "höz" ; - Ine => harm "ban" "ben" ; - Sup => harm3 "on" "en" "ön" ; - Ade => harm "nál" "nél" ; - Ela => harm "ból" "ből" ; - Del => harm "ról" "ről" ; - Abl => harm "tól" "től" ; - Ter => harm1 "ig" ; - For => harm1 "ként" ; - Tem => harm1 "kor" - } ; + endCase : Case -> HarmForms = \c -> case c of { + Nom => harm1 [] ; + Acc => harm3 "ot" "et" "öt" ; + Dat => harm "nak" "nek" ; + Ins => harm "al" "el" ; + Ess => harm "stul" "stül" ; + Tra => harm "á" "é" ; + Cau => harm1 "ért" ; + Ill => harm "ba" "be" ; + Sub => harm "ra" "re" ; + All => harm3 "hoz" "hez" "höz" ; + Ine => harm "ban" "ben" ; + Sup => harm3 "on" "en" "ön" ; + Ade => harm "nál" "nél" ; + Ela => harm "ból" "ből" ; + Del => harm "ról" "ről" ; + Abl => harm "tól" "től" ; + Ter => harm1 "ig" ; + For => harm1 "ként" ; + Tem => harm1 "kor" + } ; - endNumber : Number -> HarmForms = \n -> case n of { - Sg => harm1 [] ; - Pl => harm3 "ok" "ek" "ök" - } ; + endNumber : Number -> HarmForms = \n -> case n of { + Sg => harm1 [] ; + Pl => harm3 "ok" "ek" "ök" + } ; harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> ; harm : Str -> Str -> HarmForms = \a,e -> harm3 a e e ; @@ -71,482 +56,234 @@ resource ResHun = ParamX ** open Prelude in useHarm : Harm -> HarmForms -> Str = \h,ss -> case h of { H_a => ss.p1 ; H_e => ss.p2 ; - H_o => ss.p3 + H_o => ss.p3 } ; putHarmEnding : HarmForms -> Str -> Str = \hs,w -> w + useHarm (getHarm w) hs ; - regNoun : Str -> Noun = \w -> { - s = \\n,c => - let h = getHarm w + mkNoun : Str -> Noun = \w -> { + s = \\n,c => + let h = getHarm w in w + useHarm h (endNumber n) + useHarm h (endCase c) - } ; + } ; +--------------------------------------------- +-- NP --- --- param --- Agr = AgP1 Number | AgP2 Number | AgP3Sg Gender | AgP3Pl ; --- --- param --- Gender = Neutr | Masc | Fem ; --- --- -----2 For $Verb$ --- ----- Only these five forms are needed for open-lexicon verbs. --- --- param --- VForm = --- VInf --- | VPres --- | VPPart --- | VPresPart --- | VPast --# notpresent --- ; --- ----- Auxiliary verbs have special negative forms. --- --- VVForm = --- VVF VForm --- | VVPresNeg --- | VVPastNeg --# notpresent --- ; --- ----- The order of sentence is needed already in $VP$. --- --- Order = ODir | OQuest ; --- ----- The type of complement of a VV --- --- VVType = VVAux | VVInf | VVPresPart ; -- can do / try to do / start doing --- -----2 For $Adjective$ --- --- AForm = AAdj Degree Case | AAdv ; --- -----2 For $Relative$ --- --- RAgr = RNoAg | RAg Agr ; --- RCase = RPrep Gender | RC Gender NPCase ; --- -----2 For $Numeral$ --- --- CardOrd = NCard | NOrd ; --- DForm = unit | teen | ten ; --- -----2 Transformations between parameter types --- --- oper --- toAgr : Number -> Person -> Gender -> Agr = \n,p,g -> --- case p of { --- P1 => AgP1 n ; --- P2 => AgP2 n ; --- P3 => case n of { --- Sg => AgP3Sg g ; --- Pl => AgP3Pl --- } --- } ; --- --- fromAgr : Agr -> {n : Number ; p : Person ; g : Gender} = \a -> case a of { --- AgP1 n => {n = n ; p = P1 ; g = Masc} ; --- AgP2 n => {n = n ; p = P2 ; g = Masc} ; --- AgP3Pl => {n = Pl ; p = P3 ; g = Masc} ; --- AgP3Sg g => {n = Sg ; p = P3 ; g = g} --- } ; --- --- agrP3 : Number -> Agr = \n -> agrgP3 n Neutr ; --- --- agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ; --- --- conjAgr : Agr -> Agr -> Agr = \a0,b0 -> --- let a = fromAgr a0 ; b = fromAgr b0 --- in --- toAgr --- (conjNumber a.n b.n) --- (conjPerson a.p b.p) a.g ; --- ----- For $Lex$. --- ----- For each lexical category, here are the worst-case constructors. --- --- mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} = --- \man,mans,men,mens -> { --- s = table { --- Sg => table { --- Gen => mans ; --- _ => man --- } ; --- Pl => table { --- Gen => mens ; --- _ => men --- } --- } --- } ; --- --- mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str; lock_A : {}} = --- \good,better,best,well -> lin A { --- s = table { --- AAdj Posit c => (regGenitiveS good) ! c ; --- AAdj Compar c => (regGenitiveS better) ! c ; --- AAdj Superl c => (regGenitiveS best) ! c ; --- AAdv => well --- } --- } ; --- --- mkVerb : (_,_,_,_,_ : Str) -> Verb = --- \go,goes,went,gone,going -> { --- s = table { --- VInf => go ; --- VPres => goes ; --- VPast => went ; --# notpresent --- VPPart => gone ; --- VPresPart => going --- } ; --- isRefl = False --- } ; --- --- mkIP : (i,me,my : Str) -> Number -> {s : NPCase => Str ; n : Number} = --- \i,me,my,n -> let who = mkNP i me my n P3 Neutr in { --- s = who.s ; --- n = n --- } ; --- --- mkNP : (i,me,my : Str) -> Number -> Person -> Gender -> --- {s : NPCase => Str ; a : Agr} = \i,me,my,n,p,g -> --- { s = table { --- NCase Nom => i ; --- NPAcc => me ; --- NCase Gen => my --- } ; --- a = toAgr n p g ; --- }; --- --- regNP : Str -> Number -> {s : NPCase => Str ; a : Agr} = \that,n -> --- mkNP that that (that + "'s") n P3 Neutr ; --- --- regGenitiveS : Str -> Case => Str = \s -> --- table { Gen => genitiveS s; _ => s } ; --- --- genitiveS : Str -> Str = \dog -> --- case last dog of { --- "s" => dog + "'" ; --- _ => dog + "'s" --- }; --- ----- We have just a heuristic definition of the indefinite article. ----- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic ----- "o" ("one-sided"), vocalic "u" ("umbrella"). --- --- artIndef = pre { --- "eu" | "Eu" | "uni" | "up" => "a" ; --- "un" => "an" ; --- "a" | "e" | "i" | "o" | "A" | "E" | "I" | "O" => "an" ; --- "SMS" | "sms" => "an" ; --- --- _ => "a" --- } ; --- --- artDef = "the" ; --- ----- For $Verb$. --- --- Verb : Type = { --- s : VForm => Str ; --- isRefl : Bool --- } ; --- --- param --- CPolarity = --- CPos --- | CNeg Bool ; -- contracted or not --- --- oper --- contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of { --- Pos => CPos ; --- Neg => CNeg b --- } ; --- --- VerbForms : Type = --- Tense => Anteriority => CPolarity => Order => Agr => --- {aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept --- --- VP : Type = { --- s : VerbForms ; --- prp : Str ; -- present participle --- ptp : Str ; -- past participle --- inf : Str ; -- the infinitive form ; VerbForms would be the logical place --- ad : Str ; -- sentence adverb --- s2 : Agr => Str -- complement --- } ; --- --- --- SlashVP = VP ** {c2 : Str} ; --- --- predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb -> --- predV verb ** {c2 = verb.c2} ; --- --- predV : Verb -> VP = \verb -> { --- s = \\t,ant,b,ord,agr => --- let --- inf = verb.s ! VInf ; --- fin = presVerb verb agr ; --- part = verb.s ! VPPart ; --- in --- case of { --- => vff fin [] ; --- => vf (does agr) inf ; --- => vf (have agr) part ; --# notpresent --- => vfn c (have agr) (havent agr) part ; --# notpresent --- => vff (verb.s ! VPast) [] ; --# notpresent --- => vf "did" inf ; --# notpresent --- => vfn c "did" "didn't" inf ; --# notpresent --- => vf "had" part ; --# notpresent --- => vfn c "had" "hadn't" part ; --# notpresent --- => vf "will" inf ; --# notpresent --- => vfn c "will" "won't" inf ; --# notpresent --- => vf "will" ("have" ++ part) ; --# notpresent --- => vfn c "will" "won't"("have" ++ part) ; --# notpresent --- => vf "would" inf ; --# notpresent --- => vfn c "would" "wouldn't" inf ; --# notpresent --- => vf "would" ("have" ++ part) ; --# notpresent --- => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent --- => vfn c (does agr) (doesnt agr) inf --- } ; --- prp = verb.s ! VPresPart ; --- ptp = verb.s ! VPPart ; --- inf = verb.s ! VInf ; --- ad = [] ; --- s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) [] --- } ; --- --- predAux : Aux -> VP = \verb -> { --- s = \\t,ant,cb,ord,agr => --- let --- b = case cb of { --- CPos => Pos ; --- _ => Neg --- } ; --- inf = verb.inf ; --- fin = verb.pres ! b ! agr ; --- finp = verb.pres ! Pos ! agr ; --- part = verb.ppart ; --- in --- case of { --- => vf (have agr) part ; --# notpresent --- => vfn c (have agr) (havent agr) part ; --# notpresent --- => vf (verb.past ! b ! agr) [] ; --# notpresent --- => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent --- => vf "had" part ; --# notpresent --- => vfn c "had" "hadn't" part ; --# notpresent --- => vf "will" inf ; --# notpresent --- => vfn c "will" "won't" inf ; --# notpresent --- => vf "will" ("have" ++ part) ; --# notpresent --- => vfn c "will" "won't"("have" ++ part) ; --# notpresent --- => vf "would" inf ; --# notpresent --- => vfn c "would" "wouldn't" inf ; --# notpresent --- => vf "would" ("have" ++ part) ; --# notpresent --- => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent --- => vf fin [] ; --- => vfn c finp fin [] --- } ; --- prp = verb.prpart ; --- ptp = verb.ppart ; --- inf = verb.inf ; --- ad = [] ; --- s2 = \\_ => [] --- } ; --- --- vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> --- {aux = [] ; adv = [] ; fin = x ; inf = y} ; --- --- vf : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> vfn True x x y ; --- --- vfn : Bool -> Str -> Str -> Str -> {aux, fin, adv, inf : Str} = --- \contr,x,y,z -> --- case contr of { --- True => {aux = y ; adv = [] ; fin = [] ; inf = z} ; --- False => {aux = x ; adv = "not" ; fin = [] ; inf = z} --- } ; --- --- insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { --- s = vp.s ; --- prp = vp.prp ; --- ptp = vp.ptp ; --- inf = vp.inf ; --- ad = vp.ad ; --- s2 = \\a => vp.s2 ! a ++ obj ! a --- } ; --- --- insertObjPre : (Agr => Str) -> VP -> VP = \obj,vp -> { --- s = vp.s ; --- prp = vp.prp ; --- ptp = vp.ptp ; --- inf = vp.inf ; --- ad = vp.ad ; --- s2 = \\a => obj ! a ++ vp.s2 ! a --- } ; --- --- insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp -> --- insertObj obj vp ** {c2 = vp.c2} ; --- ------ The adverb should be before the finite verb. --- --- insertAdV : Str -> VP -> VP = \ad,vp -> { --- s = vp.s ; --- prp = vp.prp ; --- ptp = vp.ptp ; --- inf = vp.inf ; --- ad = vp.ad ++ ad ; --- s2 = \\a => vp.s2 ! a --- } ; --- ----- --- --- predVV : {s : VVForm => Str ; typ : VVType} -> VP = \verb -> --- let verbs = verb.s --- in --- case verb.typ of { --- VVAux => predAux { --- pres = table { --- Pos => \\_ => verbs ! VVF VPres ; --- Neg => \\_ => verbs ! VVPresNeg --- } ; --- past = table { --# notpresent --- Pos => \\_ => verbs ! VVF VPast ; --# notpresent --- Neg => \\_ => verbs ! VVPastNeg --# notpresent --- } ; --# notpresent --- inf = verbs ! VVF VInf ; --- ppart = verbs ! VVF VPPart ; --- prpart = verbs ! VVF VPresPart ; --- } ; --- _ => predV {s = \\vf => verbs ! VVF vf ; isRefl = False} --- } ; --- --- presVerb : {s : VForm => Str} -> Agr -> Str = \verb -> --- agrVerb (verb.s ! VPres) (verb.s ! VInf) ; --- --- infVP : VVType -> VP -> Agr -> Str = \typ,vp,a -> --- vp.ad ++ --- case typ of { --- VVAux => vp.inf ; --- VVInf => "to" ++ vp.inf ; --- _ => vp.prp --- } ++ --- vp.s2 ! a ; --- --- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> --- case agr of { --- AgP3Sg _ => has ; --- _ => have --- } ; --- --- have = agrVerb "has" "have" ; --- havent = agrVerb "hasn't" "haven't" ; --- does = agrVerb "does" "do" ; --- doesnt = agrVerb "doesn't" "don't" ; --- --- Aux = { --- pres : Polarity => Agr => Str ; --- past : Polarity => Agr => Str ; --# notpresent --- inf,ppart,prpart : Str --- } ; --- --- auxBe : Aux = { --- pres = \\b,a => case of { --- => "am" ; --- => ["am not"] ; --- am not I --- _ => agrVerb (posneg b "is") (posneg b "are") a --- } ; --- past = \\b,a => case a of { --# notpresent --- AgP1 Sg | AgP3Sg _ => posneg b "was" ; --# notpresent --- _ => (posneg b "were") --# notpresent --- } ; --# notpresent --- inf = "be" ; --- ppart = "been" ; --- prpart = "being" --- } ; --- --- posneg : Polarity -> Str -> Str = \p,s -> case p of { --- Pos => s ; --- Neg => s + "n't" --- } ; --- --- conjThat : Str = "that" ; --- --- reflPron : Agr => Str = table { --- AgP1 Sg => "myself" ; --- AgP2 Sg => "yourself" ; --- AgP3Sg Masc => "himself" ; --- AgP3Sg Fem => "herself" ; --- AgP3Sg Neutr => "itself" ; --- AgP1 Pl => "ourselves" ; --- AgP2 Pl => "yourselves" ; --- AgP3Pl => "themselves" --- } ; --- ----- For $Sentence$. --- --- Clause : Type = { --- s : Tense => Anteriority => CPolarity => Order => Str --- } ; --- --- mkClause : Str -> Agr -> VP -> Clause = --- \subj,agr,vp -> { --- s = \\t,a,b,o => --- let --- verb = vp.s ! t ! a ! b ! o ! agr ; --- compl = vp.s2 ! agr --- in --- case o of { --- ODir => subj ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ compl ; --- OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ compl --- } --- } ; --- --- ----- For $Numeral$. --- --- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Case => Str} = --- \two, twelve, twenty, second -> --- {s = table { --- unit => table {NCard => regGenitiveS two ; NOrd => regGenitiveS second} ; --- teen => \\c => mkCard c twelve ; --- ten => \\c => mkCard c twenty --- } --- } ; --- --- regNum : Str -> {s : DForm => CardOrd => Case => Str} = --- \six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ; --- --- regCardOrd : Str -> {s : CardOrd => Case => Str} = \ten -> --- {s = table {NCard => regGenitiveS ten ; --- NOrd => regGenitiveS (regOrd ten)} } ; --- --- mkCard : CardOrd -> Str -> Case => Str = \o,ten -> --- (regCardOrd ten).s ! o ; --- --- regOrd : Str -> Str = \ten -> --- case last ten of { --- "y" => init ten + "ieth" ; --- _ => ten + "th" --- } ; --- --- mkQuestion : --- {s : Str} -> Clause -> --- {s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl -> --- { --- s = \\t,a,p => --- let --- cls = cl.s ! t ! a ! p ; --- why = wh.s --- in table { --- QDir => why ++ cls ! OQuest ; --- QIndir => why ++ cls ! ODir --- } --- } ; --- --- ---} + NounPhrase : Type = { + s : Case => Str ; + agr : Person*Number ; + isPron : Bool ; + empty : Str ; -- standard trick for pro-drop + } ; + + emptyNP : NounPhrase = { + s = \\_ => [] ; + agr = ; + isPron = False ; + empty = [] ; + } ; + + indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ; + +-------------------------------------------------------------------------------- +-- Pronouns + + Pronoun : Type = NounPhrase ** { + -- poss : { -- for PossPron : Pron -> Quant + -- } ; + } ; + +-------------------------------------------------------------------------------- +-- Det, Quant, Card, Ord + + -- Quant has variable number: + -- e.g. this_Quant has both "this" and "these" + Quant : Type = { + s, -- form that comes before noun: "{this} car" + sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP) + } ; + + mkQuant : (s,sp : Str) -> Quant = \s,sp -> { + s = (mkNoun s).s ; + sp = (mkNoun sp).s ; + } ; + + -- Det is formed in DetQuant : Quant -> Num -> Det + -- so it has an inherent number. + Determiner : Type = { + s, + sp : Case => Str ; + n : Number ; +-- numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl + } ; + + Num : Type = { + s : Place => Str ; -- Independent or attribute + n : Number ; -- Singular or plural + -- numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages + } ; + + baseNum : Num = { + s = \\_ => [] ; + n = Sg ; + -- numtype = NoNum + } ; + + {- Numeral can become Num via + Noun.gf: NumNumeral : Numeral -> Card ; + Noun.gf: NumCard : Card -> Num ; + -} + Numeral : Type = Num ** { + -- TODO add ordinal + } ; + +-------------------------------------------------------------------------------- +-- Postpositions + + Postposition : Type = {s : Str ; c : Case} ; + + mkPrep : Str -> Postposition = \str -> {s=str ; c=Nom} ; + + emptyPP : Postposition = mkPrep [] ; + +------------------ +-- Conj + + Conj : Type = { + s1 : Str ; + s2 : Str ; + n : Number ; + } ; + +-------------------------------------------------------------------------------- +-- Adjectives + + Adjective : Type = {s : Number => Str} ; + + mkAdj : Str -> Adjective = \sg -> { + s = \\n => + let h = getHarm sg + in sg + useHarm h (endNumber n) + } ; + +-------------------------------------------------------------------------------- +-- Verbs + + verbEndings : Person*Number => HarmForms = table { + => harm3 "ok" "ek" "ök" ; + => harm1 "sz" ; + => harm1 [] ; + => harm "unk" "ünk" ; + => harm3 "tok" "tek" "tök" ; -- TODO allomorphs -otok, -etek, -ötök + => harm "nak" "nek" -- TODO allomorphs -anak, -enek + } ; + + Verb : Type = { + s : VForm => Str ; + sc : Case ; -- subject case + } ; + Verb2 : Type = Verb ** { + c2 : Case -- object case + } ; + Verb3 : Type = Verb2 ** { + c3 : Case -- indirect object case + } ; + + mkVerb2 : Str -> Verb2 = \sg3 -> vtov2 (mkVerb sg3) ; + mkVerb3 : Str -> Verb3 = \sg3 -> v2tov3 (mkVerb2 sg3) ; + + vtov2 : Verb -> Verb2 = \v -> v ** {c2 = Acc} ; + v2tov3 : Verb2 -> Verb3 = \v -> v ** {c3 = Dat} ; + + mkVerb : (sg3 : Str) -> Verb = mkVerbReg "TODO:infinitive" ; -- TODO + + mkVerbReg : (inf, sg3 : Str) -> Verb = \inf,sg3 -> + let harmony : Harm = getHarm sg3 ; + sg1 : Str = sg3 + useHarm harmony (verbEndings!) ; + sg2 : Str = sg3 + "sz" ; + pl1 : Str = sg3 + useHarm harmony (verbEndings!) ; + pl2 : Str = sg3 + useHarm harmony (verbEndings!) ; + pl3 : Str = sg3 + useHarm harmony (verbEndings!) ; + in mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf ; + + mkVerbFull : (x1,_,_,_,_,_,x7 : Str) -> Verb = + \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 + } ; + sc = Nom + } ; + + copula : Verb = mkVerbFull + "vagyok" + "vagy" + "van" + "vagyunk" + "vagytok" + "vannak" + "lenni" ; + +------------------ +-- VP + + VerbPhrase : Type = Verb ** { + obj : Str ; + adv : Str ; + } ; -- TODO more fields + + VPSlash : Type = Verb2 ** { + adv : Str ; + } ; + + useV : Verb -> VerbPhrase = \v -> v ** { + obj,adv = [] ; + } ; + + useVc : Verb2 -> VPSlash = \v2 -> v2 ** { + adv = [] ; + } ; + + insertObj : VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { + obj = np.s ! vps.c2 ; + } ; + + insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ; + insertAdvSlash : VPSlash -> SS -> VPSlash = \vps,adv -> vps ** {adv = adv.s} ; + +-------------------------------------------------------------------------------- +-- Cl, S + + Clause : Type = {s : Tense => Anteriority => Polarity => Str} ; + + {- After PredVP, we might still want to add more adverbs (QuestIAdv), + but we're done with verb inflection. + -} + ClSlash : Type = Clause ; + + QClause : Type = Clause ; + + -- RClause : Type = {s : NForm => Tense => Anteriority => Polarity => Str} ; + + Sentence : Type = {s : Str} ; + + predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** { + s = \\t,a,p => + np.s ! vp.sc + ++ vp.obj + ++ vp.adv + ++ vp.s ! agr2vf np.agr + } ; + +-------------------------------------------------------------------------------- +-- linrefs } diff --git a/src/hungarian/SentenceHun.gf b/src/hungarian/SentenceHun.gf index 0760d91f8..8c498bd4c 100644 --- a/src/hungarian/SentenceHun.gf +++ b/src/hungarian/SentenceHun.gf @@ -1,75 +1,79 @@ -concrete SentenceHun of Sentence = CatHun ** open Prelude, ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- --- PredVP np vp = mkClause (np.s ! npNom) np.a vp ; --- --- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; --- --- ImpVP vp = { --- s = \\pol,n => --- let --- agr = AgP2 (numImp n) ; --- verb = infVP VVAux vp agr ; --- dont = case pol of { --- CNeg True => "don't" ; --- CNeg False => "do" ++ "not" ; --- _ => [] --- } --- in --- dont ++ verb --- } ; --- --- SlashVP np vp = --- mkClause (np.s ! npNom) np.a vp ** {c2 = vp.c2} ; --- --- AdvSlash slash adv = { --- s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; --- c2 = slash.c2 --- } ; --- --- SlashPrep cl prep = cl ** {c2 = prep.s} ; --- --- SlashVS np vs slash = --- mkClause (np.s ! npNom) np.a --- (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) ** --- {c2 = slash.c2} ; --- --- EmbedS s = {s = conjThat ++ s.s} ; --- EmbedQS qs = {s = qs.s ! QIndir} ; --- EmbedVP vp = {s = infVP VVInf vp (agrP3 Sg)} ; --- agr --- --- UseCl t p cl = { --- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir --- } ; --- UseQCl t p cl = { --- s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! q --- } ; --- UseRCl t p cl = { --- s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! r ; --- c = cl.c --- } ; --- UseSlash t p cl = { --- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ; --- c2 = cl.c2 --- } ; --- --- AdvS a s = {s = a.s ++ s.s} ; --- ExtAdvS a s = {s = a.s ++ "," ++ s.s} ; --- --- SSubjS a s b = {s = a.s ++ s.s ++ b.s} ; --- --- RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ; --- --- oper --- ctr : CPolarity -> CPolarity = \x -> x ; ------ ctr = contrNeg True ; -- contracted negations --- ---} --- +concrete SentenceHun of Sentence = CatHun ** open + TenseX, ResHun, (AK=AdverbHun), Prelude in { + +flags optimize=all_subs ; + +lin + +--2 Clauses + + -- : NP -> VP -> Cl + PredVP = predVP ; + + -- : SC -> VP -> Cl ; -- that she goes is good (Saeed p. 94) + --PredSCVP sc vp = ; + +--2 Clauses missing object noun phrases + -- : NP -> VPSlash -> ClSlash ; + -- SlashVP = predVP ; +{- + -- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today + AdvSlash cls adv = cls ** insertAdv adv cls ; + +-- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks + + -- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves +-- SlashVS np vs ss = {} ; + + + -- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen + UseSlash t p cls = { + } ; + +--2 Imperatives + -- : VP -> Imp ; + ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ; + +--2 Embedded sentences + + -- : S -> SC ; + EmbedS s = {s = s.s ! True} ; -- choose subordinate + + -- : QS -> SC ; + -- EmbedQS qs = { } ; + + -- : VP -> SC ; + EmbedVP vp = {s = infVP vp} ; +-} +--2 Sentences + + -- : Temp -> Pol -> Cl -> S ; + UseCl t p cl = { + s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p + } ; + + -- : Temp -> Pol -> QCl -> QS ; + UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ; + + -- : Temp -> Pol -> RCl -> RS ; + -- UseRCl t p cl = {s = } ; + + -- AdvS : Adv -> S -> S ; -- then I will go home + AdvS = advS "" ; + + -- ExtAdvS : Adv -> S -> S ; -- next week, I will go home + ExtAdvS = advS (SOFT_BIND ++ ","); + + -- : S -> Subj -> S -> S ; + -- SSubjS s1 subj s2 = AdvS (AK.SubjS subj s2) s1 ; + + -- : S -> RS -> S ; -- she sleeps, which is good + -- RelS sent rs = advS {s = rs.s ! Sg3 Masc ++ SOFT_BIND ++ ","} sent ; + +oper + + advS : (comma : Str) -> SS -> S -> S = \comma,a,sent -> sent ** { + s = a.s ++ comma ++ sent.s + } ; } diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 66654f5db..35a242481 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -1,148 +1,168 @@ -concrete StructuralHun of Structural = CatHun ** - open MorphoHun, ResHun, ParadigmsHun, - (C = ConstructX), Prelude in -{ ---{ --- --- flags optimize=all ; --- --- lin --- above_Prep = mkPrep "above" ; --- after_Prep = mkPrep "after" ; --- all_Predet = ss "all" ; --- almost_AdA = mkAdA "almost" ; --- almost_AdN = mkAdN "almost" ; --- although_Subj = ss "although" ; --- always_AdV = mkAdV "always" ; --- and_Conj = mkConj "and" ; --- because_Subj = ss "because" ; --- before_Prep = mkPrep "before" ; --- behind_Prep = mkPrep "behind" ; --- between_Prep = mkPrep "between" ; --- both7and_DConj = mkConj "both" "and"; --- but_PConj = ss "but" ; --- by8agent_Prep = mkPrep "by" ; --- by8means_Prep = mkPrep "by" ; --- can8know_VV, can_VV = { --- s = table { --- VVF VInf => ["be able to"] ; --- VVF VPres => "can" ; --- VVF VPPart => ["been able to"] ; --- VVF VPresPart => ["being able to"] ; --- VVF VPast => "could" ; --# notpresent --- VVPastNeg => "couldn't" ; --# notpresent --- VVPresNeg => "can't" --- } ; --- typ = VVAux --- } ; --- during_Prep = mkPrep "during" ; --- either7or_DConj = mkConj "either" "or" singular ; --- everybody_NP = regNP "everybody" singular ; --- every_Det = mkDeterminer singular "every" ; --- everything_NP = regNP "everything" singular ; --- everywhere_Adv = mkAdv "everywhere" ; --- few_Det = mkDeterminer plural "few" ; ------ first_Ord = ss "first" ; DEPRECATED --- for_Prep = mkPrep "for" ; --- from_Prep = mkPrep "from" ; --- he_Pron = mkPron "he" "him" "his" "his" singular P3 masculine ; --- here_Adv = mkAdv "here" ; --- here7to_Adv = mkAdv ["to here"] ; --- here7from_Adv = mkAdv ["from here"] ; --- how_IAdv = ss "how" ; --- how8much_IAdv = ss "how much" ; --- how8many_IDet = mkDeterminer plural ["how many"] ; --- if_Subj = ss "if" ; --- in8front_Prep = mkPrep ["in front of"] ; --- i_Pron = mkPron "I" "me" "my" "mine" singular P1 human ; --- in_Prep = mkPrep "in" ; --- it_Pron = mkPron "it" "it" "its" "its" singular P3 nonhuman ; --- less_CAdv = C.mkCAdv "less" "than" ; --- many_Det = mkDeterminer plural "many" ; --- more_CAdv = C.mkCAdv "more" "than" ; --- most_Predet = ss "most" ; --- much_Det = mkDeterminer singular "much" ; --- must_VV = { --- s = table { --- VVF VInf => ["have to"] ; --- VVF VPres => "must" ; --- VVF VPPart => ["had to"] ; --- VVF VPresPart => ["having to"] ; --- VVF VPast => ["had to"] ; --# notpresent --- VVPastNeg => ["hadn't to"] ; --# notpresent --- VVPresNeg => "mustn't" --- } ; --- typ = VVAux --- } ; ------b no_Phr = ss "no" ; --- no_Utt = ss "no" ; --- on_Prep = mkPrep "on" ; ------- one_Quant = mkDeterminer singular "one" ; -- DEPRECATED --- only_Predet = ss "only" ; --- or_Conj = mkConj "or" singular ; --- otherwise_PConj = ss "otherwise" ; --- part_Prep = mkPrep "of" ; --- please_Voc = ss "please" ; --- possess_Prep = mkPrep "of" ; --- quite_Adv = mkAdv "quite" ; --- she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ; --- so_AdA = mkAdA "so" ; --- somebody_NP = regNP "somebody" singular ; --- someSg_Det = mkDeterminer singular "some" ; --- somePl_Det = mkDeterminer plural "some" ; --- something_NP = regNP "something" singular ; --- somewhere_Adv = mkAdv "somewhere" ; --- that_Quant = mkQuant "that" "those" ; --- there_Adv = mkAdv "there" ; --- there7to_Adv = mkAdv "there" ; --- there7from_Adv = mkAdv ["from there"] ; --- therefore_PConj = ss "therefore" ; --- they_Pron = mkPron "they" "them" "their" "theirs" plural P3 human ; --- this_Quant = mkQuant "this" "these" ; --- through_Prep = mkPrep "through" ; --- too_AdA = mkAdA "too" ; --- to_Prep = mkPrep "to" ; --- under_Prep = mkPrep "under" ; --- very_AdA = mkAdA "very" ; --- want_VV = mkVV (regV "want") ; --- we_Pron = mkPron "we" "us" "our" "ours" plural P1 human ; --- whatPl_IP = mkIP "what" "what" "what's" plural ; --- whatSg_IP = mkIP "what" "what" "what's" singular ; --- when_IAdv = ss "when" ; --- when_Subj = ss "when" ; --- where_IAdv = ss "where" ; --- which_IQuant = {s = \\_ => "which"} ; ------b whichPl_IDet = mkDeterminer plural ["which"] ; ------b whichSg_IDet = mkDeterminer singular ["which"] ; --- whoPl_IP = mkIP "who" "whom" "whose" plural ; --- whoSg_IP = mkIP "who" "whom" "whose" singular ; --- why_IAdv = ss "why" ; --- without_Prep = mkPrep "without" ; --- with_Prep = mkPrep "with" ; ------b yes_Phr = ss "yes" ; --- yes_Utt = ss "yes" ; --- youSg_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; --- youPl_Pron = mkPron "you" "you" "your" "yours" plural P2 human ; --- youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; --- --- not_Predet = {s = "not" ; lock_Predet = <>} ; --- no_Quant = mkQuant "no" "no" "none" "none" ; --- if_then_Conj = mkConj "if" "then" singular ; --- nobody_NP = regNP "nobody" singular ; --- nothing_NP = regNP "nothing" singular ; --- --- at_least_AdN = mkAdN "at least" ; --- at_most_AdN = mkAdN "at most" ; --- --- except_Prep = mkPrep "except" ; --- --- as_CAdv = C.mkCAdv "as" "as" ; --- --- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ; --- that_Subj = ss "that" ; --- lin language_title_Utt = ss "Hunlish" ; --- ---} --- +concrete StructuralHun of Structural = CatHun ** + open Prelude, ResHun, ParadigmsHun in { +{- +------- +-- Ad* + +lin almost_AdA = mkAdA "" ; +lin almost_AdN = ss "" ; +lin at_least_AdN = ss "" ; +lin at_most_AdN = ss "" ; +lin so_AdA = mkAdA "" ; +lin too_AdA = mkAdA "" ; +lin very_AdA = mkAdA "" ; + +lin as_CAdv = { s = "" ; p = [] } ; +lin less_CAdv = { s = "" ; p = [] } ; +lin more_CAdv = { s = "" ; p = [] } ; +lin how_IAdv = ss "" : + +lin how8much_IAdv = ss "" ; +lin when_IAdv = ss "" ; +lin where_IAdv = ss "" : +lin why_IAdv = ss "" : + +lin always_AdV = ss "" ; + +lin everywhere_Adv = ss "" ; +lin here7from_Adv = ss "" ; +lin here7to_Adv = ss "" ; +lin here_Adv = ss "" ; +lin quite_Adv = ss "" ; +lin somewhere_Adv = ss "" ; +lin there7from_Adv = ss "" ; +lin there7to_Adv = ss "" ; +lin there_Adv = ss "" ; + +------- +-- Conj + +lin and_Conj = +lin or_Conj = +lin if_then_Conj = +lin both7and_DConj = +lin either7or_DConj = + +lin but_PConj = ss "" ; +lin otherwise_PConj = ss "" ; +lin therefore_PConj = ss "" ; + +----------------- +-- *Det and Quant + + +lin how8many_IDet = ; + +lin all_Predet = {s = ""} ; +lin not_Predet = {s = ""} ; +lin only_Predet = {s = ""} ; +lin most_Predet = {s = ""} ; + + +lin every_Det = +lin few_Det = +lin many_Det = +lin much_Det = + +lin somePl_Det = +lin someSg_Det = +lin no_Quant = +-} +lin that_Quant = mkQuant "az" "az" ; +lin this_Quant = mkQuant "ez" "ez" ; +{-lin which_IQuant = + + +----- +-- NP + +lin everybody_NP = defNP "" N.NumPl ; +lin everything_NP = defNP "" N.NumSg ; +lin nobody_NP = mkVerb; "" +lin nothing_NP = defNP "" N.NumSg ; +lin somebody_NP = defNP "" N.NumSg ; +lin something_NP = defNP "" N.NumSg ; + +oper + defNP : Str -> Num -> NP = {} ; +-} + +------- +-- Prep + +-- lin above_Prep = mkPrep "" +-- lin after_Prep = mkPrep "" +-- lin before_Prep = mkPrep "" ; +-- lin behind_Prep = mkPrep "" ; +-- lin between_Prep = = mkPrep "" ; +-- lin by8agent_Prep = mkPrep ; +-- lin by8means_Prep = mkPrep ; +-- lin during_Prep = mkPrep ; +-- lin except_Prep = mkPrep ; +-- lin for_Prep = mkPrep "" ; +-- lin from_Prep = mkPrep "" ; +-- lin in8front_Prep = mkPrep "" ; +-- lin in_Prep = mkPrep "" ; +-- lin on_Prep = mkPrep "" ; +-- lin part_Prep = mkPrep ; +-- lin possess_Prep = mkPrep "" ; +-- lin through_Prep = mkPrep ; +-- lin to_Prep = mkPrep ""; +-- lin under_Prep = mkPrep "" ; +-- lin with_Prep = mkPrep "" ; +-- lin without_Prep = mkPrep "" ; + + +------- +-- Pron + +-- Pronouns are closed class, no constructor in ParadigmsHun. + -- it_Pron = + -- i_Pron = + -- youPol_Pron, + -- youSg_Pron = + -- he_Pron = + -- she_Pron = + -- we_Pron = + -- youPl_Pron = + -- they_Pron = + +--lin whatPl_IP = ; +--lin whatSg_IP = : +--lin whoPl_IP = ; +--lin whoSg_IP = ; + +------- +-- Subj + +-- lin although_Subj = +-- lin because_Subj = +-- lin if_Subj = +-- lin that_Subj = +-- lin when_Subj = + + +------ +-- Utt + +lin language_title_Utt = ss "magyar" ; +lin no_Utt = ss "nem" ; +lin yes_Utt = ss "igen" ; + +{- +------- +-- Verb + +lin have_V2 = vtov2 copula ** {sc = ??}; +lin can8know_VV = can_VV ; -- can (capacity) +lin can_VV = mkVV "" ; -- can (possibility) +lin must_VV = mkVV "" ; +lin want_VV = mkVV "" subjunctive ; + +------ +-- Voc + +lin please_Voc = ss "" ; +-} } diff --git a/src/hungarian/SymbolHun.gf b/src/hungarian/SymbolHun.gf index 0866083a6..6c5cadb90 100644 --- a/src/hungarian/SymbolHun.gf +++ b/src/hungarian/SymbolHun.gf @@ -1,48 +1,50 @@ ---# -path=.:../abstract:../common +--# -path=.:../abstract:../common:../prelude + +concrete SymbolHun of Symbol = CatHun ** + open Prelude, ParadigmsHun, ResHun, (NS=NounHun) in { + +lin + + -- : Symb -> PN ; -- x + SymbPN i = mkPN i.s ; + + -- : Int -> PN ; -- 27 + IntPN i = mkPN i.s ; + + -- : Float -> PN ; -- 3.14159 + FloatPN i = mkPN i.s ; + + -- : Card -> PN ; -- twelve [as proper name] + NumPN i = mkPN i.s ; + +{- +lin +-- CNIntNP cn i = {} ; + + -- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y + CNSymbNP det cn xs = + let cnSymb = cn ** { comp = cn.comp ++ xs.s } + in NS.DetCN det cnSymb ; + + -- : CN -> Card -> NP ; -- level five ; level 5 + CNNumNP cn i = NS.MassNP (cn ** { comp = cn.comp ++ i.s }) ; + + -- : Symb -> S ; + SymbS sy = {s = } ; + -- : Symb -> Card ; + SymbNum sy = { s = sy.s ; n = Pl } ; + + -- : Symb -> Ord ; + SymbOrd sy = { s =} ; +-} +lincat + Symb, [Symb] = SS ; + +lin + MkSymb s = s ; + + BaseSymb = infixSS "és" ; + ConsSymb = infixSS "," ; -concrete SymbolHun of Symbol = CatHun ** open Prelude, ResHun in -{ ---{ --- ---lin --- SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ; --- IntPN i = {s = addGenitiveS i.s ; g = Neutr} ; --- FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ; --- NumPN i = {s = i.s ; g = Neutr} ; --- CNIntNP cn i = { --- s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! npcase2case c ; --- a = agrgP3 Sg cn.g --- } ; --- CNSymbNP det cn xs = { --- s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! npcase2case c ; --- a = agrgP3 det.n cn.g --- } ; --- CNNumNP cn i = { --- s = \\c => cn.s ! Sg ! Nom ++ i.s ! npcase2case c ; --- a = agrgP3 Sg cn.g --- } ; --- --- SymbS sy = sy ; --- --- SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ; --- SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ; --- ---lincat --- --- Symb, [Symb] = SS ; --- ---lin --- MkSymb s = s ; --- --- BaseSymb = infixSS "and" ; --- ConsSymb = infixSS "," ; --- ---oper --- -- Note: this results in a space before 's, but there's --- -- not mauch we can do about that. --- addGenitiveS : Str -> Case => Str = \s -> --- table { Gen => s ++ "'s"; _ => s } ; --- ---} } diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 215b24ed8..657194faa 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -1,63 +1,138 @@ -concrete VerbHun of Verb = CatHun ** open ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- UseV = predV ; --- --- SlashV2a v = predVc v ; --- Slash2V3 v np = --- insertObjc (\\_ => v.c2 ++ np.s ! NPAcc) (predV v ** {c2 = v.c3}) ; --- Slash3V3 v np = --- insertObjc (\\_ => v.c3 ++ np.s ! NPAcc) (predVc v) ; ---- --- --- ComplVV v vp = insertObj (\\a => infVP v.typ vp a) (predVV v) ; --- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ; --- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ; --- ComplVA v ap = insertObj (ap.s) (predV v) ; --- --- SlashV2V v vp = insertObjc (\\a => v.c3 ++ infVP v.typ vp a) (predVc v) ; --- SlashV2S v s = insertObjc (\\_ => conjThat ++ s.s) (predVc v) ; --- SlashV2Q v q = insertObjc (\\_ => q.s ! QIndir) (predVc v) ; --- SlashV2A v ap = insertObjc (\\a => ap.s ! a) (predVc v) ; ---- --- --- ComplSlash vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ; --- --- SlashVV vv vp = --- insertObj (\\a => infVP vv.typ vp a) (predVV vv) ** --- {c2 = vp.c2} ; --- SlashV2VNP vv np vp = --- insertObjPre (\\_ => vv.c2 ++ np.s ! NPAcc) --- (insertObjc (\\a => vv.c3 ++ infVP vv.typ vp a) (predVc vv)) ** --- {c2 = vp.c2} ; --- --- UseComp comp = insertObj comp.s (predAux auxBe) ; --- --- AdvVP vp adv = insertObj (\\_ => adv.s) vp ; --- AdVVP adv vp = insertAdV adv.s vp ; --- --- AdvVPSlash vp adv = insertObj (\\_ => adv.s) vp ** {c2 = vp.c2} ; --- AdVVPSlash adv vp = insertAdV adv.s vp ** {c2 = vp.c2} ; --- --- ReflVP v = insertObjPre (\\a => v.c2 ++ reflPron ! a) v ; --- --- PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ; --- ------b UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to" --- --- CompAP ap = ap ; --- CompNP np = {s = \\_ => np.s ! NPAcc} ; --- CompAdv a = {s = \\_ => a.s} ; --- CompCN cn = {s = \\a => case (fromAgr a).n of { --- Sg => artIndef ++ cn.s ! Sg ! Nom ; --- Pl => cn.s ! Pl ! Nom --- } --- } ; --- --- UseCopula = predAux auxBe ; --- ---} +concrete VerbHun of Verb = CatHun ** open ResHun, AdverbHun, Prelude in { + + +lin + +----- +-- VP + -- : V -> VP + UseV = ResHun.useV ; + + -- : V2 -> VP ; -- be loved + -- PassV2 = ResHun.passV2 ; + + -- : VPSlash -> VP ; + -- ReflVP = ResHun.insertRefl ; + + -- : VV -> VP -> VP ; + -- ComplVV vv vp = let vc = vp.vComp in case vv.vvtype of { + -- + -- } ; + + -- : VS -> S -> VP ; + -- ComplVS vs s = + -- let vps = useV vs ; + -- subord = SubjS {s=""} s ; + -- in vps ** {} ; + +{- + -- : VQ -> QS -> VP ; + ComplVQ vq qs = ; + + -- : VA -> AP -> VP ; -- they become red + ComplVA va ap = ResHun.insertObj (CompAP ap).s (useV va) ; + +-------- +-- Slash + -- : V2 -> VPSlash + SlashV2a = ResHun.useVc ; + + -- : V3 -> NP -> VPSlash ; -- give it (to her) + -- : V3 -> NP -> VPSlash ; -- give (it) to her + Slash2V3, + Slash3V3 = \v3 -> insertObj (useVc3 v3) ; + + -- : V2S -> S -> VPSlash ; -- answer (to him) that it is good + SlashV2S v2s s = + let vps = useVc v2s ; + subord = SubjS {s=""} s ; + in vps ** {obj = } ; + + + -- : V2V -> VP -> VPSlash ; -- beg (her) to go + SlashV2V v2v vp = ; + + -- : V2Q -> QS -> VPSlash ; -- ask (him) who came + SlashV2Q v2q qs = ; + + -- : V2A -> AP -> VPSlash ; -- paint (it) red + SlashV2A v2a ap = useVc v2a ** { + aComp = \\_ => (CompAP ap).aComp ! Sg3 Masc + } ; + + -- : VPSlash -> NP -> VP + ComplSlash = ResHun.insertComp ; + + -- : VV -> VPSlash -> VPSlash ; + -- Just like ComplVV except missing subject! + SlashVV vv vps = ComplVV vv vps ** { missing = vps.missing ; + post = vps.post } ; + + -- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy + SlashV2VNP v2v np vps = + ComplVV v2v vps ** + { missing = vps.missing ; + post = vps.post ; + iobj = np ** { s = np.s ! Dat } } ; + +-} + + -- : Comp -> VP ; + UseComp comp = comp ; + +{- + -- : VP -> Adv -> VP ; -- sleep here + AdvVP = insertAdv ; + + -- : VPSlash -> Adv -> VPSlash ; -- use (it) here + AdvVPSlash = insertAdvSlash ; + + -- : VP -> Adv -> VP ; -- sleep , even though ... + ExtAdvVP vp adv = vp ** { } ; + + -- : AdV -> VP -> VP ; -- always sleep + AdVVP adv vp = vp ** { } ; + + -- : AdV -> VPSlash -> VPSlash ; -- always use (it) + AdVVPSlash adv vps = vps ** { } ; + + -- : VP -> Prep -> VPSlash ; -- live in (it) + VPSlashPrep vp prep = +-} + +--2 Complements to copula + +-- Adjectival phrases, noun phrases, and adverbs can be used. + + -- : 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} ; + } ; + + -- : 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} ; + } ; + + -- : NP -> Comp ; + CompNP np = UseCopula ** { + s = \\vf => case vf of { + VFin P3 _ => np.s ! Nom ; + _ => np.s ! Nom ++ copula.s ! vf } ; + } ; + + -- : Adv -> Comp ; + CompAdv adv = UseCopula ** { + s = \\vf => adv.s ++ copula.s ! vf ; + } ; + + -- : VP -- Copula alone; + UseCopula = useV copula ; } From 8b35ea2762e520c424f308946c277fc38b76dbc6 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 28 Mar 2020 16:35:02 +0100 Subject: [PATCH 03/97] (Hun) Add some tests for noun inflection + new words for them --- src/hungarian/LexiconHun.gf | 2 +- src/hungarian/ParadigmsHun.gf | 5 + src/hungarian/ParamHun.gf | 2 +- src/hungarian/README.md | 26 +++++ src/hungarian/ResHun.gf | 3 +- src/hungarian/StructuralHun.gf | 12 +-- src/hungarian/unittest/inflection.gftest | 131 +++++++++++++++++++++++ 7 files changed, 171 insertions(+), 10 deletions(-) create mode 100644 src/hungarian/README.md create mode 100644 src/hungarian/unittest/inflection.gftest diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index c305d78d5..b3fcc06bc 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -31,7 +31,7 @@ lin beer_N = mkN "sör" ; -- lin belly_N = mkN "" ; -- lin big_A = mkA "" ; -- lin bike_N = mkN "" ; --- lin bird_N = mkN "" ; +lin bird_N = mkN "madár" ; -- lin bite_V2 = mkV2 "" ; -- lin black_A = mkA "" ; -- lin blood_N = mkN "" ; diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 9191ebf64..e0ffa8a35 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -70,6 +70,8 @@ oper mkPrep : Str -> Case -> Prep ; -- Postposition and case } ; + casePrep : Case -> Prep ; -- No postposition, only case + -- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num -> -- lin Conj { s = s1 ; s2 = s2 } ; @@ -136,6 +138,9 @@ oper mkPrep : Str -> Case -> Prep = \str,c -> lin Prep (ResHun.mkPrep str ** {c = c}) ; } ; + + casePrep : Case -> Prep + = \c -> lin Prep (ResHun.mkPrep [] ** {c = c}) ; -------------------------------------------------------------------------------- } diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index efe085fe3..feb14125b 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -20,7 +20,7 @@ oper -- Nouns param - Case = Nom | Acc | Dat | Ins | Ess | Tra | Cau + Case = Nom | Acc | Dat | Gen | Ins | Ess | Tra | Cau | Ill | Sub | All | Ine | Sup | Ade | Ela | Del | Abl | Ter | For | Tem ; diff --git a/src/hungarian/README.md b/src/hungarian/README.md new file mode 100644 index 000000000..42b891145 --- /dev/null +++ b/src/hungarian/README.md @@ -0,0 +1,26 @@ +# Hungarian + +## Language info + +* English name: Hungarian +* Autonym: Magyar +* ISO code: Hun + +## Authors + +Inari Listenmaa, 2020- + +With contributions from Erzsébet Galgóczy (initial nominal morphology) and Patrik Jansson (numerals). + +## Publications + +- + +## Implementation information + +So far (2020-03) just copypasted a dummy module with Hungarian words that inflect mostly wrong or not at all. This will change in a few weeks. + + +## Maintainer + +Inari Listenmaa ([@inariksit](https://github.com/inariksit)) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 346970400..0fbb9184e 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -7,8 +7,6 @@ -- Some parameters, such as $Number$, are inherited from $ParamX$. resource ResHun = ParamHun ** open Prelude, Predef, ParamHun in { -{ - -------------------------------------------------------------------------------- -- Nouns oper @@ -18,6 +16,7 @@ oper Nom => harm1 [] ; Acc => harm3 "ot" "et" "öt" ; Dat => harm "nak" "nek" ; + Gen => harm "é" "e" ; Ins => harm "al" "el" ; Ess => harm "stul" "stül" ; Tra => harm "á" "é" ; diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 35a242481..3815ef4b5 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -92,7 +92,7 @@ oper -- lin above_Prep = mkPrep "" -- lin after_Prep = mkPrep "" --- lin before_Prep = mkPrep "" ; +lin before_Prep = mkPrep "alatt" ; -- lin behind_Prep = mkPrep "" ; -- lin between_Prep = = mkPrep "" ; -- lin by8agent_Prep = mkPrep ; @@ -102,12 +102,12 @@ oper -- lin for_Prep = mkPrep "" ; -- lin from_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ; --- lin in_Prep = mkPrep "" ; --- lin on_Prep = mkPrep "" ; --- lin part_Prep = mkPrep ; --- lin possess_Prep = mkPrep "" ; +lin in_Prep = casePrep Ine ; +lin on_Prep = casePrep Ade ; +-- lin part_Prep = casePrep ; +lin possess_Prep = casePrep Gen ; -- lin through_Prep = mkPrep ; --- lin to_Prep = mkPrep ""; +lin to_Prep = casePrep All ; -- lin under_Prep = mkPrep "" ; -- lin with_Prep = mkPrep "" ; -- lin without_Prep = mkPrep "" ; diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest new file mode 100644 index 000000000..1904923e5 --- /dev/null +++ b/src/hungarian/unittest/inflection.gftest @@ -0,0 +1,131 @@ +--------------------- +-- Noun inflection -- +--------------------- + +-- Beer +Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) +LangEng: before 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öre + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) +LangEng: to the beer +LangHun: a sörhöz + +-- Woman +Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) +LangEng: before 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őe + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) +LangEng: to the woman +LangHun: a nőhöz + + +-- Apple +Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: before the apple +LangHun: az alma alatt + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: in the apple +LangHun: az almaban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: on the apple +LangHun: az almanál + +Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: of the apple +LangHun: az almaé + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: to the apple +LangHun: az almahoz + +-- Bird +Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) +LangEng: before 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 + + +-- Name +Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) +LangEng: before 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éve + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) +LangEng: to the name +LangHun: a névhez + +-- Man +Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) +LangEng: before 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érfiben + +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érfie + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) +LangEng: to the man +LangHun: a férfihez From 59e1a397a9d7272611ee1f8ba2810de93363415e Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 28 Mar 2020 16:47:14 +0100 Subject: [PATCH 04/97] (Hun) Fix error in unit tests --- src/hungarian/StructuralHun.gf | 4 ++-- src/hungarian/unittest/inflection.gftest | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 3815ef4b5..513e7ba36 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -92,7 +92,7 @@ oper -- lin above_Prep = mkPrep "" -- lin after_Prep = mkPrep "" -lin before_Prep = mkPrep "alatt" ; +-- lin before_Prep = mkPrep "" ; -- lin behind_Prep = mkPrep "" ; -- lin between_Prep = = mkPrep "" ; -- lin by8agent_Prep = mkPrep ; @@ -108,7 +108,7 @@ lin on_Prep = casePrep Ade ; lin possess_Prep = casePrep Gen ; -- lin through_Prep = mkPrep ; lin to_Prep = casePrep All ; --- lin under_Prep = mkPrep "" ; +lin under_Prep = mkPrep "alatt" ; -- lin with_Prep = mkPrep "" ; -- lin without_Prep = mkPrep "" ; diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 1904923e5..5badfc97c 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -3,8 +3,8 @@ --------------------- -- Beer -Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) -LangEng: before the 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)) @@ -24,8 +24,8 @@ LangEng: to the beer LangHun: a sörhöz -- Woman -Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) -LangEng: before the woman +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)) @@ -46,8 +46,8 @@ LangHun: a nőhöz -- Apple -Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) -LangEng: before the 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)) @@ -67,8 +67,8 @@ LangEng: to the apple LangHun: az almahoz -- Bird -Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) -LangEng: before the 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)) @@ -89,8 +89,8 @@ LangHun: a madárhoz -- Name -Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) -LangEng: before the 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)) @@ -110,8 +110,8 @@ LangEng: to the name LangHun: a névhez -- Man -Lang: PrepNP before_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) -LangEng: before the 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)) From f7c58d700e3046ed1b21c16264848fafb19735ac Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 28 Mar 2020 16:54:14 +0100 Subject: [PATCH 05/97] (Hun) Add plurals to unit tests --- src/hungarian/unittest/inflection.gftest | 89 ++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 5badfc97c..9f347ad1f 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -23,6 +23,21 @@ 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öke + +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 + -- Woman Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) LangEng: under the woman @@ -44,6 +59,21 @@ 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őöke + +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 + -- Apple Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) @@ -66,6 +96,21 @@ Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) LangEng: to the apple LangHun: az almahoz +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almaokban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almaoknál + +Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almaoké + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almaokhoz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almaok alatt + -- Bird Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) LangEng: under the bird @@ -87,6 +132,20 @@ 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 madárokban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +LangHun: a madároknál + +Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +LangHun: a madároké + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +LangHun: a madárokhoz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +LangHun: a madárok alatt -- Name Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) @@ -109,6 +168,21 @@ 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 névekben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +LangHun: a néveknél + +Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +LangHun: a néveke + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +LangHun: a névekhez + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +LangHun: a névek alatt + -- Man Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: under the man @@ -129,3 +203,18 @@ LangHun: a férfie Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: to the man LangHun: a férfihez + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfiekben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfieknél + +Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfieke + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfiekhez + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfiek alatt From ef37b8770171fd563711ace91d772b071e8e0bde Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 28 Mar 2020 18:59:48 +0100 Subject: [PATCH 06/97] Update inflection.gftest Fixed errors --- src/hungarian/unittest/inflection.gftest | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 9f347ad1f..351ff010d 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -13,11 +13,11 @@ LangHun: a sörben Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) LangEng: on the beer -LangHun: a sörnél +LangHun: a sörön Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) LangEng: of the beer -LangHun: a söre +LangHun: a söré Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) LangEng: to the beer @@ -30,7 +30,7 @@ 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öke +LangHun: a söröké Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) LangHun: a sörökhöz @@ -53,26 +53,26 @@ LangHun: a nőnél Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) LangEng: of the woman -LangHun: a nőe +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 +LangHun: a nőkben Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -LangHun: a nőöknél +LangHun: a nőknél Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -LangHun: a nőöke +LangHun: a nőke Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -LangHun: a nőökhöz +LangHun: a nőkhöz Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) -LangHun: a nőök alatt +LangHun: a nők alatt -- Apple @@ -82,34 +82,34 @@ LangHun: az alma alatt Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) LangEng: in the apple -LangHun: az almaban +LangHun: az almában Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) LangEng: on the apple -LangHun: az almanál +LangHun: az almánál Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) LangEng: of the apple -LangHun: az almaé +LangHun: az almáé Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) LangEng: to the apple -LangHun: az almahoz +LangHun: az almához Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almaokban +LangHun: az almákban Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almaoknál +LangHun: az almáknál Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almaoké +LangHun: az almáké Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almaokhoz +LangHun: az almákhoz Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) -LangHun: az almaok alatt +LangHun: az almák alatt -- Bird Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) @@ -162,7 +162,7 @@ LangHun: a névnél Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) LangEng: of the name -LangHun: a néve +LangHun: a névé Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) LangEng: to the name @@ -175,7 +175,7 @@ Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) LangHun: a néveknél Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a néveke +LangHun: a néveké Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) LangHun: a névekhez @@ -198,7 +198,7 @@ LangHun: a férfinél Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: of the man -LangHun: a férfie +LangHun: a férfié Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: to the man @@ -211,7 +211,7 @@ Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) LangHun: a férfieknél Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfieke +LangHun: a férfieké Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) LangHun: a férfiekhez From 5907b0ead7cc86873c5d6b1c3731d9cde5081015 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 28 Mar 2020 19:04:15 +0100 Subject: [PATCH 07/97] Update inflection.gftest --- src/hungarian/unittest/inflection.gftest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 351ff010d..55c92c98d 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -66,7 +66,7 @@ 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őke +LangHun: a nőké Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) LangHun: a nőkhöz From 30ef8b8255d810d79bac1ab4a4009ae026fad58f Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 28 Mar 2020 19:08:04 +0100 Subject: [PATCH 08/97] Update README.md --- src/hungarian/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/README.md b/src/hungarian/README.md index 42b891145..f9857d1e5 100644 --- a/src/hungarian/README.md +++ b/src/hungarian/README.md @@ -8,7 +8,7 @@ ## Authors -Inari Listenmaa, 2020- +Inari Listenmaa, Julia Jansson, 2020- With contributions from Erzsébet Galgóczy (initial nominal morphology) and Patrik Jansson (numerals). From 8d2657fd1089ade429213beb4cabe3ce713a2878 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sun, 29 Mar 2020 14:57:22 +0200 Subject: [PATCH 09/97] =?UTF-8?q?Corrected=20irregular=20mad=C3=A1r=20noun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/unittest/inflection.gftest | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 55c92c98d..612d15799 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -133,19 +133,19 @@ LangEng: to the bird LangHun: a madárhoz Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madárokban +LangHun: a madarakban Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madároknál +LangHun: a madaraknál Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madároké +LangHun: a madaraké Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madárokhoz +LangHun: a madarakhoz Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) -LangHun: a madárok alatt +LangHun: a madarak alatt -- Name Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) @@ -205,16 +205,16 @@ LangEng: to the man LangHun: a férfihez Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiekben +LangHun: a férfiakben Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfieknél +LangHun: a férfiaknél Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfieké +LangHun: a férfiaké Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiekhez +LangHun: a férfiakhez Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiek alatt +LangHun: a férfiak alatt From 41824520b8abff031eff93e8467c7d1be66faadf Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sun, 29 Mar 2020 15:43:50 +0200 Subject: [PATCH 10/97] =?UTF-8?q?Corrected=20f=C3=A9rfi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/unittest/inflection.gftest | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 612d15799..01ab4b6f6 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -190,11 +190,11 @@ LangHun: a férfi alatt Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: in the man -LangHun: a férfiben +LangHun: a férfiban Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: on the man -LangHun: a férfinél +LangHun: a férfinál Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: of the man @@ -202,19 +202,19 @@ LangHun: a férfié Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: to the man -LangHun: a férfihez +LangHun: a férfihoz Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiakben +LangHun: a férfiakban Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) -LangHun: a férfiaknél +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érfiakhez +LangHun: a férfiakhoz Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) LangHun: a férfiak alatt From 0e0ac8474bf71db9646c5ff388596bdbb94bbf16 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sun, 29 Mar 2020 15:48:36 +0200 Subject: [PATCH 11/97] Update inflection.gftest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrected név --- src/hungarian/unittest/inflection.gftest | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 01ab4b6f6..06916cfd5 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -169,19 +169,19 @@ LangEng: to the name LangHun: a névhez Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a névekben +LangHun: a nevekben Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a néveknél +LangHun: a neveknél Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a néveké +LangHun: a neveké Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a névekhez +LangHun: a nevekhez Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) -LangHun: a névek alatt +LangHun: a nevek alatt -- Man Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) From 268af14dd356610ea291aa244fad05b433501c8a Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 14:59:22 +0200 Subject: [PATCH 12/97] (Hun) Remove a few noun cases --- src/hungarian/ParamHun.gf | 35 ++++++++++++++++++++++++++++++++--- src/hungarian/ResHun.gf | 27 +++++++++++++-------------- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index feb14125b..7c33f47fd 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -20,13 +20,42 @@ oper -- Nouns param - Case = Nom | Acc | Dat | Gen | Ins | Ess | Tra | Cau - | Ill | Sub | All | Ine | Sup | Ade | Ela - | Del | Abl | Ter | For | Tem + + 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’) ; Harm = H_a | H_e | H_o ; + SubjCase = SCNom | SCDat ; -- Limited set of subject cases + +oper + + caseTable : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Case=>Str = + \n,a,d,il,ine,el,al,ad,ab,sub,sup,del,ca,ins,tra -> table { + Nom => n ; + Acc => a ; + Dat => d ; + Ill => il ; + Ine => ine ; + Ela => el ; + All => al ; + Ade => ad ; + Abl => ab ; + Sub => sub ; + Sup => sup ; + Del => del ; + Cau => ca ; + Ins => ins ; + Tra => tra } ; + + -------------------------------------------------------------------------------- -- Numerals diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 0fbb9184e..ee7a7757a 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -16,28 +16,27 @@ oper Nom => harm1 [] ; Acc => harm3 "ot" "et" "öt" ; Dat => harm "nak" "nek" ; - Gen => harm "é" "e" ; - Ins => harm "al" "el" ; - Ess => harm "stul" "stül" ; - Tra => harm "á" "é" ; - Cau => harm1 "ért" ; Ill => harm "ba" "be" ; - Sub => harm "ra" "re" ; - All => harm3 "hoz" "hez" "höz" ; Ine => harm "ban" "ben" ; - Sup => harm3 "on" "en" "ön" ; - Ade => harm "nál" "nél" ; Ela => harm "ból" "ből" ; - Del => harm "ról" "ről" ; + All => harm3 "hoz" "hez" "höz" ; + Ade => harm "nál" "nél" ; Abl => harm "tól" "től" ; - Ter => harm1 "ig" ; - For => harm1 "ként" ; - Tem => harm1 "kor" + Sub => harm "ra" "re" ; + Sup => harm3 "on" "en" "ön" ; + Del => harm "ról" "ről" ; + Ins => harm "al" "el" ; + Cau => harm1 "ért" ; + Tra => harm "á" "é" -- TODO consonant assimilation + -- Ess => harm "stul" "stül" ; + -- Ter => harm1 "ig" ; + -- For => harm1 "ként" ; + -- Tem => harm1 "kor" } ; endNumber : Number -> HarmForms = \n -> case n of { Sg => harm1 [] ; - Pl => harm3 "ok" "ek" "ök" + Pl => harm3 "ok" "ek" "ök" -- TODO: vowel assimilation } ; harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> ; From ef0cca5463b88256d20c47a1c1fad4c665423264 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 15:03:37 +0200 Subject: [PATCH 13/97] (Hun) Restrict subject case to only Nom and Dat --- src/hungarian/ResHun.gf | 17 ++++++++++------- src/hungarian/StructuralHun.gf | 5 ++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index ee7a7757a..fb3ad10b9 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -181,7 +181,7 @@ oper Verb : Type = { s : VForm => Str ; - sc : Case ; -- subject case + sc : SubjCase ; -- subject case } ; Verb2 : Type = Verb ** { c2 : Case -- object case @@ -218,7 +218,7 @@ oper VFin P2 Pl => pl2 ; VFin P3 Pl => pl3 } ; - sc = Nom + sc = SCNom } ; copula : Verb = mkVerbFull @@ -274,11 +274,14 @@ oper Sentence : Type = {s : Str} ; predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** { - s = \\t,a,p => - np.s ! vp.sc - ++ vp.obj - ++ vp.adv - ++ vp.s ! agr2vf np.agr + s = \\t,a,p => let subjcase : Case = case vp.sc of { + SCNom => Nom ; + SCDat => Dat } + in np.s ! subjcase + ++ np.empty -- standard trick for prodrop + ++ vp.obj + ++ vp.adv + ++ vp.s ! agr2vf np.agr } ; -------------------------------------------------------------------------------- diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 513e7ba36..0c73f8cb9 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -149,12 +149,11 @@ lin language_title_Utt = ss "magyar" ; lin no_Utt = ss "nem" ; lin yes_Utt = ss "igen" ; -{- ------- -- Verb -lin have_V2 = vtov2 copula ** {sc = ??}; -lin can8know_VV = can_VV ; -- can (capacity) +lin have_V2 = vtov2 copula ** {sc = SCDat ; c2 = Nom} ; +{-lin can8know_VV = can_VV ; -- can (capacity) lin can_VV = mkVV "" ; -- can (possibility) lin must_VV = mkVV "" ; lin want_VV = mkVV "" subjunctive ; From cd73fe958e96fc7c751de9185d31362f471d740b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 15:18:58 +0200 Subject: [PATCH 14/97] (Hun) Add pronouns --- src/hungarian/NounHun.gf | 4 +- src/hungarian/StructuralHun.gf | 76 ++++++++++++++++++++++++++++++---- 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 54d10cbff..5c26f6722 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -12,13 +12,13 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { agr = ; } ; -{- -- : PN -> NP ; - UsePN pn = pn ** {} ; + UsePN pn = pn ; -- : Pron -> NP ; UsePron pron = pron ; + {- -- : Predet -> NP -> NP ; -- only the man PredetNP predet np = np ** {s = } ; diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 0c73f8cb9..e45831b5d 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -118,14 +118,74 @@ lin under_Prep = mkPrep "alatt" ; -- Pronouns are closed class, no constructor in ParadigmsHun. -- it_Pron = - -- i_Pron = - -- youPol_Pron, - -- youSg_Pron = - -- he_Pron = - -- she_Pron = - -- we_Pron = - -- youPl_Pron = - -- they_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 = ; + isPron = True ; + } ; + 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 = ; + isPron = True ; + } ; + 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 + isPron = True ; + } ; + 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 = ; + isPron = True ; + } ; + + 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 = ; + isPron = True ; + } ; + 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 = ; + isPron = True ; + } ; --lin whatPl_IP = ; --lin whatSg_IP = : From fcd8732d9bc03a6e7ebf19ca04256a7dda67e9cd Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 15:19:37 +0200 Subject: [PATCH 15/97] (Hun) New words, small fixes --- src/hungarian/LexiconHun.gf | 4 ++-- src/hungarian/ResHun.gf | 2 +- src/hungarian/StructuralHun.gf | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index b3fcc06bc..46e5a7665 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -67,7 +67,7 @@ lin bird_N = mkN "madár" ; -- lin cheese_N = mkN "" ; -- lin child_N = mkN "" ; -- lin church_N = mkN "" ; --- lin city_N = mkN "" ; +lin city_N = mkN "város" ; -- lin clean_A = mkA "" ; -- lin clever_A = mkA "" ; -- lin close_V2 = mkV2 "" ; @@ -131,7 +131,7 @@ lin bird_N = mkN "madár" ; -- lin floor_N = mkN "" ; -- lin flow_V = mkV "" ; -- lin flower_N = mkN "" ; --- lin fly_V = mkV "" ; +lin fly_V = mkV "repül" ; -- lin fog_N = mkN "" ; -- lin foot_N = mkN "" ; -- lin forest_N = mkN "" ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index fb3ad10b9..74249687b 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -187,7 +187,7 @@ oper c2 : Case -- object case } ; Verb3 : Type = Verb2 ** { - c3 : Case -- indirect object case + -- c3 : Case -- indirect object case } ; mkVerb2 : Str -> Verb2 = \sg3 -> vtov2 (mkVerb sg3) ; diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index e45831b5d..3e1508551 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -90,13 +90,13 @@ oper ------- -- Prep --- lin above_Prep = mkPrep "" +lin above_Prep = mkPrep "fölött" ; -- lin after_Prep = mkPrep "" -- lin before_Prep = mkPrep "" ; -- lin behind_Prep = mkPrep "" ; -- lin between_Prep = = mkPrep "" ; -- lin by8agent_Prep = mkPrep ; --- lin by8means_Prep = mkPrep ; +lin by8means_Prep = casePrep Ins ; -- lin during_Prep = mkPrep ; -- lin except_Prep = mkPrep ; -- lin for_Prep = mkPrep "" ; @@ -105,7 +105,7 @@ oper lin in_Prep = casePrep Ine ; lin on_Prep = casePrep Ade ; -- lin part_Prep = casePrep ; -lin possess_Prep = casePrep Gen ; +-- lin possess_Prep = -- Suffix attaches to possessee, not possessor -- lin through_Prep = mkPrep ; lin to_Prep = casePrep All ; lin under_Prep = mkPrep "alatt" ; From 350960da1cc68222fc66242d85b0606e926d121b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 15:26:04 +0200 Subject: [PATCH 16/97] (Hun) Add transitive verbs --- src/hungarian/ResHun.gf | 5 +++++ src/hungarian/VerbHun.gf | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 74249687b..a29fe2e01 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -252,6 +252,11 @@ oper 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 ! agr2vf np.agr ; + _ => vps.s ! vf } ; } ; insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ; diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 657194faa..946882cf1 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -34,9 +34,11 @@ lin -------- -- Slash +-} -- : V2 -> VPSlash SlashV2a = ResHun.useVc ; +{- -- : V3 -> NP -> VPSlash ; -- give it (to her) -- : V3 -> NP -> VPSlash ; -- give (it) to her Slash2V3, @@ -59,10 +61,10 @@ lin SlashV2A v2a ap = useVc v2a ** { aComp = \\_ => (CompAP ap).aComp ! Sg3 Masc } ; - +-} -- : VPSlash -> NP -> VP - ComplSlash = ResHun.insertComp ; - + ComplSlash = ResHun.insertObj ; +{- -- : VV -> VPSlash -> VPSlash ; -- Just like ComplVV except missing subject! SlashVV vv vps = ComplVV vv vps ** { missing = vps.missing ; @@ -80,13 +82,13 @@ lin -- : Comp -> VP ; UseComp comp = comp ; -{- + -- : VP -> Adv -> VP ; -- sleep here AdvVP = insertAdv ; -- : VPSlash -> Adv -> VPSlash ; -- use (it) here AdvVPSlash = insertAdvSlash ; - +{- -- : VP -> Adv -> VP ; -- sleep , even though ... ExtAdvVP vp adv = vp ** { } ; From 4a8668fce97ae213aafafc9a6fd5dbb43690158d Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 16:01:12 +0200 Subject: [PATCH 17/97] (Hun) Prevent redundant use of IndefArt in DetQuant with a Numeral --- src/hungarian/NounHun.gf | 7 +++++-- src/hungarian/NumeralHun.gf | 23 ++++++++++++----------- src/hungarian/ParamHun.gf | 12 ++++++------ src/hungarian/ResHun.gf | 8 +++++--- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 5c26f6722..3b05a049e 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -58,7 +58,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { -- : Quant -> Num -> Det ; DetQuant quant num = quant ** num ** { - s = \\c => quant.s ! num.n ! c + 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 @@ -115,13 +117,14 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { DefArt = { s, sp = \\_,_ => pre {"a" ; "az" / v } ; + isIndefArt = False ; } ; - -- : Quant IndefArt = { s, sp = \\_,_ => "egy" ; + isIndefArt = True ; } ; -- : Pron -> Quant diff --git a/src/hungarian/NumeralHun.gf b/src/hungarian/NumeralHun.gf index f2be44486..d0ad7ce19 100644 --- a/src/hungarian/NumeralHun.gf +++ b/src/hungarian/NumeralHun.gf @@ -30,48 +30,48 @@ lin pot0 d = d ; -- : Sub100 ; -- 10 - pot110 = {s = table {p => "tíz"} ; n=Pl} ; + pot110 = {s = table {p => "tíz"} ; n = Pl ; numtype = IsNum} ; -- : Sub100 ; -- 11 - pot111 = {s = table {p => "tizenegy"} ; n=Pl} ; + pot111 = {s = table {p => "tizenegy"} ; n = Pl ; numtype = IsNum} ; -- : Digit -> Sub100 ; -- 10 + d pot1to19 d = {s = table {p => "tizen" ++ d.s ! } ; - n = Pl} ; + n = Pl ; numtype = IsNum} ; -- : Sub10 -> Sub100 ; -- coercion of 1..9 pot0as1 n = {s = table {p => n.s ! } ; - n = Pl} ; + n = Pl ; numtype = IsNum} ; -- : Digit -> Sub100 ; -- d * 10 pot1 d = {s = table {p => d.s ! } ; - n = Pl} ; + n = Pl ; numtype = IsNum} ; -- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n pot1plus d e = {s = table {p => (d.s ! ) ++ e.s ! } ; - n = Pl} ; + n = Pl ; numtype = IsNum} ; -- : Sub100 -> Sub1000 ; -- coercion of 1..99 pot1as2 n = n ; -- : Sub10 -> Sub1000 ; -- m * 100 pot2 d = {s = table {p => (d.s ! ) ++ "száz"} ; - n = Pl} ; + n = Pl ; numtype = IsNum} ; -- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n pot2plus d e = {s = table {p => (d.s ! ) ++ "száz" ++ e.s ! p} ; - n = Pl} ; + n = Pl ; numtype = IsNum} ; -- : Sub1000 -> Sub1000000 ; -- coercion of 1..999 pot2as3 n = n ; -- : Sub1000 -> Sub1000000 ; -- m * 1000 pot3 n = {s = table {p => n.s ! Attrib ++ "ezer"} ; - n = Pl} ; + n = Pl ; numtype = IsNum} ; -- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n pot3plus n m = {s = table {p => n.s ! Attrib ++ "ezer" ++ m.s ! p} ; - n = Pl} ; + n = Pl ; numtype = IsNum} ; oper LinDigit : Type = {s : DForm*Place => Str ; n : Number} ; @@ -85,7 +85,8 @@ oper => ua ; => ta } ; -- ord = ord ; -- TODO figure out where to use ordinal - n = Pl + n = Pl ; + numType = IsNum ; } ; } diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 7c33f47fd..7ffe3b70b 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -65,13 +65,13 @@ param CardOrd = NOrd | NCard ; -- Not used yet --- NumType = NoNum | IsDig | IsNum ; + NumType = NoNum | IsDig | IsNum ; --- oper --- isNum : {numtype : NumType} -> Bool = \nt -> case nt.numtype of { --- NoNum => False ; --- _ => True --- } ; +oper + isNum : {numtype : NumType} -> Bool = \nt -> case nt.numtype of { + NoNum => False ; + _ => True + } ; -------------------------------------------------------------------------------- -- Adjectives diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index a29fe2e01..400a56597 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -102,11 +102,13 @@ oper Quant : Type = { 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" } ; mkQuant : (s,sp : Str) -> Quant = \s,sp -> { s = (mkNoun s).s ; sp = (mkNoun sp).s ; + isIndefArt = False ; } ; -- Det is formed in DetQuant : Quant -> Num -> Det @@ -115,19 +117,19 @@ oper s, sp : Case => Str ; n : Number ; --- numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl + numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl } ; Num : Type = { s : Place => Str ; -- Independent or attribute n : Number ; -- Singular or plural - -- numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages + numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages } ; baseNum : Num = { s = \\_ => [] ; n = Sg ; - -- numtype = NoNum + numtype = NoNum } ; {- Numeral can become Num via From 60500231d8c4556616ee64582b0c95daf787d5b9 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 21:51:42 +0200 Subject: [PATCH 18/97] (Hun) Adjust types for numerals --- src/hungarian/CatHun.gf | 2 +- src/hungarian/NounHun.gf | 4 +++- src/hungarian/ResHun.gf | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index c19eb8a3b..743abe55d 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -76,7 +76,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { -- Constructed in NumeralHun. - Card = ResHun.Num ; + Card = ResHun.Numeral ; Numeral = ResHun.Numeral ; Digits = {s : CardOrd => Str ; n : Number} ; diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 3b05a049e..25f77ae6f 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -82,7 +82,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { NumPl = baseNum ** {n = Pl} ; -- : Card -> Num ; - NumCard card = card ; + NumCard card = card ** { + n = Sg -- Numerals take noun in Sg: e.g. öt város, literally 'five city' + } ; -- : Digits -> Card ; -- NumDigits dig = diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 400a56597..c48a4d5db 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -120,24 +120,24 @@ oper numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl } ; - Num : Type = { + Numeral : Type = { s : Place => Str ; -- Independent or attribute - n : Number ; -- Singular or plural numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages - } ; - - baseNum : Num = { - s = \\_ => [] ; - n = Sg ; - numtype = NoNum + -- TODO add ordinal } ; {- Numeral can become Num via Noun.gf: NumNumeral : Numeral -> Card ; Noun.gf: NumCard : Card -> Num ; -} - Numeral : Type = Num ** { - -- TODO add ordinal + Num : Type = Numeral ** { + n : Number ; -- Singular or plural + } ; + + baseNum : Num = { + s = \\_ => [] ; + n = Sg ; + numtype = NoNum } ; -------------------------------------------------------------------------------- From d5127e735f2201dd63061c4f2b8513bb6e9991ad Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 21:54:21 +0200 Subject: [PATCH 19/97] Comment out posses_Prep from tests --- src/hungarian/unittest/inflection.gftest | 60 ++++++++++++------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 06916cfd5..0a75c35b5 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -15,9 +15,9 @@ Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) LangEng: on the beer LangHun: a sörön -Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) -LangEng: of the beer -LangHun: a söré +# 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 @@ -29,8 +29,8 @@ 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 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 @@ -51,9 +51,9 @@ 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 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 @@ -65,8 +65,8 @@ 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 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 @@ -88,9 +88,9 @@ 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 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 @@ -102,8 +102,8 @@ 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 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 @@ -124,9 +124,9 @@ 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 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 @@ -138,8 +138,8 @@ 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 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 @@ -160,9 +160,9 @@ 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 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 @@ -174,8 +174,8 @@ 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 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 @@ -196,9 +196,9 @@ 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 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 @@ -210,8 +210,8 @@ 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 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 From 8377dfc21287e5a8c97f6ef15a5fd09e78bbbfb1 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 21:55:06 +0200 Subject: [PATCH 20/97] (Hun) Move all noun morphology related opers and types to NounMorphoHun --- src/hungarian/LexiconHun.gf | 4 +- src/hungarian/NounMorphoHun.gf | 204 +++++++++++++++++++++++++++++++++ src/hungarian/ParadigmsHun.gf | 27 ++++- src/hungarian/ParamHun.gf | 9 -- src/hungarian/ResHun.gf | 85 +++----------- src/hungarian/StructuralHun.gf | 2 + 6 files changed, 247 insertions(+), 84 deletions(-) create mode 100644 src/hungarian/NounMorphoHun.gf diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 46e5a7665..3f3c4f248 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -1,5 +1,5 @@ concrete LexiconHun of Lexicon = CatHun ** - open ParadigmsHun in { + open ParadigmsHun, ParamHun, Prelude in { ---- -- A @@ -222,7 +222,7 @@ lin house_N = mkN "ház" ; ---- -- M -lin man_N = mkN "férfi" ; +lin man_N = mkN "férfi" "ak" harmA ; -- force plural allomorph and a-harmony -- lin married_A2 = mkA "" ; -- lin meat_N = mkN "" ; -- lin milk_N = mkN "" ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf new file mode 100644 index 000000000..21861e4c7 --- /dev/null +++ b/src/hungarian/NounMorphoHun.gf @@ -0,0 +1,204 @@ +resource NounMorphoHun = 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: + dAlma : Str -> Noun = \alma -> + let almá : Str = lengthen alma ; + + -- Apply mkNoun to the lengthened stem "almá" or "kefé" + 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", "név" with shortened stem vowel in plural + 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 ; + nMadara = mkNoun 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 + + } ; + } ; + + -- TODO: actual paradigm + dSör : Str -> Noun -> \sör -> + let foo : Str = "foo" ; + in mkNoun sör ; + + -- More words not covered by current paradigms: + -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf + -- falu ~ falva-k + -- gyomor ~ gyomr-ot + -- sátor ~ satr-at + -- 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 ; + _ + ("á"|"é") + ? => dMadár 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 + } ; + +-------------------------------------------------------------------------------- +-- 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" | "ö" | "ü" | + "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; + + -- 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 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. nev, almá). + pluralAllomorph : (stem : Str) -> Str = \stem -> + case vowFinal stem of { + True => "k" ; + False => 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 + mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = \h,plural,w -> + let endCase : Case -> HarmForms = case vowFinal w of { + True => endCaseVow ; + False => endCaseCons } ; + + -- Last consonant doubles before instrumental and translative + lastCons : Str = case vowFinal w of { + True => [] ; + False => last 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) => w + lastCons + endCase c ! h ; + c@_ => w + endCase c ! h } ; + + Pl => table { + -- Double the plural k before Ins, Tra + c@(Ins|Tra) => w + plural + "k" + endCaseCons c ! h ; + + -- endCaseCons, because we only use -k as plural morpheme. + -- If we add possessive forms with allomorph -i, then revise. + c@_ => w + plural + endCaseCons c ! h } + } + } ; + +} diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index e0ffa8a35..d4f23d993 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -9,11 +9,17 @@ oper -- should always use these constants instead of the constructors -- defined in $ResKor$. + Harmony : Type ; + harmA : Harmony ; + harmE : Harmony ; + harmO : Harmony ; --2 Nouns mkN : overload { - mkN : (noun : Str) -> N ; -- Predictable nouns + mkN : (sgnom : Str) -> N ; -- Predictable nouns + mkN : (madár : Str) -> (ak : Str) -> N ; -- Noun with unpredictable plural allomorph + mkN : (férfi : Str) -> (harm : Harmony) -> (ak : Str) -> N ; -- Noun with unpredictable vowel harmony and plural allomorph } ; --2 Adjectives @@ -93,13 +99,28 @@ oper -- The definitions should not bother the user of the API. So they are -- hidden from the document. + Harmony : Type = ResHun.Harm ; + harmA = ResHun.H_a ; + harmE = ResHun.H_e ; + harmO = ResHun.H_o ; + mkN = overload { - mkN : Str -> N = \s -> lin N (mkNoun s) ; + mkN : Str -> N = + \s -> lin N (regNoun s) ; + + mkN : Str -> Str -> N = + \s,ak -> lin N (mkNounHarm (getHarm s) ak s) ; + + mkN : Str -> Harmony -> N = + \s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ; + + mkN : Str -> (plural : Str) -> Harmony -> N = + \s,pl,h -> lin N (mkNounHarm h pl s) ; } ; mkN2 = overload { - mkN2 : Str -> N2 = \s -> lin N2 (mkNoun s) ; + mkN2 : Str -> N2 = \s -> lin N2 (regNoun s) ; mkN2 : N -> N2 = \n -> lin N2 n ; } ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 7ffe3b70b..c50686335 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -3,14 +3,6 @@ resource ParamHun = ParamX ** open Prelude in { -------------------------------------------------------------------------------- -- Phonology -oper - v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | - "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; - - -- not used yet - vowFinal : Str -> Bool = \str -> - case str of {_ + #v => True ; _ => False} ; - -------------------------------------------------------------------------------- -- Morphophonology @@ -31,7 +23,6 @@ param -- | Tem -- Temporal, e.g. hatkor ‘six o’clock’ (from hat ‘6’) ; - Harm = H_a | H_e | H_o ; SubjCase = SCNom | SCDat ; -- Limited set of subject cases diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index c48a4d5db..d9790d57d 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -5,71 +5,15 @@ -- This module contains operations that are needed to make the -- resource syntax work. -- Some parameters, such as $Number$, are inherited from $ParamX$. -resource ResHun = ParamHun ** open Prelude, Predef, ParamHun in { +resource ResHun = NounMorphoHun ** open Prelude, Predef in { -------------------------------------------------------------------------------- --- Nouns -oper - Noun = {s : Number => Case => Str} ; - - endCase : 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" ; - Ins => harm "al" "el" ; - Cau => harm1 "ért" ; - Tra => harm "á" "é" -- TODO consonant assimilation - -- Ess => harm "stul" "stül" ; - -- Ter => harm1 "ig" ; - -- For => harm1 "ként" ; - -- Tem => harm1 "kor" - } ; - - endNumber : Number -> HarmForms = \n -> case n of { - Sg => harm1 [] ; - Pl => harm3 "ok" "ek" "ök" -- TODO: vowel assimilation - } ; - - harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> ; - harm : Str -> Str -> HarmForms = \a,e -> harm3 a e e ; - harm1 : Str -> HarmForms = \i -> harm i i ; - - getHarm : Str -> Harm = \s -> case s of { - _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; - _ + ("ö" | "ő" | "ü") + _ => H_o ; - _ => H_e - } ; - - HarmForms : Type = Str * Str * Str ; - - useHarm : Harm -> HarmForms -> Str = \h,ss -> case h of { - H_a => ss.p1 ; - H_e => ss.p2 ; - H_o => ss.p3 - } ; - - putHarmEnding : HarmForms -> Str -> Str = \hs,w -> - w + useHarm (getHarm w) hs ; - - mkNoun : Str -> Noun = \w -> { - s = \\n,c => - let h = getHarm w - in - w + useHarm h (endNumber n) + useHarm h (endCase c) - } ; - ---------------------------------------------- -- NP +-- Noun morphology is in NounMorphoHun + +oper + NounPhrase : Type = { s : Case => Str ; agr : Person*Number ; @@ -90,8 +34,7 @@ oper -- Pronouns Pronoun : Type = NounPhrase ** { - -- poss : { -- for PossPron : Pron -> Quant - -- } ; + --poss : Str ; -- for PossPron : Pron -> Quant } ; -------------------------------------------------------------------------------- @@ -165,8 +108,10 @@ oper mkAdj : Str -> Adjective = \sg -> { s = \\n => - let h = getHarm sg - in sg + useHarm h (endNumber n) + let plural = case n of { + Sg => [] ; + Pl => pluralAllomorph sg } + in sg + plural } ; -------------------------------------------------------------------------------- @@ -201,12 +146,12 @@ oper mkVerb : (sg3 : Str) -> Verb = mkVerbReg "TODO:infinitive" ; -- TODO mkVerbReg : (inf, sg3 : Str) -> Verb = \inf,sg3 -> - let harmony : Harm = getHarm sg3 ; - sg1 : Str = sg3 + useHarm harmony (verbEndings!) ; + let h : Harm = getHarm sg3 ; + sg1 : Str = sg3 + verbEndings ! ! h ; sg2 : Str = sg3 + "sz" ; - pl1 : Str = sg3 + useHarm harmony (verbEndings!) ; - pl2 : Str = sg3 + useHarm harmony (verbEndings!) ; - pl3 : Str = sg3 + useHarm harmony (verbEndings!) ; + pl1 : Str = sg3 + (verbEndings!) ! h ; + pl2 : Str = sg3 + (verbEndings!) ! h; + pl3 : Str = sg3 + (verbEndings!) ! h; in mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf ; mkVerbFull : (x1,_,_,_,_,_,x7 : Str) -> Verb = diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 3e1508551..945a18ba1 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -128,6 +128,7 @@ lin under_Prep = mkPrep "alatt" ; nonExist ; -- Translative agr = ; isPron = True ; + poss = "em" ; } ; youPol_Pron, youSg_Pron = emptyNP ** { @@ -140,6 +141,7 @@ lin under_Prep = mkPrep "alatt" ; nonExist ; -- Translative agr = ; isPron = True ; + poss = "d" ; } ; he_Pron, she_Pron = emptyNP ** { From cdb76557413deab86c01be01e59f2caa96411b47 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 30 Mar 2020 21:55:45 +0200 Subject: [PATCH 21/97] small typofix --- src/hungarian/NounMorphoHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 21861e4c7..a6b8b1aba 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -43,7 +43,7 @@ oper } ; -- TODO: actual paradigm - dSör : Str -> Noun -> \sör -> + dSör : Str -> Noun = \sör -> let foo : Str = "foo" ; in mkNoun sör ; From 91f7e2e0e8743b41058fcbcafdeb7724fbb52b49 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Tue, 31 Mar 2020 12:26:33 +0200 Subject: [PATCH 22/97] =?UTF-8?q?Added=20l=C3=B3=20and=20k=C5=91=20cases?= =?UTF-8?q?=20(lovak,=20k=C3=B6vek)=20but=20not=20done=20yet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/LexiconHun.gf | 4 ++-- src/hungarian/NounMorphoHun.gf | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 3f3c4f248..75d77f7ea 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -174,7 +174,7 @@ lin fly_V = mkV "repül" ; -- lin hold_V2 = mkV2 "" ; -- lin hope_VS = mkV "" ; -- lin horn_N = mkN "" ; --- lin horse_N = mkN "" ; +lin horse_N = mkN "ló" ; -- lin hot_A = mkA "" ; lin house_N = mkN "ház" ; -- lin hunt_V2 = mkV2 "" ; @@ -342,7 +342,7 @@ lin red_A = mkA "piros" ; -- lin star_N = mkN "" ; -- lin steel_N = mkN "" ; -- lin stick_N = mkN "" ; --- lin stone_N = mkN "" ; +lin stone_N = mkN "kő" ; -- lin stop_V = mkV "" ; -- lin stove_N = mkN "" ; -- lin straight_A = mkA "" ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index a6b8b1aba..d5173ecf1 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -47,6 +47,25 @@ oper let foo : Str = "foo" ; in mkNoun sör ; + --Handles words like "ló, kő" which are "lovak, kövek" in plural + --TODO: not fixed, right now "lovok" and "kövök" + dLó : Str -> Noun = \ló -> + let lo = shorten ló ; + lov = lo + "v" ; + nLov = mkNoun lov ; + nLó = mkNoun ló ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc 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 + + } ; + } ; + + -- More words not covered by current paradigms: -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf -- falu ~ falva-k @@ -161,7 +180,7 @@ oper _ => endCaseCons c } ; - -- Function to return a plural allomorph given the stem (e.g. nev, almá). + -- Function to return a plural allomorph given the stem (e.g. név, almá). pluralAllomorph : (stem : Str) -> Str = \stem -> case vowFinal stem of { True => "k" ; From 29e46f29cff8bde547a895a307ceb52977dc0396 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Tue, 31 Mar 2020 20:07:56 +0200 Subject: [PATCH 23/97] =?UTF-8?q?Improvements=20in=20l=C3=B3=20case,=20sti?= =?UTF-8?q?ll=20problematic=20for=20k=C5=91=20though?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/NounMorphoHun.gf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index d5173ecf1..93ca735d5 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -48,15 +48,20 @@ oper in mkNoun sör ; --Handles words like "ló, kő" which are "lovak, kövek" in plural - --TODO: not fixed, right now "lovok" and "kövök" + --TODO: "kövek" irregular? "kövekhöz" should be "kövekhez", but "kőhöz" is correct... dLó : Str -> Noun = \ló -> let lo = shorten ló ; lov = lo + "v" ; - nLov = mkNoun lov ; + a : Str = case ló of { + _ + ("ö" | "ő") => "e" ; + _ + ("o" | "ó") => "a" } ; + lova = lov + a ; + nLova = mkNoun lova ; nLó = mkNoun ló ; in {s = \\n,c => case of { + -- All plural forms and Sg Acc use the "lov" stem - | => nLov.s ! n ! c ; + | => nLova.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "ló" as the stem. From 5255a773f0e51873ed727f63a373bf112c5c5dce Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Tue, 31 Mar 2020 21:14:50 +0200 Subject: [PATCH 24/97] Added majom (gyomor case, but realised problems in the case --- src/hungarian/NounMorphoHun.gf | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 93ca735d5..4006db6b9 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -49,6 +49,7 @@ oper --Handles words like "ló, kő" which are "lovak, kövek" in plural --TODO: "kövek" irregular? "kövekhöz" should be "kövekhez", but "kőhöz" is correct... + -- similar problem to below... dLó : Str -> Noun = \ló -> let lo = shorten ló ; lov = lo + "v" ; @@ -60,7 +61,7 @@ oper nLó = mkNoun ló ; in {s = \\n,c => case of { - -- All plural forms and Sg Acc use the "lov" stem + -- All plural forms and Sg Acc use the "lova" stem | => nLova.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, @@ -70,12 +71,30 @@ oper } ; } ; + --Handles words like "gyomor, majom, retek" which are "sátrat, gyomrot, majmot, retket" in plural (wovel dropping base) + --TODO: "gyomor, majom" needs fixing in the case => + -- "gyomrokat, majmokat" instead of "gyomrokot,majmokot" (however in it should be "ot") + -- This is a recurring problem with H_a harmony, since sometimes "at" is used instead of "ot" + dMajom : Str -> Noun = \majom -> + let mo = last majom + last (init majom); + maj = init (init majom) ; + majmo = maj + mo ; + nMajmo = mkNoun majmo ; + nMajom = mkNoun majom ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc 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 + } ; + } ; -- More words not covered by current paradigms: -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf -- falu ~ falva-k - -- gyomor ~ gyomr-ot - -- sátor ~ satr-at + -- sátor ~ sátrak -- 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, @@ -154,7 +173,7 @@ oper -- 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" ; + Acc => harm3 "ot" "et" "öt" ; --TODO: does not take care of "at" case (in plural) Dat => harm "nak" "nek" ; Ill => harm "ba" "be" ; Ine => harm "ban" "ben" ; From 8648902d4ed4a052ea92ef7cb478fe4372d6b35d Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 4 Apr 2020 17:05:39 +0200 Subject: [PATCH 25/97] Majom case fixed with special case --- src/hungarian/NounMorphoHun.gf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 4006db6b9..6ef46cacd 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -49,7 +49,6 @@ oper --Handles words like "ló, kő" which are "lovak, kövek" in plural --TODO: "kövek" irregular? "kövekhöz" should be "kövekhez", but "kőhöz" is correct... - -- similar problem to below... dLó : Str -> Noun = \ló -> let lo = shorten ló ; lov = lo + "v" ; @@ -72,9 +71,6 @@ oper } ; --Handles words like "gyomor, majom, retek" which are "sátrat, gyomrot, majmot, retket" in plural (wovel dropping base) - --TODO: "gyomor, majom" needs fixing in the case => - -- "gyomrokat, majmokat" instead of "gyomrokot,majmokot" (however in it should be "ot") - -- This is a recurring problem with H_a harmony, since sometimes "at" is used instead of "ot" dMajom : Str -> Noun = \majom -> let mo = last majom + last (init majom); maj = init (init majom) ; @@ -82,13 +78,15 @@ oper nMajmo = mkNoun majmo ; nMajom = mkNoun majom ; in {s = \\n,c => case of { + => majmo + "kat" ; --Special case + -- All plural forms and Sg Acc use the "majmo" stem - | => nMajmo.s ! n ! c ; + | => nMajmo.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "majom" as the stem. _ => nMajom.s ! n ! c - } ; + } ; } ; -- More words not covered by current paradigms: From 2bb785a54f7146559496c4cf406b2950feeac1bc Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 4 Apr 2020 21:19:23 +0200 Subject: [PATCH 26/97] (Hun) Change word order to SVO --- src/hungarian/ResHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index d9790d57d..f610740f4 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -231,9 +231,9 @@ oper SCDat => Dat } in np.s ! subjcase ++ np.empty -- standard trick for prodrop + ++ vp.s ! agr2vf np.agr ++ vp.obj ++ vp.adv - ++ vp.s ! agr2vf np.agr } ; -------------------------------------------------------------------------------- From c486fd8367299d84382f523be6fe6ea0d168cbe2 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 4 Apr 2020 21:33:32 +0200 Subject: [PATCH 27/97] =?UTF-8?q?(Hun)=20in=20dL=C3=B3:=20force=20E-harmon?= =?UTF-8?q?y=20in=20plural,=20if=20stem=20has=20front=20vowels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/NounMorphoHun.gf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 6ef46cacd..1e5ab277b 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -55,8 +55,11 @@ oper a : Str = case ló of { _ + ("ö" | "ő") => "e" ; _ + ("o" | "ó") => "a" } ; + harmonyPlural : Harm = case ló of { + _ + ("ö" | "ő") => H_e ; -- All plural allomorphs have E harmony, singular ones have O. + _ + ("o" | "ó") => H_a } ; lova = lov + a ; - nLova = mkNoun lova ; + nLova = mkNounHarm harmonyPlural "k" lova ; nLó = mkNoun ló ; in {s = \\n,c => case of { From 1f9ac2c35da813ee0835e4fb54808fe41923c610 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 4 Apr 2020 21:35:24 +0200 Subject: [PATCH 28/97] (Hun) Force -at for accusative if plural morpheme is -ak --- src/hungarian/NounMorphoHun.gf | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 1e5ab277b..ab828d7e0 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -194,6 +194,12 @@ oper -- 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 of case forms when the noun stem ends in vowel. endCaseVow : Case -> HarmForms = \c -> case c of { Acc => harm1 "t" ; @@ -219,10 +225,12 @@ oper -- Harmony and plural allomorph given explicitly mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = \h,plural,w -> - let endCase : Case -> HarmForms = case vowFinal w of { - True => endCaseVow ; - False => endCaseCons } ; - + let endCaseSg : Case -> HarmForms = case vowFinal w of { + True => endCaseVow ; + False => endCaseCons } ; + endCasePl : Case -> HarmForms = case plural of { + "ak" => endCaseConsAccAt ; -- TODO check + _ => endCaseCons } ; -- Last consonant doubles before instrumental and translative lastCons : Str = case vowFinal w of { True => [] ; @@ -232,16 +240,16 @@ oper in {s = table { Sg => table { -- Double the last letter (if consonant) before Ins, Tra - c@(Ins|Tra) => w + lastCons + endCase c ! h ; - c@_ => w + endCase c ! h } ; + c@(Ins|Tra) => w + lastCons + endCaseSg c ! h ; + c@_ => w + endCaseSg c ! h } ; Pl => table { -- Double the plural k before Ins, Tra - c@(Ins|Tra) => w + plural + "k" + endCaseCons c ! h ; + 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 + endCaseCons c ! h } + c@_ => w + plural + endCasePl c ! h } } } ; From 684cec4c34b5de7ecd9478889b1d0d11a4caa4dd Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 4 Apr 2020 21:37:05 +0200 Subject: [PATCH 29/97] =?UTF-8?q?(Hun)=20Add=20dL=C3=B3=20to=20smart=20par?= =?UTF-8?q?adigm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/NounMorphoHun.gf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index ab828d7e0..098f84ff5 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -101,8 +101,9 @@ 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 ; + _ + "a"|"e" => dAlma sgnom ; _ + ("á"|"é") + ? => dMadár sgnom ; + _ + ("ó"|"ő") => dLó sgnom ; -- TODO: more non-smart paradigms + more pattern matching -- TODO: smart paradigms with >1 form. Which forms are the most descriptive? From a686746645e633d33e07711f5932141b313fe8d2 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 4 Apr 2020 21:37:29 +0200 Subject: [PATCH 30/97] (Hun) More words --- src/hungarian/LexiconHun.gf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 75d77f7ea..1b63fd601 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -28,7 +28,7 @@ lin apple_N = mkN "alma" ; -- lin become_VA = mkVA "" ; lin beer_N = mkN "sör" ; -- lin beg_V2V = mkV2 "" ; --- lin belly_N = mkN "" ; +lin belly_N = mkN "has" ; -- lin big_A = mkA "" ; -- lin bike_N = mkN "" ; lin bird_N = mkN "madár" ; @@ -305,7 +305,7 @@ lin red_A = mkA "piros" ; -- lin science_N = mkN "" ; -- lin scratch_V2 = mkV2 "" ; -- lin sea_N = mkN "" ; --- lin see_V2 = mkV2 "" ; +lin see_V2 = mkV2 "lát" ; -- lin seed_N = mkN "" ; -- lin seek_V2 = mkV2 "" ; -- lin sell_V3 = mkV3 "" ; @@ -342,7 +342,7 @@ lin red_A = mkA "piros" ; -- lin star_N = mkN "" ; -- lin steel_N = mkN "" ; -- lin stick_N = mkN "" ; -lin stone_N = mkN "kő" ; +lin stone_N = mkN "kő"; -- lin stop_V = mkV "" ; -- lin stove_N = mkN "" ; -- lin straight_A = mkA "" ; @@ -383,7 +383,7 @@ lin today_Adv = mkAdv "ma" ; -- lin uncertain_A = mkA "" ; -- lin understand_V2 = mkV2 "" ; -- lin university_N = mkN "" ; --- lin village_N = mkN "" ; +lin village_N = mkN "falu" ; -- lin vomit_V = mkV2 "" ; -------- @@ -406,7 +406,7 @@ lin today_Adv = mkAdv "ma" ; -- lin wine_N = mkN "" ; -- lin wing_N = mkN "" ; -- lin wipe_V2 = mkV2 "" ; -lin woman_N = mkN "nő" ; +lin woman_N = mkN "nő" "k" harmO ; -- lin wonder_VQ = mkVQ "" ; -- lin wood_N = mkN "" ; -- lin worm_N = mkN "" ; From 5564ba42ee5c79622630cf9082a895fdd3b8bd3e Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 4 Apr 2020 21:39:38 +0200 Subject: [PATCH 31/97] (Hun) New unit tests --- src/hungarian/unittest/inflection.gftest | 144 ++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 0a75c35b5..79521daaa 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -13,7 +13,7 @@ LangHun: a sörben Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) LangEng: on the beer -LangHun: a sörön +LangHun: a sörnél # Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) # LangEng: of the beer @@ -38,7 +38,18 @@ LangHun: a sörökhöz Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) LangHun: a sörök alatt + +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átok a sörö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átok a sörököt + + -- 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 @@ -74,6 +85,13 @@ 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átok a nő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átok a nőköt -- Apple Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) @@ -111,6 +129,15 @@ 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átok 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átok az almákat + -- Bird Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) LangEng: under the bird @@ -147,6 +174,14 @@ 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átok 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átok a madarakat + -- Name Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) LangEng: under the name @@ -183,6 +218,15 @@ 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átok 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átok a neveket + -- Man Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) LangEng: under the man @@ -218,3 +262,101 @@ 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átok 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átok 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átok 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átok 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átok 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átok a köveket From 0cba0fe07cc3ebd2c15388e2200b640b15308dcb Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Tue, 7 Apr 2020 20:16:27 +0200 Subject: [PATCH 32/97] Updated test file + lexicon words --- src/hungarian/LexiconHun.gf | 58 ++++++++++++------------ src/hungarian/NounMorphoHun.gf | 5 +- src/hungarian/unittest/inflection.gftest | 36 ++++++++------- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 1b63fd601..e90149e33 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -9,20 +9,20 @@ concrete LexiconHun of Lexicon = CatHun ** -- lin alas_Interj = mkInterj "" ; -- lin already_Adv = mkA "" ; -- lin animal_N = mkN "" ; --- lin answer_V2S = mkV2S "" ; +lin answer_V2S = mkV2S "válasz" ; -- lin apartment_N = mkN "" ; lin apple_N = mkN "alma" ; --- lin art_N = mkN "" ; +lin art_N = mkN "müvészet" ; -- lin ashes_N = mkN "" ; -- lin ask_V2Q = mkV2 "" ; ---- -- B --- lin baby_N = mkN "" ; +lin baby_N = mkN "bébi" ; -- lin back_N = mkN "" ; -- lin bad_A = mkA "" ; --- lin bank_N = mkN "" ; +lin bank_N = mkN "bank" ; -- lin bark_N = mkN "" ; -- lin beautiful_A = mkA "" ; -- lin become_VA = mkVA "" ; @@ -42,7 +42,7 @@ lin bird_N = mkN "madár" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; -- lin book_N = mkN "" ; --- lin boy_N = mkN "" ; +lin boy_N = mkN "fiú" ; -- lin bread_N = mkN "" ; -- lin break_V2 = mkV2 "" ; -- lin breast_N = mkN "" ; @@ -61,11 +61,11 @@ lin bird_N = mkN "madár" ; -- lin cap_N = mkN "" ; -- lin car_N = mkN "" ; -- lin carpet_N = mkN "" ; --- lin cat_N = mkN "" ; +lin cat_N = mkN "macska" ; -- lin ceiling_N = mkN "" ; -- lin chair_N = mkN "" ; -- lin cheese_N = mkN "" ; --- lin child_N = mkN "" ; +lin child_N = mkN "gyerek" ; -- lin church_N = mkN "" ; lin city_N = mkN "város" ; -- lin clean_A = mkA "" ; @@ -78,7 +78,7 @@ lin city_N = mkN "város" ; -- lin computer_N = mkN "" ; -- lin correct_A = mkA "" ; -- lin count_V2 = mkV2 "" ; --- lin country_N = mkN "" ; +lin country_N = mkN "ország" ; -- lin cousin_N = mkN "" ; -- lin cow_N = mkN "" ; -- lin cut_V2 = mkV2 "" ; @@ -94,7 +94,7 @@ lin city_N = mkN "város" ; -- lin do_V2 = mkV2 do_V ; -- lin doctor_N = mkN "" ; -- lin dog_N = mkN "" ; --- lin door_N = mkN "" ; +lin door_N = mkN "ajtó" ; -- lin drink_V2 = mkV2 "" ; -- lin dry_A = mkA "" ; -- lin dull_A = mkA "" ; @@ -109,7 +109,7 @@ lin city_N = mkN "város" ; -- lin egg_N = mkN "" ; -- lin empty_A = mkA "" ; -- lin enemy_N = mkN "" ; --- lin eye_N = mkN "" ; +lin eye_N = mkN "szem" ; ---- -- F @@ -126,7 +126,7 @@ lin city_N = mkN "város" ; -- lin find_V2 = mkV2 "" ; -- lin fingernail_N = mkN "" ; -- lin fire_N = mkN "" ; --- lin fish_N = mkN "" ; +lin fish_N = mkN "hal" ; -- lin float_V = mkV "" ; -- lin floor_N = mkN "" ; -- lin flow_V = mkV "" ; @@ -139,19 +139,19 @@ lin fly_V = mkV "repül" ; -- lin freeze_V = mkV "" ; -- lin fridge_N = mkN "" ; -- lin friend_N = mkN "" ; --- lin fruit_N = mkN "" ; +lin fruit_N = mkN "gyümölcs" ; -- lin full_A = mkA "" ; -- --lin fun_AV ---- -- G --- lin garden_N = mkN "" ; --- lin girl_N = mkN "" ; +lin garden_N = mkN "kert" ; +lin girl_N = mkN "lány" ; -- lin give_V3 = mkV3 "" ; -- lin glove_N = mkN "" ; -- lin go_V = mkV "" ; --- lin gold_N = mkN "" ; +lin gold_N = mkN "arany" ; -- lin good_A = mkA "" ; -- lin grammar_N = mkN "" ; -- lin grass_N = mkN "" ; @@ -161,11 +161,11 @@ lin fly_V = mkV "repül" ; -- H -- lin hair_N = mkN "" ; --- lin hand_N = mkN "" ; +lin hand_N = mkN "kéz" ; -- lin harbour_N = mkN "" ; -- lin hat_N = mkN "" ; -- lin hate_V2 = mkV2 "" ; --- lin head_N = mkN "" ; +lin head_N = mkN "fej" ; -- lin hear_V2 = mkV2 "" ; -- lin heart_N = mkN "" ; -- lin heavy_A = mkA "" ; @@ -227,7 +227,7 @@ lin man_N = mkN "férfi" "ak" harmA ; -- force plural allomorph and a-harmony -- lin meat_N = mkN "" ; -- lin milk_N = mkN "" ; -- lin moon_N = mkN "" ; --- lin mother_N2 = mkN2 "" ; +lin mother_N2 = mkN2 "anya" ; -- lin mountain_N = mkN "" ; -- lin mouth_N = mkN "" ; -- lin music_N = mkN "" ; @@ -250,15 +250,15 @@ lin now_Adv = mkAdv "most" ; -- -- O - P -- -- --- lin oil_N = mkN "" ; +lin oil_N = mkN "olaj" ; -- lin old_A = mkA "" ; -- lin open_V2 = mkV2 "" ; -- lin paint_V2A = mkV2A "" ; -- lin paper_N = mkN "" ; -- lin paris_PN = mkPN "Paris" ; --- lin peace_N = mkN "" ; +lin peace_N = mkN "béke" ; -- lin pen_N = mkN "" ; --- lin person_N = mkN "" ; +lin person_N = mkN "ember" ; -- lin planet_N = mkN "" ; -- lin plastic_N = mkN "" ; -- lin play_V = mkV "" ; @@ -272,7 +272,7 @@ lin now_Adv = mkAdv "most" ; -- -- Q - R -- -- lin queen_N = mkN "" ; --- lin question_N = mkN "" ; +lin question_N = mkN "kérdés" ; -- lin radio_N = mkN "" ; -- lin rain_N = mkN "" ; -- lin rain_V0 = mkV "" ; @@ -283,7 +283,7 @@ lin red_A = mkA "piros" ; -- lin religion_N = mkN "" ; -- lin restaurant_N = mkN "" ; -- lin river_N = mkN "" ; --- lin road_N = mkN "" ; +lin road_N = mkN "út" ; -- lin rock_N = mkN "" ; -- lin roof_N = mkN "" ; -- lin root_N = mkN "" ; @@ -315,7 +315,7 @@ lin see_V2 = mkV2 "lát" ; -- lin sheep_N = mkN "" fem ; -- lin ship_N = mkN "" ; -- lin shirt_N = mkN "" ; --- lin shoe_N = mkN "" ; +lin shoe_N = mkN "cipő" ; -- lin shop_N = mkN "" ; -- lin short_A = mkA "" ; -- lin silver_N = mkN "" ; @@ -357,9 +357,9 @@ lin stone_N = mkN "kő"; -- T --- lin table_N = mkN "" ; +lin table_N = mkN "asztal" ; -- lin tail_N = mkN "" ; --- lin talk_V3 = mkV3 "" ; +lin talk_V3 = mkV3 "beszél" ; -- lin teach_V2 = mkV2 "" ; lin teacher_N = mkN "tanár" ; -- lin television_N = mkN "" ; @@ -395,15 +395,15 @@ lin village_N = mkN "falu" ; -- lin warm_A = mkA "" ; -- lin wash_V2 = mkV2 "" ; -- lin watch_V2 = mkV2 "" ; --- lin water_N = mkNoun "" ; +lin water_N = mkNoun "víz" ; -- lin wet_A = mkA "" ; -- lin white_A = mkA "" ; -- lin wide_A = mkA "" ; -- lin wife_N = mkN "" ; -- lin win_V2 = mkV2 "" ; -- lin wind_N = mkN "" ; --- lin window_N = mkN "" ; --- lin wine_N = mkN "" ; +lin window_N = mkN "ablak" ; +lin wine_N = mkN "bor" ; -- lin wing_N = mkN "" ; -- lin wipe_V2 = mkV2 "" ; lin woman_N = mkN "nő" "k" harmO ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 098f84ff5..e06d02946 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -47,8 +47,7 @@ oper let foo : Str = "foo" ; in mkNoun sör ; - --Handles words like "ló, kő" which are "lovak, kövek" in plural - --TODO: "kövek" irregular? "kövekhöz" should be "kövekhez", but "kőhöz" is correct... + --Handles words like "ló, kő" which are "lovak, kövek" in plural. dLó : Str -> Noun = \ló -> let lo = shorten ló ; lov = lo + "v" ; @@ -175,7 +174,7 @@ oper -- 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" ; --TODO: does not take care of "at" case (in plural) + Acc => harm3 "ot" "et" "öt" ; Dat => harm "nak" "nek" ; Ill => harm "ba" "be" ; Ine => harm "ban" "ben" ; diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 79521daaa..741ec01a1 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -38,14 +38,15 @@ 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átok a söröt +LangHun: én látom a söröt +--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átok a sörököt +LangHun: én látom a söröket -- Woman @@ -87,11 +88,12 @@ 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átok a nőt +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átok a nőköt +LangHun: én látom a nőket -- Apple Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) @@ -132,11 +134,11 @@ 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átok az almát +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átok az almákat +LangHun: én látom az almákat -- Bird Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) @@ -176,11 +178,11 @@ 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átok a madarat +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átok a madarakat +LangHun: én látom a madarakat -- Name Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) @@ -221,11 +223,11 @@ 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átok a nevet +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átok a neveket +LangHun: én látom a neveket -- Man Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) @@ -265,11 +267,11 @@ 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átok a férfit +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átok a férfiakat +LangHun: én látom a férfiakat -- Horse @@ -315,11 +317,11 @@ 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átok a lovat +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átok a lovakat +LangHun: én látom a lovakat -- Stone @@ -355,8 +357,8 @@ 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átok a követ +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átok a köveket +LangHun: én látom a köveket From 49ff81a3f4c69ef478dfa7540afcce991279fcd6 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 9 Apr 2020 14:26:45 +0200 Subject: [PATCH 33/97] (Hun) Updated paradigms --- src/hungarian/LexiconHun.gf | 4 ++-- src/hungarian/NounMorphoHun.gf | 20 +++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index e90149e33..6646f1036 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -9,7 +9,7 @@ concrete LexiconHun of Lexicon = CatHun ** -- lin alas_Interj = mkInterj "" ; -- lin already_Adv = mkA "" ; -- lin animal_N = mkN "" ; -lin answer_V2S = mkV2S "válasz" ; +--lin answer_V2S = mkV2S "válasz" ; -- lin apartment_N = mkN "" ; lin apple_N = mkN "alma" ; lin art_N = mkN "müvészet" ; @@ -395,7 +395,7 @@ lin village_N = mkN "falu" ; -- lin warm_A = mkA "" ; -- lin wash_V2 = mkV2 "" ; -- lin watch_V2 = mkV2 "" ; -lin water_N = mkNoun "víz" ; +lin water_N = mkN "víz" ; -- lin wet_A = mkA "" ; -- lin white_A = mkA "" ; -- lin wide_A = mkA "" ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index e06d02946..641f2fd34 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -29,7 +29,7 @@ oper mada = shorten madá ; -- shortens vowels a = last mada ; madara = mada + r + a ; - nMadara = mkNoun madara ; + 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 @@ -42,11 +42,6 @@ oper } ; } ; - -- TODO: actual paradigm - dSör : Str -> Noun = \sör -> - let foo : Str = "foo" ; - in mkNoun sör ; - --Handles words like "ló, kő" which are "lovak, kövek" in plural. dLó : Str -> Noun = \ló -> let lo = shorten ló ; @@ -77,10 +72,10 @@ oper let mo = last majom + last (init majom); maj = init (init majom) ; majmo = maj + mo ; - nMajmo = mkNoun majmo ; + nMajmo = mkNounHarm (getHarm majmo) "k" majmo ; nMajom = mkNoun majom ; in {s = \\n,c => case of { - => majmo + "kat" ; --Special case + -- => majmo + "kat" ; --Special case -- All plural forms and Sg Acc use the "majmo" stem | => nMajmo.s ! n ! c ; @@ -224,12 +219,15 @@ oper mkNounHarm (getHarm w) (pluralAllomorph w) w ; -- Harmony and plural allomorph given explicitly - mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = \h,plural,w -> + 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 vowFinal w of { True => endCaseVow ; False => endCaseCons } ; - endCasePl : Case -> HarmForms = case plural of { - "ak" => endCaseConsAccAt ; -- TODO check + endCasePl : Case -> HarmForms = case of { + <"ak",_> => endCaseConsAccAt ; + <_,True> => endCaseConsAccAt ; _ => endCaseCons } ; -- Last consonant doubles before instrumental and translative lastCons : Str = case vowFinal w of { From 6b0bd749c4231c4e7a50b8d7e9cd7d0d84298835 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Thu, 9 Apr 2020 14:29:58 +0200 Subject: [PATCH 34/97] words --- src/hungarian/LexiconHun.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index e90149e33..0e7cd31fd 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -9,7 +9,7 @@ concrete LexiconHun of Lexicon = CatHun ** -- lin alas_Interj = mkInterj "" ; -- lin already_Adv = mkA "" ; -- lin animal_N = mkN "" ; -lin answer_V2S = mkV2S "válasz" ; +-- lin answer_V2S = mkV2S "válasz" ; -- lin apartment_N = mkN "" ; lin apple_N = mkN "alma" ; lin art_N = mkN "müvészet" ; @@ -395,7 +395,7 @@ lin village_N = mkN "falu" ; -- lin warm_A = mkA "" ; -- lin wash_V2 = mkV2 "" ; -- lin watch_V2 = mkV2 "" ; -lin water_N = mkNoun "víz" ; +lin water_N = mkN "víz" ; -- lin wet_A = mkA "" ; -- lin white_A = mkA "" ; -- lin wide_A = mkA "" ; From 554945cc2e832e55a0e83336b94d4fc9441373b7 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Thu, 9 Apr 2020 15:37:40 +0200 Subject: [PATCH 35/97] Some changes in accusative singular case and thoughts on superessive singular case --- src/hungarian/LexiconHun.gf | 418 +++++++++++++++++++++++++++++++++ src/hungarian/NounMorphoHun.gf | 59 +++-- 2 files changed, 460 insertions(+), 17 deletions(-) create mode 100644 src/hungarian/LexiconHun.gf diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf new file mode 100644 index 000000000..6646f1036 --- /dev/null +++ b/src/hungarian/LexiconHun.gf @@ -0,0 +1,418 @@ +concrete LexiconHun of Lexicon = CatHun ** + open ParadigmsHun, ParamHun, Prelude in { + +---- +-- A + +-- lin add_V3 = mkV3 "" ; +-- lin airplane_N = mkN "" ; +-- lin alas_Interj = mkInterj "" ; +-- lin already_Adv = mkA "" ; +-- lin animal_N = mkN "" ; +--lin answer_V2S = mkV2S "válasz" ; +-- lin apartment_N = mkN "" ; +lin apple_N = mkN "alma" ; +lin art_N = mkN "müvészet" ; +-- lin ashes_N = mkN "" ; +-- lin ask_V2Q = mkV2 "" ; + +---- +-- B + +lin baby_N = mkN "bébi" ; +-- lin back_N = mkN "" ; +-- lin bad_A = mkA "" ; +lin bank_N = mkN "bank" ; +-- lin bark_N = mkN "" ; +-- lin beautiful_A = mkA "" ; +-- lin become_VA = mkVA "" ; +lin beer_N = mkN "sör" ; +-- lin beg_V2V = mkV2 "" ; +lin belly_N = mkN "has" ; +-- lin big_A = mkA "" ; +-- lin bike_N = mkN "" ; +lin bird_N = mkN "madár" ; +-- lin bite_V2 = mkV2 "" ; +-- lin black_A = mkA "" ; +-- lin blood_N = mkN "" ; +-- lin blow_V = mkV "" ; +-- lin blue_A = mkA "" ; +-- lin boat_N = mkN "" ; +-- lin bone_N = mkN "" ; +-- lin boot_N = mkN "" ; +-- lin boss_N = mkN "" ; +-- lin book_N = mkN "" ; +lin boy_N = mkN "fiú" ; +-- lin bread_N = mkN "" ; +-- lin break_V2 = mkV2 "" ; +-- lin breast_N = mkN "" ; +-- lin breathe_V = mkV "" ; +-- lin broad_A = mkA "" ; +-- lin brother_N2 = mkN "" ; +-- lin brown_A = mkA "" ; +-- lin burn_V = mkV "" ; +-- lin butter_N = mkN "" ; +-- lin buy_V2 = mkV2 "" ; + +---- +-- C + +-- lin camera_N = mkN "" ; +-- lin cap_N = mkN "" ; +-- lin car_N = mkN "" ; +-- lin carpet_N = mkN "" ; +lin cat_N = mkN "macska" ; +-- lin ceiling_N = mkN "" ; +-- lin chair_N = mkN "" ; +-- lin cheese_N = mkN "" ; +lin child_N = mkN "gyerek" ; +-- lin church_N = mkN "" ; +lin city_N = mkN "város" ; +-- lin clean_A = mkA "" ; +-- lin clever_A = mkA "" ; +-- lin close_V2 = mkV2 "" ; +-- lin cloud_N = mkN "" ; +-- lin coat_N = mkN "" ; +-- lin cold_A = mkA "" ; +-- lin come_V = mkV "" ; +-- lin computer_N = mkN "" ; +-- lin correct_A = mkA "" ; +-- lin count_V2 = mkV2 "" ; +lin country_N = mkN "ország" ; +-- lin cousin_N = mkN "" ; +-- lin cow_N = mkN "" ; +-- lin cut_V2 = mkV2 "" ; +-- +-- ---- +-- -- D +-- +-- lin day_N = mkN "" ; +-- 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 door_N = mkN "ajtó" ; +-- lin drink_V2 = mkV2 "" ; +-- lin dry_A = mkA "" ; +-- lin dull_A = mkA "" ; +-- lin dust_N = mkN "" ; + +---- +-- E + +-- lin ear_N = mkN "" ; +-- lin earth_N = mkN "" ; +-- lin eat_V2 = mkV2 "" ; +-- lin egg_N = mkN "" ; +-- lin empty_A = mkA "" ; +-- lin enemy_N = mkN "" ; +lin eye_N = mkN "szem" ; + +---- +-- F + +-- lin factory_N = mkN "" ; +-- lin fall_V = mkV "" ; +-- lin far_Adv = mkA "" ; +-- lin fat_N = mkN "" ; +-- lin father_N2 = mkN2 "" ; +-- lin fear_V2 = mkV2 "" ; +-- lin fear_VS = mkVS "" ; +-- lin feather_N = mkN "" ; +-- lin fight_V2 = mkV2 "" ; +-- lin find_V2 = mkV2 "" ; +-- lin fingernail_N = mkN "" ; +-- lin fire_N = mkN "" ; +lin fish_N = mkN "hal" ; +-- lin float_V = mkV "" ; +-- lin floor_N = mkN "" ; +-- lin flow_V = mkV "" ; +-- lin flower_N = mkN "" ; +lin fly_V = mkV "repül" ; +-- lin fog_N = mkN "" ; +-- lin foot_N = mkN "" ; +-- lin forest_N = mkN "" ; +-- lin forget_V2 = mkV2 "" ; +-- lin freeze_V = mkV "" ; +-- lin fridge_N = mkN "" ; +-- lin friend_N = mkN "" ; +lin fruit_N = mkN "gyümölcs" ; +-- lin full_A = mkA "" ; +-- --lin fun_AV + +---- +-- G + +lin garden_N = mkN "kert" ; +lin girl_N = mkN "lány" ; +-- lin give_V3 = mkV3 "" ; +-- lin glove_N = mkN "" ; +-- 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 "" ; + +---- +-- H + +-- lin hair_N = mkN "" ; +lin hand_N = mkN "kéz" ; +-- lin harbour_N = mkN "" ; +-- lin hat_N = mkN "" ; +-- lin hate_V2 = mkV2 "" ; +lin head_N = mkN "fej" ; +-- lin hear_V2 = mkV2 "" ; +-- lin heart_N = mkN "" ; +-- lin heavy_A = mkA "" ; +-- 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 house_N = mkN "ház" ; +-- lin hunt_V2 = mkV2 "" ; +-- lin husband_N = mkN "" ; + +-------- +-- I - K + +-- lin ice_N = mkN "" ; +-- lin industry_N = mkN "" ; +-- lin iron_N = mkN "" ; +-- lin john_PN = mkPN "" ; +-- lin jump_V = mkV "" ; +-- lin kill_V2 = mkV2 "" ; +-- lin king_N = mkN "" ; +-- lin knee_N = mkN "" ; +-- lin know_V2 = mkV2 "" ; +-- lin know_VQ = mkVQ "" ; +-- lin know_VS = mkV "" ; + + +---- +-- L + +-- lin lake_N = mkN "" ; +-- lin lamp_N = mkN "" ; +-- lin language_N = mkN "" ; +-- lin laugh_V = mkV "" ; +-- lin leaf_N = mkN "" ; +-- lin learn_V2 = mkV2 "" ; +-- lin leather_N = mkN "" ; +-- lin leave_V2 = mkV2 "" ; +-- lin leg_N = mkN "" ; +-- lin lie_V = mkV "" ; +-- lin like_V2 = mkV2 "" ; +-- lin listen_V2 = mkV2 "" ; +-- lin live_V = mkV ""; +-- lin liver_N = mkN "" ; +-- lin long_A = mkA "" ; +-- lin lose_V2 = mkV2 "" ; +-- lin louse_N = mkN "" ; +-- lin love_N = mkN "" ; +-- lin love_V2 = mkV2 "" ; + +---- +-- M + +lin man_N = mkN "férfi" "ak" harmA ; -- force plural allomorph and a-harmony +-- lin married_A2 = mkA "" ; +-- lin meat_N = mkN "" ; +-- lin milk_N = mkN "" ; +-- lin moon_N = mkN "" ; +lin mother_N2 = mkN2 "anya" ; +-- lin mountain_N = mkN "" ; +-- lin mouth_N = mkN "" ; +-- lin music_N = mkN "" ; + +---- +-- 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 now_Adv = mkAdv "most" ; +-- lin number_N = mkN "" ; +-- +-- -------- +-- -- O - P +-- +-- +lin oil_N = mkN "olaj" ; +-- lin old_A = mkA "" ; +-- lin open_V2 = mkV2 "" ; +-- lin paint_V2A = mkV2A "" ; +-- lin paper_N = mkN "" ; +-- lin paris_PN = mkPN "Paris" ; +lin peace_N = mkN "béke" ; +-- lin pen_N = mkN "" ; +lin person_N = mkN "ember" ; +-- lin planet_N = mkN "" ; +-- lin plastic_N = mkN "" ; +-- lin play_V = mkV "" ; +-- lin policeman_N = mkN "" ; +-- lin priest_N = mkN "" ; +-- lin pull_V2 = mkV2 "" ; +-- lin push_V2 = mkV2 "" ; +-- lin put_V2 = mkV2 "" ; +-- +-- -------- +-- -- Q - R +-- +-- lin queen_N = mkN "" ; +lin question_N = mkN "kérdés" ; +-- lin radio_N = mkN "" ; +-- lin rain_N = mkN "" ; +-- lin rain_V0 = mkV "" ; +-- lin read_V2 = mkV2 "" ; +-- lin ready_A = mkA "" ; +-- lin reason_N = mkN "" ; +lin red_A = mkA "piros" ; +-- lin religion_N = mkN "" ; +-- lin restaurant_N = mkN "" ; +-- lin river_N = mkN "" ; +lin road_N = mkN "út" ; +-- lin rock_N = mkN "" ; +-- lin roof_N = mkN "" ; +-- lin root_N = mkN "" ; +-- lin rope_N = mkN "" ; +-- lin rotten_A = mkA "" ; +-- lin round_A = mkA "" ; +-- lin rub_V2 = mkV2 "" ; +-- lin rubber_N = mkN "" ; +-- lin rule_N = mkN "" ; +-- lin run_V = mkV "" ; + +---- +-- S + +-- lin salt_N = mkN "" ; +-- lin sand_N = mkN "" ; +-- lin say_VS = mkVS "" ; +-- lin school_N = mkN "" ; +-- lin science_N = mkN "" ; +-- lin scratch_V2 = mkV2 "" ; +-- lin sea_N = mkN "" ; +lin see_V2 = mkV2 "lát" ; +-- lin seed_N = mkN "" ; +-- lin seek_V2 = mkV2 "" ; +-- lin sell_V3 = mkV3 "" ; +-- lin send_V3 = mkV3 "" ; +-- lin sew_V = mkV "" ; +-- lin sharp_A = mkA "" ; +-- lin sheep_N = mkN "" fem ; +-- lin ship_N = mkN "" ; +-- lin shirt_N = mkN "" ; +lin shoe_N = mkN "cipő" ; +-- lin shop_N = mkN "" ; +-- lin short_A = mkA "" ; +-- lin silver_N = mkN "" ; +-- lin sing_V = mkV "" ; +-- lin sister_N = mkN "" ; +-- lin sit_V = mkV "" ; +-- lin skin_N = mkN "" ; +-- lin sky_N = mkN "" ; +-- lin sleep_V = mkV "" ; +-- lin small_A = mkA "" ; +-- 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 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 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 suck_V2 = mkV2 "" ; +-- lin sun_N = mkN "" ; +-- lin swell_V = mkV "" ; +-- lin swim_V = mkV "" ; + +---- +-- T + + +lin table_N = mkN "asztal" ; +-- lin tail_N = mkN "" ; +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 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 travel_V = mkV "" ; +-- lin tree_N = mkN "" ; +-- lin turn_V = mkV "" ; + +-------- +-- U - V + +-- lin ugly_A = mkA "" ; +-- lin uncertain_A = mkA "" ; +-- lin understand_V2 = mkV2 "" ; +-- lin university_N = mkN "" ; +lin village_N = mkN "falu" ; +-- lin vomit_V = mkV2 "" ; + +-------- +-- W - Y + +-- lin wait_V2 = mkV2 "" ; +-- lin walk_V = mkV "" ; +-- lin war_N = mkN "" ; +-- lin warm_A = mkA "" ; +-- 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 win_V2 = mkV2 "" ; +-- lin wind_N = mkN "" ; +lin window_N = mkN "ablak" ; +lin wine_N = mkN "bor" ; +-- lin wing_N = mkN "" ; +-- lin wipe_V2 = mkV2 "" ; +lin woman_N = mkN "nő" "k" harmO ; +-- lin wonder_VQ = mkVQ "" ; +-- lin wood_N = mkN "" ; +-- lin worm_N = mkN "" ; +-- lin write_V2 = mkV2 "" ; +-- lin year_N = mkN "" ; +-- lin yellow_A = mkA "" ; +-- lin young_A = mkA "" ; + +} diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 641f2fd34..01641f8c3 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -22,7 +22,7 @@ oper } ; } ; - -- Handles words like "madár", "név" with shortened stem vowel in plural + -- Handles words like "madár, nyár, név" with shortened stem vowel in plural dMadár : Str -> Noun = \madár -> let r = last madár ; madá = init madár ; @@ -42,23 +42,26 @@ oper } ; } ; - --Handles words like "ló, kő" which are "lovak, kövek" in plural. + --Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. + --TODO: "lovon" instead of "lón" + --TODO: special case "lén" not "leven", maybe just put the case in specific words, many special cases... dLó : Str -> Noun = \ló -> let lo = shorten ló ; lov = lo + "v" ; - a : Str = case ló of { - _ + ("ö" | "ő") => "e" ; - _ + ("o" | "ó") => "a" } ; + 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 } ; - lova = lov + a ; - nLova = mkNounHarm harmonyPlural "k" lova ; + _ + ("o" | "ó") => H_a ; + lé => getHarm (lé)} ; + nLov = mkNounHarmAcc True harmonyPlural ak lov ; nLó = mkNoun ló ; in {s = \\n,c => case of { - -- All plural forms and Sg Acc use the "lova" stem - | => nLova.s ! n ! c ; + -- 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. @@ -67,7 +70,28 @@ oper } ; } ; - --Handles words like "gyomor, majom, retek" which are "sátrat, gyomrot, majmot, retket" in plural (wovel dropping base) + --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) + --TODO: "tavon" instead of "tón" + --TODO: szó special case which fulfills this but not the or case + dTó : Str -> Noun = \tó -> + let t = init tó ; + tav = t + "av" ; + nTav = mkNounHarmAcc True H_a "ak" tav ; + nTó = mkNoun tó ; + in {s = \\n,c => case of { + + -- All plural forms and Sg Acc use the "tava" 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, eper" which are "gyomrot, majmot, retket, epret" in plural (wovel dropping base) dMajom : Str -> Noun = \majom -> let mo = last majom + last (init majom); maj = init (init majom) ; @@ -77,8 +101,8 @@ oper in {s = \\n,c => case of { -- => majmo + "kat" ; --Special case - -- All plural forms and Sg Acc use the "majmo" stem - | => nMajmo.s ! n ! c ; + -- 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. @@ -218,13 +242,14 @@ oper mkNoun : Str -> Noun = \w -> mkNounHarm (getHarm w) (pluralAllomorph w) w ; - -- Harmony and plural allomorph given explicitly + -- 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 vowFinal w of { - True => endCaseVow ; - False => endCaseCons } ; + let endCaseSg : Case -> HarmForms = case of { + => endCaseVow ; + => endCaseConsAccAt ; + _ => endCaseCons} ; endCasePl : Case -> HarmForms = case of { <"ak",_> => endCaseConsAccAt ; <_,True> => endCaseConsAccAt ; From 4ed862617c67f4d4e0b7a4861dd06f41aa4fb150 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Thu, 9 Apr 2020 19:31:07 +0200 Subject: [PATCH 36/97] =?UTF-8?q?Checked=20Sup=20case=20and=20started=20wi?= =?UTF-8?q?th=20s=C3=A1tor=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/NounMorphoHun.gf | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 01641f8c3..ec0f22278 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -23,6 +23,7 @@ oper } ; -- Handles words like "madár, nyár, név" 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 ; @@ -43,8 +44,9 @@ oper } ; --Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. - --TODO: "lovon" instead of "lón" - --TODO: special case "lén" not "leven", maybe just put the case in specific words, many special cases... + -- "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" ; @@ -72,8 +74,8 @@ 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) - --TODO: "tavon" instead of "tón" - --TODO: szó special case which fulfills this but not the or case + -- "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" ; @@ -81,8 +83,8 @@ oper nTó = mkNoun tó ; in {s = \\n,c => case of { - -- All plural forms and Sg Acc use the "tava" stem - | => nTav.s ! n ! c ; + -- 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. @@ -91,7 +93,10 @@ oper } ; } ; - --Handles words like "gyomor, majom, retek, eper" which are "gyomrot, majmot, retket, epret" in plural (wovel dropping base) + --Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) + --More examples: "bokor, cukor, csokor, eper, fészek, fodor, gödör, 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" -> + -- "bokrot, cukrot, csokrot, epret, fészket, fodrot, gödröt, 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 -> let mo = last majom + last (init majom); maj = init (init majom) ; @@ -99,8 +104,6 @@ oper nMajmo = mkNounHarm (getHarm majmo) "k" majmo ; nMajom = mkNoun majom ; in {s = \\n,c => case of { - -- => majmo + "kat" ; --Special case - -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem | | => nMajmo.s ! n ! c ; @@ -110,6 +113,8 @@ oper } ; } ; + --Handles words like "sátor, ajak, álom, alkalom, farok, halom, haszon, vászon, bátor" + -- More words not covered by current paradigms: -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf -- falu ~ falva-k From 6d9fa598632ae4bb71b5711d36752c939e877453 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 9 Apr 2020 19:54:06 +0200 Subject: [PATCH 37/97] (Hun) Fix partially the case with takony in dMajom --- src/hungarian/NounMorphoHun.gf | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index ec0f22278..1027b4eff 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -98,10 +98,23 @@ oper -- "bokrot, cukrot, csokrot, epret, fészket, fodrot, gödröt, 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 -> - let mo = last majom + last (init majom); - maj = init (init majom) ; - majmo = maj + mo ; - nMajmo = mkNounHarm (getHarm majmo) "k" majmo ; + -- 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 + trigraph@("dzs") => ; + x + digraph@("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") + => ; + -- ? pattern matches exactly 1 character + x + unigraph@? => } ; + 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 From e8a8f4b0c6f5e81a08d94cf8c3b8f74e22afa256 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 9 Apr 2020 20:15:02 +0200 Subject: [PATCH 38/97] (Hun) Put digraphs and trigraphs into a pattern, use them in dMajom --- src/hungarian/NounMorphoHun.gf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 1027b4eff..1ea2a8270 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -103,11 +103,10 @@ oper -- 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 + trigraph@("dzs") => ; - x + digraph@("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") - => ; + x + dzs@#trigraph => ; + x + zs@#digraph => ; -- ? pattern matches exactly 1 character - x + unigraph@? => } ; + x + s@? => } ; tako = tako_ny.p1 ; ny = tako_ny.p2 ; @@ -159,6 +158,11 @@ 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") ; -- Function to test if a string ends in a vowel vowFinal : Str -> Bool = \str -> From 8efb9d562173d555eee58de300877599be67d6b3 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 9 Apr 2020 20:15:53 +0200 Subject: [PATCH 39/97] (Hun) Add function to duplicate last sound --- src/hungarian/NounMorphoHun.gf | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 1ea2a8270..f0ad565b0 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -164,6 +164,22 @@ oper -- Trigraphs trigraph : pattern Str = #("dzs") ; + duplicateLast : Str -> Str = \str -> case str of { + x + "dzs" => x + "ddzs" ; + x + "ny" => x + "nny" ; -- takony : takonnyal + + -- TODO: no idea, just guessing! Check these. + 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@? => s + s } ; + -- Function to test if a string ends in a vowel vowFinal : Str -> Bool = \str -> case str of { @@ -277,15 +293,15 @@ oper <_,True> => endCaseConsAccAt ; _ => endCaseCons } ; -- Last consonant doubles before instrumental and translative - lastCons : Str = case vowFinal w of { - True => [] ; - False => last w } ; + 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) => w + lastCons + endCaseSg c ! h ; + c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; c@_ => w + endCaseSg c ! h } ; Pl => table { From 0f92204dfad15746690111dee087a361f2e60669 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Thu, 9 Apr 2020 21:15:36 +0200 Subject: [PATCH 40/97] Added dFarok + modified regNoun + comment on pluralAllomporph --- src/hungarian/NounMorphoHun.gf | 43 ++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index f0ad565b0..b09c33c68 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -22,7 +22,7 @@ oper } ; } ; - -- Handles words like "madár, nyár, név" with shortened stem vowel in plural + -- 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 ; @@ -58,7 +58,7 @@ oper _ + ("ö" | "ő") => H_e ; -- All plural allomorphs have E harmony, singular ones have O. _ + ("o" | "ó") => H_a ; lé => getHarm (lé)} ; - nLov = mkNounHarmAcc True harmonyPlural ak lov ; + nLov = mkNounHarm harmonyPlural ak lov ; nLó = mkNoun ló ; in {s = \\n,c => case of { @@ -79,7 +79,7 @@ oper dTó : Str -> Noun = \tó -> let t = init tó ; tav = t + "av" ; - nTav = mkNounHarmAcc True H_a "ak" tav ; + nTav = mkNounHarm H_a "ak" tav ; nTó = mkNoun tó ; in {s = \\n,c => case of { @@ -94,8 +94,8 @@ oper } ; --Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) - --More examples: "bokor, cukor, csokor, eper, fészek, fodor, gödör, 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" -> - -- "bokrot, cukrot, csokrot, epret, fészket, fodrot, gödröt, 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" + --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} ; @@ -125,12 +125,29 @@ oper } ; } ; - --Handles words like "sátor, ajak, álom, alkalom, farok, halom, haszon, vászon, bátor" + --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 - -- falu ~ falva-k - -- sátor ~ sátrak + -- 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, @@ -139,6 +156,8 @@ oper _ + "a"|"e" => dAlma sgnom ; _ + ("á"|"é") + ? => dMadár sgnom ; _ + ("ó"|"ő") => dLó 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? @@ -166,9 +185,7 @@ oper duplicateLast : Str -> Str = \str -> case str of { x + "dzs" => x + "ddzs" ; - x + "ny" => x + "nny" ; -- takony : takonnyal - - -- TODO: no idea, just guessing! Check these. + x + "ny" => x + "nny" ; -- takony : takonnyal x + "cs" => x + "ccs" ; x + "dz" => x + "ddz" ; x + "gy" => x + "ggy" ; @@ -178,7 +195,7 @@ oper x + "zs" => x + "zzs" ; -- Base cacse: just duplicate the single letter - x + s@? => s + s } ; + x + s@? => x + s + s } ; -- Function to test if a string ends in a vowel vowFinal : Str -> Bool = \str -> @@ -269,6 +286,8 @@ 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" ; From f6871ec3c6ed306ee2e70af2ec0e3646f2d8c59f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 12 Apr 2020 22:07:53 +0200 Subject: [PATCH 41/97] (Kor) Cleanup in conjunctions --- src/korean/ConjunctionKor.gf | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/korean/ConjunctionKor.gf b/src/korean/ConjunctionKor.gf index 42952fd8c..1aeaa4913 100644 --- a/src/korean/ConjunctionKor.gf +++ b/src/korean/ConjunctionKor.gf @@ -36,43 +36,29 @@ lin ConjAdv, ConjAdV, ConjIAdv = conjSS ; oper - ConjSS : Type = SS ** {firstSS : ConjType => Str} ; + ConjSS : Type = {s : ConjType => Str} ; - baseSS : SS -> SS -> ConjSS = \s1,s2 -> s2 ** { - firstSS = mkFirstSS s1 ; + baseSS : SS -> SS -> ConjSS = \s1,s2 -> { + s = \\conj => glue s1.s (conjTable ! NStar ! conj) ++ s2.s ; } ; consSS : SS -> ConjSS -> ConjSS = \s,ss -> ss ** { - firstSS = \\conj => - mkFirstSS s ! conj ++ ss.firstSS ! conj ; + s = \\conj => glue s.s (conjTable ! NStar ! conj) ++ ss.s ! conj ; } ; conjSS : Conj -> ConjSS -> SS = \co,ss -> { - s = co.s1 ++ ss.firstSS ! co.c ++ ss.s - } ; - --- Versions with commas, no repeated conjunctions - baseSScomma : SS -> SS -> ConjSS = \s1,s2 -> s2 ** { - firstSS = \\conj => s1.s ++ SOFT_BIND ++ "," ; + s = co.s1 ++ ss.s ! co.c } ; + -- Version with commas, no repeated conjunctions! + -- baseSS works for both: always conjunction between penultimate and last. + -- Difference from consSS: conjTable ! NStar ! conj isn't used, only comma. consSScomma : SS -> ConjSS -> ConjSS = \s,ss -> ss ** { - firstSS = \\conj => - s.s ++ SOFT_BIND ++ "," ++ ss.firstSS ! conj ; + s = \\conj => s.s + ++ SOFT_BIND ++ "," -- Don't add conjunction, only comma + ++ ss.s ! conj ; } ; - conjSScomma : Conj -> ConjSS -> SS = \co,ss -> { - s = co.s1 - ++ ss.firstSS ! co.c - ++ co.s2 - ++ ss.s - } ; - -oper - mkFirstSS : SS -> ConjType => Str = \s -> - \\conj => glue s.s (conjTable ! VStar ! conj) ; - - lincat [S], [RS] = ResKor.Sentence ** {firstS : ConjType => Str} ; From 9da533c80975610a8e0387b56f7a555611e720ba Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Apr 2020 17:30:07 +0200 Subject: [PATCH 42/97] (Hun) Add field for NPs whether it's definite --- src/hungarian/ParamHun.gf | 6 +++++- src/hungarian/ResHun.gf | 4 ++-- src/hungarian/StructuralHun.gf | 12 ++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index c50686335..2157c654f 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -76,7 +76,11 @@ oper -- Verbs param - -- TODO: object agreement + -- For object agreement in V2 + ObjDef = + Def + | Indef ; + VForm = VInf | VFin Person Number ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index f610740f4..e3c36cecc 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -17,14 +17,14 @@ oper NounPhrase : Type = { s : Case => Str ; agr : Person*Number ; - isPron : Bool ; + objdef : ObjDef ; empty : Str ; -- standard trick for pro-drop } ; emptyNP : NounPhrase = { s = \\_ => [] ; agr = ; - isPron = False ; + objdef = Indef ; empty = [] ; } ; diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 945a18ba1..50d6f9528 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -127,7 +127,7 @@ lin under_Prep = mkPrep "alatt" ; "velem" -- Instrumental nonExist ; -- Translative agr = ; - isPron = True ; + objdef = Def ; poss = "em" ; } ; youPol_Pron, @@ -140,7 +140,7 @@ lin under_Prep = mkPrep "alatt" ; "veled" -- Instrumental nonExist ; -- Translative agr = ; - isPron = True ; + objdef = Def ; poss = "d" ; } ; he_Pron, @@ -152,7 +152,7 @@ lin under_Prep = mkPrep "alatt" ; "érte" -- Causative "vele" -- Instrumental nonExist ; -- Translative - isPron = True ; + objdef = Def ; } ; we_Pron = emptyNP ** { s = caseTable "mi" "minket" "nekünk" @@ -163,7 +163,7 @@ lin under_Prep = mkPrep "alatt" ; "velünk" -- Instrumental nonExist ; -- Translative agr = ; - isPron = True ; + objdef = Def ; } ; youPl_Pron = emptyNP ** { @@ -175,7 +175,7 @@ lin under_Prep = mkPrep "alatt" ; "veletek" -- Instrumental nonExist ; -- Translative agr = ; - isPron = True ; + objdef = Def ; } ; they_Pron = emptyNP ** { s = caseTable "ők" "őket" "nekik" @@ -186,7 +186,7 @@ lin under_Prep = mkPrep "alatt" ; "velük" -- Instrumental nonExist ; -- Translative agr = ; - isPron = True ; + objdef = Def ; } ; --lin whatPl_IP = ; From 16c808c7b1bef81817f9faf16bf633a069255ebb Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Apr 2020 17:31:27 +0200 Subject: [PATCH 43/97] (Hun) Add a layer of inflection into V2,V3, VPSlash: is object definite? --- src/hungarian/ResHun.gf | 52 +++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index e3c36cecc..1c4baa7d6 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -117,7 +117,19 @@ oper -------------------------------------------------------------------------------- -- Verbs - verbEndings : Person*Number => HarmForms = table { + VerbEndings : Type = Person*Number => HarmForms ; + -- TODO: incomplete + endingsDef : VerbEndings = table { + => harm3 "om" "em" "öm" ; + => harm3 "od" "ed" "öd" ; + => harm "ja" "i" ; + => harm "juk" "jük" ; + => harm "játok" "itek" ; + => harm "ják" "ik" + } ; + + -- by EG 2009, needs more special cases + endingsIndef : VerbEndings = table { => harm3 "ok" "ek" "ök" ; => harm1 "sz" ; => harm1 [] ; @@ -126,11 +138,14 @@ oper => harm "nak" "nek" -- TODO allomorphs -anak, -enek } ; - Verb : Type = { - s : VForm => Str ; + BaseVerb : Type = { sc : SubjCase ; -- subject case + } ; + Verb : Type = BaseVerb ** { + s : VForm => Str ; } ; - Verb2 : Type = Verb ** { + Verb2 : Type = BaseVerb ** { + s : ObjDef => VForm => Str ; c2 : Case -- object case } ; Verb3 : Type = Verb2 ** { @@ -140,18 +155,25 @@ oper mkVerb2 : Str -> Verb2 = \sg3 -> vtov2 (mkVerb sg3) ; mkVerb3 : Str -> Verb3 = \sg3 -> v2tov3 (mkVerb2 sg3) ; - vtov2 : Verb -> Verb2 = \v -> v ** {c2 = Acc} ; + vtov2 : Verb -> Verb2 = \v -> v ** { + s = table { + Def => let vDef : Verb = mkVerbReg endingsDef (v.s ! VInf) (v.s ! VFin P3 Sg) + in vDef.s ; + Indef => v.s } ; + c2 = Acc + } ; v2tov3 : Verb2 -> Verb3 = \v -> v ** {c3 = Dat} ; - mkVerb : (sg3 : Str) -> Verb = mkVerbReg "TODO:infinitive" ; -- TODO + mkVerb : (sg3 : Str) -> Verb = mkVerbReg endingsIndef "TODO:infinitive" ; -- TODO - mkVerbReg : (inf, sg3 : Str) -> Verb = \inf,sg3 -> - let h : Harm = getHarm sg3 ; - sg1 : Str = sg3 + verbEndings ! ! h ; - sg2 : Str = sg3 + "sz" ; - pl1 : Str = sg3 + (verbEndings!) ! h ; - pl2 : Str = sg3 + (verbEndings!) ! h; - pl3 : Str = sg3 + (verbEndings!) ! h; + mkVerbReg : VerbEndings -> (inf, stem : Str) -> Verb = \hf,inf,stem -> + let h : Harm = getHarm stem ; + sg1 : Str = stem + hf ! ! h ; + sg2 : Str = stem + hf ! ! h ; + sg3 : Str = stem + hf ! ! h ; + pl1 : Str = stem + hf ! ! h ; + pl2 : Str = stem + hf ! ! h ; + pl3 : Str = stem + hf ! ! h ; in mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf ; mkVerbFull : (x1,_,_,_,_,_,x7 : Str) -> Verb = @@ -202,8 +224,8 @@ oper -- If verb's subject case is Dat and object Nom, verb agrees with obj. s = \\vf => case of { - => vps.s ! agr2vf np.agr ; - _ => vps.s ! vf } ; + => vps.s ! np.objdef ! agr2vf np.agr ; + _ => vps.s ! np.objdef ! vf } ; } ; insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ; From a7b23107346e401d5dbdce113782677065d52c15 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Apr 2020 17:54:06 +0200 Subject: [PATCH 44/97] (Hun) Add ObjDef into NP, Det and Quant --- src/hungarian/NounHun.gf | 6 ++++-- src/hungarian/ResHun.gf | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 25f77ae6f..905d3d5a6 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -7,7 +7,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { --2 Noun phrases -- : Det -> CN -> NP - DetCN det cn = emptyNP ** { + DetCN det cn = emptyNP ** det ** { s = \\c => det.s ! c ++ cn.s ! det.n ! c ; agr = ; } ; @@ -63,7 +63,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { _ => quant.s ! num.n ! c } ++ num.s ! Attrib ; -- TODO: add inflection table in numbers sp = \\c => quant.sp ! num.n ! c - ++ num.s ! Indep + ++ num.s ! Indep ; } ; -- : Quant -> Num -> Ord -> Det ; -- these five best @@ -120,6 +120,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { s, sp = \\_,_ => pre {"a" ; "az" / v } ; isIndefArt = False ; + objdef = Def ; } ; -- : Quant @@ -127,6 +128,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { s, sp = \\_,_ => "egy" ; isIndefArt = True ; + objdef = Indef ; } ; -- : Pron -> Quant diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 1c4baa7d6..bfbe662a4 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -46,12 +46,14 @@ oper 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 } ; mkQuant : (s,sp : Str) -> Quant = \s,sp -> { s = (mkNoun s).s ; sp = (mkNoun sp).s ; isIndefArt = False ; + objdef = Def ; } ; -- Det is formed in DetQuant : Quant -> Num -> Det @@ -61,6 +63,7 @@ oper 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 } ; Numeral : Type = { From abc3ce59394a273e4252eeec6e2243059faca285 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Apr 2020 19:40:25 +0200 Subject: [PATCH 45/97] (Hun) MassNP, PredetNP, DetNP --- src/hungarian/NounHun.gf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 905d3d5a6..180a38dfa 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -18,13 +18,14 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { -- : Pron -> NP ; UsePron pron = pron ; - {- -- : Predet -> NP -> NP ; -- only the man - PredetNP predet np = np ** {s = } ; + PredetNP predet np = np ** { + s = \\c => predet.s ++ np.s ! c ; + } ; -- A noun phrase can also be postmodified by the past participle of a -- verb, by an adverb, or by a relative clause - +{- -- : NP -> V2 -> NP ; -- the man seen PPartNP np v2 = np ** { @@ -37,7 +38,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { RelNP np rs = np ** {} ; -- Determiners can form noun phrases directly. - +-} -- : Det -> NP ; DetNP det = emptyNP ** { s = det.sp ; @@ -49,7 +50,6 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { s = \\c => cn.s ! Sg ! c ; agr = ; } ; --} --2 Determiners From 3c6f7a2267462a5c26f8c19cd8bca494f99ef7cb Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Apr 2020 19:41:00 +0200 Subject: [PATCH 46/97] (Hun) Add SymbolHun --- src/hungarian/SymbolHun.gf | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/hungarian/SymbolHun.gf b/src/hungarian/SymbolHun.gf index 6c5cadb90..5a645302d 100644 --- a/src/hungarian/SymbolHun.gf +++ b/src/hungarian/SymbolHun.gf @@ -1,7 +1,5 @@ ---# -path=.:../abstract:../common:../prelude - concrete SymbolHun of Symbol = CatHun ** - open Prelude, ParadigmsHun, ResHun, (NS=NounHun) in { + open Prelude, ResHun, (NH=NounHun) in { lin @@ -15,28 +13,37 @@ lin FloatPN i = mkPN i.s ; -- : Card -> PN ; -- twelve [as proper name] - NumPN i = mkPN i.s ; + NumPN i = mkPN (i.s ! Indep) ; + +oper + + mkPN : Str -> NounPhrase = \s -> emptyNP ** { + s = \\_ => s ; + } ; -{- lin --- CNIntNP cn i = {} ; + -- : CN -> Int -> NP + CNIntNP cn i = NH.MassNP (cn ** { + s = \\n,c => cn.s ! n ! c ++ i.s}) ; -- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y CNSymbNP det cn xs = - let cnSymb = cn ** { comp = cn.comp ++ xs.s } - in NS.DetCN det cnSymb ; + let cnSymb : CN = cn ** {s = \\n,c => cn.s ! n ! c ++ xs.s} + in NH.DetCN det cnSymb ; -- : CN -> Card -> NP ; -- level five ; level 5 - CNNumNP cn i = NS.MassNP (cn ** { comp = cn.comp ++ i.s }) ; + CNNumNP cn i = NH.MassNP (cn ** { + s = \\n,c => cn.s ! n ! c ++ i.s ! Indep}) ; -- : Symb -> S ; - SymbS sy = {s = } ; + SymbS sy = sy ; + -- : Symb -> Card ; - SymbNum sy = { s = sy.s ; n = Pl } ; + SymbNum sy = baseNum ** {s = \\_ => sy.s} ; -- : Symb -> Ord ; - SymbOrd sy = { s =} ; --} + SymbOrd sy = {s = sy.s ; n=Pl} ; + lincat Symb, [Symb] = SS ; @@ -46,5 +53,4 @@ lin BaseSymb = infixSS "és" ; ConsSymb = infixSS "," ; - } From 57ad749eccee25db2f59d3d172bbd34eb878abd7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Apr 2020 19:58:26 +0200 Subject: [PATCH 47/97] (Hun) Add Conj{S,NP,AP} + some conjunctions --- src/hungarian/ConjunctionHun.gf | 54 ++++++++++++++------------------- src/hungarian/ResHun.gf | 15 +++++++-- src/hungarian/StructuralHun.gf | 14 ++++----- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index 8c6414aef..7ef00d654 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -23,17 +23,35 @@ concrete ConjunctionHun of Conjunction = ConsAdv = consrSS comma ; ConjAdv = conjunctSS ; - --} + -} -- Adverb and other simple {s : Str} types. lincat - [Adv],[AdV],[IAdv] = {s1,s2 : Str} ; + [Adv],[AdV],[IAdv],[S] = {s1,s2 : Str} ; lin - BaseAdv, BaseAdV, BaseIAdv = twoSS ; - ConsAdv, ConsAdV, ConsIAdv = consrSS comma ; - ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ; + BaseAdv, BaseAdV, BaseIAdv, BaseS = twoSS ; + ConsAdv, ConsAdV, ConsIAdv, ConsS = consrSS comma ; + ConjAdv, ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ; + + +lincat + [AP] = {s1,s2 : Number => Str} ; + +lin + BaseAP = twoTable Number ; + ConsAP = consrTable Number comma ; + ConjAP = conjunctDistrTable Number ; + +-- Noun phrases +lincat + [NP] = ResHun.BaseNP ** {s1,s2 : 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 ; {- -- RS depends on X, Y and Z, otherwise exactly like previous. @@ -46,23 +64,6 @@ lin ConsRS = consrTable … comma ; ConjRS = conjunctDistrTable ; -lincat - [S] = {} ; - -lin - BaseS x y = y ** { } ; - ConsS x xs = - xs ** { } ; - ConjS co xs = {} ; - -lincat - [AP] = {} ; - -lin - BaseAP x y = twoTable … x y ** y ; - ConsAP a as = consrTable … comma as a ** as ; - ConjAP co as = conjunctDistrTable … co as ** as ; - lincat [CN] = { } ; @@ -79,15 +80,6 @@ lin ConsDAP xs x = xs ** ConjDet conj xs = xs ** - --- Noun phrases -lincat - [NP] = - -lin - BaseNP x y = twoTable … x y ** y ; - ConsNP x xs = consrTable … comma as a ** as ; - ConjNP co as = conjunctDistrTable … co as ** as ; -} } diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index bfbe662a4..f80efe02d 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -13,14 +13,16 @@ resource ResHun = NounMorphoHun ** open Prelude, Predef in { -- Noun morphology is in NounMorphoHun oper - - NounPhrase : Type = { - s : Case => Str ; + BaseNP : Type = { agr : Person*Number ; objdef : ObjDef ; empty : Str ; -- standard trick for pro-drop } ; + NounPhrase : Type = BaseNP ** { + s : Case => Str ; + } ; + emptyNP : NounPhrase = { s = \\_ => [] ; agr = ; @@ -104,6 +106,13 @@ oper n : Number ; } ; + mkConj : Str -> Number -> Conj = mkDConj [] ; + + mkDConj : (s1,s2 : Str) -> Number -> Conj = \s1,s2,num -> { + s1 = s1 ; + s2 = s2 ; + n = num ; + } ; -------------------------------------------------------------------------------- -- Adjectives diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 50d6f9528..3e6feb4ae 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -33,16 +33,16 @@ lin somewhere_Adv = ss "" ; lin there7from_Adv = ss "" ; lin there7to_Adv = ss "" ; lin there_Adv = ss "" ; - +-} ------- -- Conj -lin and_Conj = -lin or_Conj = -lin if_then_Conj = -lin both7and_DConj = -lin either7or_DConj = - +lin and_Conj = mkConj "és" Pl ; +lin or_Conj = mkConj "vagy" Sg ; +-- lin if_then_Conj = +-- lin both7and_DConj = +lin either7or_DConj = mkDConj "vagy" "vagy" Sg ; +{- lin but_PConj = ss "" ; lin otherwise_PConj = ss "" ; lin therefore_PConj = ss "" ; From e71c959a0999a4b645035fdc5aa20a94e2a81a54 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Apr 2020 20:57:56 +0200 Subject: [PATCH 48/97] (Hun) WIP: comparative and superlative forms --- src/hungarian/AdjectiveHun.gf | 17 +++++++-------- src/hungarian/CatHun.gf | 2 +- src/hungarian/ResHun.gf | 41 ++++++++++++++++++++++++++++++----- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 484e15d34..19134c2c7 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -5,12 +5,12 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { lin -- : A -> AP ; - PositA a = a ; + PositA a = {s = a.s ! Posit} ; -- : A -> NP -> AP ; - -- ComparA a np = a ** { - -- - -- } ; + ComparA a np = a ** { + s = \\n => a.s ! Compar ! n ++ np.s ! Ade ; + } ; -- : A2 -> NP -> AP ; -- married to her -- ComplA2 a2 np = a2 ** { } ; @@ -19,13 +19,12 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- ReflA2 a2 = a2 ** { } ; -- : A2 -> AP ; -- married - -- UseA2 = PositA ; + UseA2 = PositA ; -- : A -> AP ; -- warmer - -- UseComparA a = a ** { - -- s = \\af => "???" ++ a.s ! af ; - -- compar = [] - -- } ; + UseComparA a = a ** { + s = \\n => a.s ! Compar ! n ; + } ; -- : CAdv -> AP -> NP -> AP ; -- as cool as John diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 743abe55d..a4471e71d 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -46,7 +46,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { -- Constructed in AdjectiveHun. - AP = ResHun.Adjective ; + AP = ResHun.AdjPhrase ; --2 Nouns and noun phrases diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index f80efe02d..b3b2589b7 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -116,16 +116,45 @@ oper -------------------------------------------------------------------------------- -- Adjectives - Adjective : Type = {s : Number => Str} ; + AdjPhrase : Type = {s : Number => Str} ; + + Adjective : Type = {s : Degree => Number => Str} ; mkAdj : Str -> Adjective = \sg -> { - s = \\n => - let plural = case n of { - Sg => [] ; - Pl => pluralAllomorph sg } - in sg + plural + s = \\d,n => + let adj = case d of { + Compar => comparAdj sg ; + Superl => "leg" + comparAdj sg ; + _ => sg } ; + plural = case n of { + Sg => [] ; + Pl => pluralAdj adj } + in adj + plural } ; + -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives + comparAdj : Str -> Str = \stem -> + case stem of { +-- Final a and e become lengthened at the end of a word, if the comparative suffix -bb is joined to it—e.g., drága, drágább; fekete, feketébb, &c.; ó shortens its sound only in jó; jobb, legjobb. + "szép" => "szebb" ; + "könnyű" => "könnyebb" ; + "ifju" => "ifjabb" ; + "hosszú" => "hosszabb" ; + "sok" => "több" ; + _ + #v => stem + "bb" ; + _ => harm "abb" "ebb" ! getHarm stem + } ; + + + pluralAdj : Str -> Str = \stem -> + case vowFinal stem of { + True => -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives + case last stem of { "ü" => "ek" ; + "i" => harm "ak" "ek" ! getHarm stem ; + _ => "k" } ; + + False => harm3 "ok" "ek" "ök" ! getHarm stem + } ; -------------------------------------------------------------------------------- -- Verbs From 1f030252a1ffbe359bb7b596eb64683ca2bc45b9 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Tue, 14 Apr 2020 16:32:17 +0200 Subject: [PATCH 49/97] fixed genitive es/en in German adjectives and determiners --- src/german/MorphoGer.gf | 4 ++++ src/german/NounGer.gf | 2 +- src/german/ResGer.gf | 26 +++++++++++++++++++++++--- src/german/StructuralGer.gf | 12 ++++++------ 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/german/MorphoGer.gf b/src/german/MorphoGer.gf index a2eeea1c4..f7b6a75f7 100644 --- a/src/german/MorphoGer.gf +++ b/src/german/MorphoGer.gf @@ -32,6 +32,10 @@ oper {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies -> {s,sp = appAdj (regA dies) ! n ; n = n ; a = Weak ; isDef = isDef} ; + detUnlikeAdj : Bool -> Number -> Str -> + {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies -> + {s,sp = appAdj (regDetA dies) ! n ; n = n ; a = Weak ; isDef = isDef} ; + mkOrd : {s : Degree => AForm => Str} -> {s : AForm => Str} = \a -> {s = a.s ! Posit} ; diff --git a/src/german/NounGer.gf b/src/german/NounGer.gf index a7fa50682..8d82510bd 100644 --- a/src/german/NounGer.gf +++ b/src/german/NounGer.gf @@ -157,7 +157,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { sp = table { True => \\_,_,c => usePrepC c (\k -> []) ; False => table { - Sg => \\g,c => usePrepC c (\k -> (detLikeAdj False Sg "ein").s ! g ! NPC k) ; + Sg => \\g,c => usePrepC c (\k -> (detUnlikeAdj False Sg "ein").s ! g ! NPC k) ; Pl => \\_,c => usePrepC c (\k -> caselist "einige" "einige" "einigen" "einiger" ! k) } } ; diff --git a/src/german/ResGer.gf b/src/german/ResGer.gf index 52a20c693..9e5670056 100644 --- a/src/german/ResGer.gf +++ b/src/german/ResGer.gf @@ -399,6 +399,17 @@ resource ResGer = ParamX ** open Prelude in { in mkA blau blau (blau + "er") blauest ; + regDetA : Str -> Adjective = \blau -> + let + rblau = regA blau ; + dblau = adjFormsDet blau blau + in { + s = table { + Posit => dblau ; + d => rblau.s ! d + } + } ; + regV : Str -> Verb = \legen -> let lege = init legen ; @@ -503,15 +514,24 @@ resource ResGer = ParamX ** open Prelude in { table { APred => teuer ; AMod (GSg Masc) c => - caselist (teur+"er") (teur+"en") (teur+"em") (teur+"es") ! c ; + caselist (teur+"er") (teur+"en") (teur+"em") (teur+"en") ! c ; AMod (GSg Fem) c => caselist (teur+"e") (teur+"e") (teur+"er") (teur+"er") ! c ; - AMod (GSg Neut) c => - caselist (teur+"es") (teur+"es") (teur+"em") (teur+"es") ! c ; + AMod (GSg Neutr) c => + caselist (teur+"es") (teur+"es") (teur+"em") (teur+"en") ! c ; AMod GPl c => caselist (teur+"e") (teur+"e") (teur+"en") (teur+"er") ! c } ; + -- for some determiners, Gen form -es rather than -en + adjFormsDet : (x1,x2 : Str) -> AForm => Str = \teuer,teur -> + let adj = adjForms teuer teur + in + table { + AMod (GSg Masc| GSg Neutr) Gen => teur + "es" ; + a => adj ! a + } ; + -------------------------------------------- --VP CONSTRUCTION -------------------------------------------- diff --git a/src/german/StructuralGer.gf b/src/german/StructuralGer.gf index d4f92ba8b..c7c30dce1 100644 --- a/src/german/StructuralGer.gf +++ b/src/german/StructuralGer.gf @@ -32,7 +32,7 @@ concrete StructuralGer of Structural = CatGer ** during_Prep = mkPrep "während" P.genitive | P.mkPrep P.accusative "über" ; either7or_DConj = sd2 "entweder" "oder" ** {n = Sg} ; everybody_NP = nameNounPhrase {s = caselist "jeder" "jeden" "jedem" "jedes"} ; - every_Det = detLikeAdj False Sg "jed" ; + every_Det = detUnlikeAdj False Sg "jed" ; everything_NP = nameNounPhrase {s = caselist "alles" "alles" "allem" "alles"} ; everywhere_Adv = ss "überall" ; few_Det = detLikeAdj False Pl "wenig" ; @@ -45,7 +45,7 @@ concrete StructuralGer of Structural = CatGer ** here_Adv = ss "hier" ; how_IAdv = ss "wie" ; how8much_IAdv = ss "wieviel" ; - how8many_IDet = {s = \\g,c => (detLikeAdj False Pl "wie viel").s ! g ! NPC c ; n = Pl} ; + how8many_IDet = {s = \\g,c => (detUnlikeAdj False Pl "wie viel").s ! g ! NPC c ; n = Pl} ; if_Subj = ss "wenn" | ss "falls" ; in8front_Prep = mkPrep "vor" P.dative ; i_Pron = mkPronPers "ich" "mich" "mir" "meiner" "mein" Masc Sg P1 ; @@ -88,7 +88,7 @@ concrete StructuralGer of Structural = CatGer ** something_NP = nameNounPhrase {s = \\_ => "etwas"} ; somewhere_Adv = ss "irgendwo" ; that_Quant = let - jener : Number => Gender => PCase => Str = \\n => (detLikeAdj True n "jen").s in + jener : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "jen").s in {s,sp = \\_ => jener ; a,aPl = Weak} ; ---b that_NP = nameNounPhrase {s = caselist "das" "das" "denem" "dessen"} ; ---- there_Adv = ss "da" | ss "dort" ; @@ -98,7 +98,7 @@ concrete StructuralGer of Structural = CatGer ** ---b these_NP = {s = caselist "diese" "diese" "diesen" "dieser" ; a = agrP3 Pl} ; they_Pron = mkPronPers "sie" "sie" "ihnen" "ihrer" "ihr" Fem Pl P3 ; this_Quant = let - dieser : Number => Gender => PCase => Str = \\n => (detLikeAdj True n "dies").s in + dieser : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "dies").s in {s,sp = \\_ => dieser ; a,aPl = Weak} ; ---b this_NP = nameNounPhrase {s = caselist "dies" "dies" "diesem" "dieses"} ; ---- ---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ; @@ -121,7 +121,7 @@ concrete StructuralGer of Structural = CatGer ** when_IAdv = ss "wann" ; when_Subj = ss "wenn" ; where_IAdv = ss "wo" ; - which_IQuant = {s = \\n,g,c => (detLikeAdj True n "welch").s ! g ! NPC c} ; + which_IQuant = {s = \\n,g,c => (detUnlikeAdj True n "welch").s ! g ! NPC c} ; whoSg_IP = {s = caselist "wer" "wen" "wem" "wessen" ; n = Sg} ; whoPl_IP = {s = caselist "wer" "wen" "wem" "wessen" ; n = Sg} ; -- HL 6/2016 @@ -137,7 +137,7 @@ concrete StructuralGer of Structural = CatGer ** no_Quant = let keiner : Number => Gender => PCase => Str = table { Sg => \\g,c => usePrepC c (\k -> "kein" + pronEnding ! GSg g ! k) ; - Pl => (detLikeAdj False Pl "kein").s + Pl => (detUnlikeAdj False Pl "kein").s } in {s,sp = \\_ => keiner ; a = Strong ; aPl = Weak} ; ---- sp From 2c83fd8691a141239c9aece0ac4f86dca55cafb7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 14 Apr 2020 17:53:04 +0200 Subject: [PATCH 50/97] =?UTF-8?q?(Kor)=20Don't=20add=20=EB=93=A4=20with=20?= =?UTF-8?q?numerals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/korean/NumeralKor.gf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/korean/NumeralKor.gf b/src/korean/NumeralKor.gf index ff1a04e68..ac21579a1 100644 --- a/src/korean/NumeralKor.gf +++ b/src/korean/NumeralKor.gf @@ -37,7 +37,7 @@ lin -- : Digit -> Sub100 ; -- 10 + d pot1to19 d = let newS = xPlus "십" "열" d.s in d ** { s = newS ; - n = Pl ; + n = numNumber ; ord = newS ! NK ! Attrib ++ "번째" ; } ; @@ -98,7 +98,7 @@ oper SK => \\_ => sk ; NK => table {Indep => nk ; _ => nkAttr } } ; - n = Pl ; + n = numNumber ; numtype = IsNum ; isTwo = False ; ten = ten ; @@ -117,7 +117,7 @@ oper potTimes : (sk,nk : Str) -> ResKor.Numeral -> ResKor.Numeral = \sk,nk,num -> let newS = xTimes sk nk num.s in num ** { s = newS ; - n = Pl ; + n = numNumber ; ord = newS ! NK ! Attrib ++ "번째" ; -- TODO check } ; @@ -136,7 +136,7 @@ lin -- : Dig -> Digits -> Digits ; -- 876 IIDig d i = { s = \\o => d.s ! NCard ++ BIND ++ i.s ! o ; - n = Pl + n = numNumber } ; D_0 = mkDig "0" ; @@ -151,7 +151,7 @@ lin D_9 = mkDig "9" ; oper - mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o ResKor.Pl ; + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o numNumber ; mkDig : Str -> TDigit = \c -> mk2Dig c (c + "번째") ; mk3Dig : Str -> Str -> ResKor.Number -> TDigit = \c,o,n -> { @@ -163,4 +163,6 @@ oper n : ResKor.Number ; s : CardOrd => Str } ; + + numNumber = Sg ; -- No need for 들 with numerals } From 1ffa53c3b2bf4038111d5de3eccded18c2ee4c21 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 14 Apr 2020 20:58:17 +0200 Subject: [PATCH 51/97] (Kor) Add negative form in V where conjunction attaches --- src/korean/ConjunctionKor.gf | 2 +- src/korean/ParamKor.gf | Bin 3733 -> 3787 bytes src/korean/RelativeKor.gf | 2 +- src/korean/ResKor.gf | 7 ++++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/korean/ConjunctionKor.gf b/src/korean/ConjunctionKor.gf index 1aeaa4913..01f407db2 100644 --- a/src/korean/ConjunctionKor.gf +++ b/src/korean/ConjunctionKor.gf @@ -101,7 +101,7 @@ lin oper mkFirstAP : ResKor.AdjPhrase -> VForm => ConjType => Str = \ap -> - \\af,conj => ap.compar ++ glue (ap.s ! VStem) (conjTable ! VStar ! conj) ; + \\af,conj => ap.compar ++ glue (ap.s ! VStem Pos) (conjTable ! VStar ! conj) ; {- lincat diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index 24832b20a1aaee3106a3319d9fa67d5214ebc9cd..575db8b5cd61734fd28fe797c3552545ad33c5b0 100644 GIT binary patch delta 83 zcmbO#ds=ow5I09aeokUhW=ZAdKyF1wi-7!M1zS4>rD6q*u;7x^T!n!AVofClYc2%^ W1qFzRUurt462H`R&CRtu5=;OiY8Vj! delta 29 kcmX>tJ5_c=5clS2ZUsheTRR1%Vui5alGNPIn|UOd0EsyWxBvhE diff --git a/src/korean/RelativeKor.gf b/src/korean/RelativeKor.gf index 4150f6e49..7fbe1030d 100644 --- a/src/korean/RelativeKor.gf +++ b/src/korean/RelativeKor.gf @@ -10,7 +10,7 @@ lin s = \\t,a,p,cltyp => rp.s ++ vp.adv ++ vp.nObj ++ case cltyp of { - WithConj => vp.s ! VStem ; + WithConj => vp.s ! VStem p ; _ => vp.s ! VAttr p } ; } ; diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index 59bf669a1..1cc6c3736 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -153,7 +153,7 @@ oper mkAdj : Str -> Adjective = \plain -> let v : Verb = mkVerb plain ; - stem : Str = v.s ! VStem ; + stem : Str = v.s ! VStem Pos ; attrpos : Str = add_N stem ; in v2a attrpos v ; @@ -207,7 +207,8 @@ oper mkVerbFull : (x1,_,_,_,_,_,_,_,x9 : Str) -> Verb = \stem,attrpos,attrneg,plain,polite,formal,planeg,polneg,formneg -> { s = table { - VStem => stem ; + VStem Pos => stem ; + VStem Neg => stem + "지" ++ "않" ; VAttr Pos => attrpos ; VAttr Neg => attrneg ; VF Plain Pos => plain ; @@ -359,7 +360,7 @@ oper s = \\t,a,p,cltyp => let vf = case cltyp of { Subord => VAttr p ; - WithConj => VStem ; + WithConj => VStem p ; _ => VF Polite p } -- TODO: more tenses, politeness in np ++ vp.nObj -- an object, not copula complement From 976098d673f140742125746537b545c33a8beafe Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Thu, 16 Apr 2020 11:22:42 +0200 Subject: [PATCH 52/97] Test --- src/hungarian/NounMorphoHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index b09c33c68..ceee6a96e 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -2,7 +2,7 @@ resource NounMorphoHun = ParamHun ** open Prelude, Predef in { oper Noun = {s : Number => Case => Str} ; - +-- -- Paradigm functions -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf From 138b79fca3172dd287d5b0d6a6407e1eb01294b7 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Thu, 16 Apr 2020 11:25:46 +0200 Subject: [PATCH 53/97] Test --- src/hungarian/NounMorphoHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index ceee6a96e..b09c33c68 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -2,7 +2,7 @@ resource NounMorphoHun = ParamHun ** open Prelude, Predef in { oper Noun = {s : Number => Case => Str} ; --- + -- Paradigm functions -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf From d2ad4d6105c534025e12af2ad3d7b1e6ab2de489 Mon Sep 17 00:00:00 2001 From: Michal Mechura Date: Thu, 16 Apr 2020 20:01:38 +0200 Subject: [PATCH 54/97] improvements to czech, mostly morphological --- src/czech/ResCze.gf | 93 +++++++++++++++++++------------------- src/czech/StructuralCze.gf | 4 +- 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/src/czech/ResCze.gf b/src/czech/ResCze.gf index 7f791252e..f683a2ab1 100644 --- a/src/czech/ResCze.gf +++ b/src/czech/ResCze.gf @@ -16,7 +16,7 @@ param Case = Nom | Gen | Dat | Acc | Voc | Loc | Ins ; -- traditional order Person = P1 | P2 | P3 ; - + Agr = Ag Gender Number Person ; CTense = CTPres | CTPast ; ----- TODO complete the tense system to match Czech verb morphology @@ -27,16 +27,16 @@ oper hardConsonant : pattern Str = #("d"|"t"|"g"|"h"|"k"|"n"|"r") ; softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"ř"|"š"|"c"|"č"|"ž") ; neutralConsonant : pattern Str = #("b"|"f"|"l"|"m"|"p"|"s"|"v") ; - + consonant : pattern Str = #( - "d" | "t" | "g" | "h" | "k" | "n" | "r" | - "ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" | + "d" | "t" | "g" | "h" | "k" | "n" | "r" | + "ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" | "b" | "f" | "l" | "m" | "p" | "s" | "v" - ) ; + ) ; dropFleetingE : Str -> Str = \s -> case s of { - x + "e" + c@("k"|"c") => x + c ; + x + "e" + c@("k"|"c"|"n") => x + c ; x + "e" + "ň" => x + "n" ; _ => s } ; @@ -85,10 +85,10 @@ oper shortFemPlGen : Str -> Str = \s -> case s of { ul + "ice" => ul + "ic" ; koleg + "yně" => koleg + "yň" ; - ruz + "e" => ruz + "i" ; + ruz + "e" => ruz + "í" ; _ => Predef.error ("shortFemPlGen does not apply to" ++ s) - } ; - + } ; + --------------- -- Nouns --------------- @@ -136,7 +136,7 @@ oper -- terminology of CEG DeclensionType : Type = Str -> NounForms ; - + declensionNounForms : (nom,gen : Str) -> Gender -> NounForms = \nom,gen,g -> let decl : DeclensionType = case of { @@ -173,12 +173,12 @@ oper _ + "e" => declMORE s ; _ + "í" => declSTAVENI s ; _ => Predef.error ("cannot guess declension type for" ++ s) - } ; + } ; -- the traditional declensions, in both CEG and Wiki -- they are also exported in ParadigmsCze with names panN etc - declPAN : DeclensionType = \pan -> --- plural nom ové|i|é can be changed with ** {pnom = ...} CEG 3.5.1 + declPAN : DeclensionType = \pan -> --- plural nom ové|i|é can be changed with ** {pnom = ...} CEG 3.5.1 { snom = pan ; sgen,sacc = pan + "a" ; @@ -193,7 +193,7 @@ oper ploc = addEch pan ; g = Masc Anim } ; - + declPREDSEDA : DeclensionType = \predseda -> --- 3.5.4: sgen y/i let predsed = init predseda in @@ -284,7 +284,7 @@ oper sins = muz + "em" ; pnom = case muz_ of { - uci + "tel" => uci + "tele" ; + uci + "tel" => uci + "telé" ; _ => muz + "i" --- muzové } ; pgen = muz + "ů" ; @@ -308,7 +308,7 @@ oper pdat = soudc + "ům" ; pacc = soudce ; ploc = soudc + "ích" ; - pins = soudc + "i" ; + pins = soudc + "i" ; g = Masc Anim } ; @@ -332,7 +332,8 @@ oper in { snom,sgen,svoc = ruze ; --- pnom,pacc - sdat,sacc,sloc,sins = ruz + "i" ; + sdat,sacc,sloc = ruz + "i" ; + sins = ruz + "í" ; pnom,pacc = ruze ; pgen = shortFemPlGen ruze ; @@ -343,7 +344,7 @@ oper } ; declPISEN : DeclensionType = \pisen -> - let pisn = dropFleetingE pisen + let pisn = dropFleetingE pisen in { snom,sacc = pisen ; @@ -389,7 +390,7 @@ oper pins = kur + "aty" ; g = Neutr } ; - + declMORE : DeclensionType = \more -> --- 3.7.2 pgen zero sometimes let mor = init more in @@ -399,13 +400,13 @@ oper sins = mor + "em" ; pnom,pacc = more ; - pgen = mor + "í" ; --- + pgen = mor + "í" ; --- pdat = mor + "ím" ; - ploc = mor + "ích" ; + ploc = mor + "ích" ; pins = mor + "i" ; g = Neutr } ; - + declSTAVENI : DeclensionType = \staveni -> { snom,sgen,sdat,sacc,svoc,sloc = staveni ; @@ -422,7 +423,7 @@ oper -- Adjectives -- to be used for AP: 56 forms for each degree - Adjective : Type = {s : Gender => Number => Case => Str} ; + Adjective : Type = {s : Gender => Number => Case => Str} ; -- to be used for A, in three degrees: 15 forms in each ---- TODO other degrees than positive @@ -444,25 +445,25 @@ oper adjFormsAdjective : AdjForms -> Adjective = \afs -> { s = \\g,n,c => case of { - + | => afs.msnom ; | => afs.fsnom ; => afs.nsnom ; - + | => afs.msgen ; | => afs.fsgen ; - + => afs.msdat ; => afs.fsdat ; => afs.fsacc ; - + => afs.msloc ; - + | => afs.msins ; => afs.fsins ; @@ -473,7 +474,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { => afs.pgen ; => afs.pins } - + } ; -- hard declension @@ -571,7 +572,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { pastpartpl = "byli" ; negpressg3 = "ní" ; -- ne is added to this } ; - + haveVerbForms : VerbForms = { inf = "mít" ; pressg1 = "mám" ; @@ -590,7 +591,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { iii_kupovatVerbForms : Str -> VerbForms = \kupovat -> let kupo = Predef.tk 3 kupovat ; - kupu = Predef.tk 1 kupo + "u" + kupu = Predef.tk 1 kupo + "u" in { inf = kupovat ; @@ -604,7 +605,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { pastpartpl = kupo + "vali" ; } ; - + --------------------------- -- Pronouns @@ -637,7 +638,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { cgen,cacc = "tě" ; dat,pdat,loc = "tobě" ; cdat = "ti" ; - ins,pins = "tebou" + ins,pins = "tebou" } ; Ag (Masc _) Sg P3 => { nom = "on" ; @@ -714,10 +715,10 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { oper DemPronForms : Type = { msnom, fsnom, nsnom, - msgen, fsgen, + msgen, fsgen, msdat, -- fsdat = fsgen unlike AdjForms fsacc, - msloc, + msloc, msins, fsins, mpnom, fpnom, -- mpacc = fpacc = fpnom pgen, @@ -748,7 +749,7 @@ oper fsnom = t + "a" ; nsnom = t + "o" ; msgen = t + "oho" ; - fsgen = t + "é" ; + fsgen = t + "é" ; msdat = t + "omu" ; fsacc = t + "u" ; msloc = t + "om" ; @@ -760,9 +761,9 @@ oper pdat = t + "ěm" ; pins = t + "ěmi" ; } ; - + invarDemPronForms : Str -> DemPronForms = \s -> { - msnom, fsnom, nsnom, msgen, fsgen, + msnom, fsnom, nsnom, msgen, fsgen, msdat, fsacc, msloc, msins, fsins, mpnom, fpnom, pgen, pdat, pins = s ; } ; @@ -776,7 +777,7 @@ oper Loc => "kom" ; Ins => "kým" } ; - + coForms : Case => Str = table { Nom|Acc|Voc => "co" ; Gen => "čeho" ; @@ -790,10 +791,10 @@ oper -- singular forms of demonstratives NumeralForms : Type = { msnom, fsnom, nsnom, - msgen, fsgen, - msdat, + msgen, fsgen, + msdat, fsacc, - msloc, + msloc, msins, fsins : Str } ; @@ -801,7 +802,7 @@ oper \nume,size -> let dem = nume ** - {mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used + {mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used demAdj = dem ** {fsdat = dem.fsgen} ; adjAdj = adjFormsAdjective demAdj in { @@ -810,7 +811,7 @@ oper } ; -- example: number 1 - oneNumeral : Determiner = numeralFormsDeterminer (mkDemPronForms "jed") Num1 ; + oneNumeral : Determiner = numeralFormsDeterminer ((mkDemPronForms "jedn") ** {msnom = "jeden"}) Num1 ; -- numbers 2,3,4 ---- to check if everything comes out right with the determiner type twoNumeral : Determiner = @@ -820,7 +821,7 @@ oper msdat, msins, fsins = "dvěma" } in numeralFormsDeterminer forms Num2_4 ; - + threeNumeral : Determiner = let forms = { msnom, fsnom, nsnom, fsacc, msgen, fsgen = "tři" ; @@ -850,7 +851,7 @@ oper invarDeterminer : Str -> NumSize -> Determiner = \sto,size -> regNumeral sto sto ; - + invarNumeral : Str -> Determiner = \s -> invarDeterminer s Num5 ; -------------------------------- @@ -881,4 +882,4 @@ oper Num1 => Sg ; _ => Pl ---- TO CHECK } ; -} \ No newline at end of file +} diff --git a/src/czech/StructuralCze.gf b/src/czech/StructuralCze.gf index 6cbf9280a..347e7480f 100644 --- a/src/czech/StructuralCze.gf +++ b/src/czech/StructuralCze.gf @@ -1,8 +1,8 @@ -concrete StructuralCze of Structural = CatCze ** +concrete StructuralCze of Structural = CatCze ** open ParadigmsCze, ResCze, Prelude in { lin - and_Conj = mkConj "i" ; + and_Conj = mkConj "a" ; by8agent_Prep = mkPrep "od" Gen ; ---- TODO this means "from", there might be no good translation few_Det = invarNumeral "málo" ; -- CEG 6.8 --- TODO genitive mála for_Prep = mkPrep "pro" accusative ; From f5068a76de6735e31ae2f620417d1cd5d7c08f95 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 12:50:33 +0200 Subject: [PATCH 55/97] (Hun) Fix have_V2 --- src/hungarian/ResHun.gf | 6 ++++++ src/hungarian/StructuralHun.gf | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index b3b2589b7..ef964cf2a 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -193,6 +193,12 @@ oper -- c3 : Case -- indirect object case } ; + datV2 : Verb -> Verb2 = \v -> { + s = \\_ => v.s ; + sc = SCDat ; + c2 = Nom + } ; + mkVerb2 : Str -> Verb2 = \sg3 -> vtov2 (mkVerb sg3) ; mkVerb3 : Str -> Verb3 = \sg3 -> v2tov3 (mkVerb2 sg3) ; diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 3e6feb4ae..24d610d69 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -214,7 +214,7 @@ lin yes_Utt = ss "igen" ; ------- -- Verb -lin have_V2 = vtov2 copula ** {sc = SCDat ; c2 = Nom} ; +lin have_V2 = datV2 copula ; {-lin can8know_VV = can_VV ; -- can (capacity) lin can_VV = mkVV "" ; -- can (possibility) lin must_VV = mkVV "" ; From 5430d8b450084560b677c5a2eab6692c96fbf2cc Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 13:28:58 +0200 Subject: [PATCH 56/97] (Hun) Make numerals take singular noun --- src/hungarian/NumeralHun.gf | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/hungarian/NumeralHun.gf b/src/hungarian/NumeralHun.gf index d0ad7ce19..ca2a9e938 100644 --- a/src/hungarian/NumeralHun.gf +++ b/src/hungarian/NumeralHun.gf @@ -8,7 +8,6 @@ lincat Sub1000, Sub1000000 = ResHun.Numeral ; lin - -- TODO: Add case inflection and ordinal forms to all numerals -- : Sub1000000 -> Numeral @@ -30,48 +29,48 @@ lin pot0 d = d ; -- : Sub100 ; -- 10 - pot110 = {s = table {p => "tíz"} ; n = Pl ; numtype = IsNum} ; + pot110 = {s = table {p => "tíz"} ; n = numNumber ; numtype = IsNum} ; -- : Sub100 ; -- 11 - pot111 = {s = table {p => "tizenegy"} ; n = Pl ; numtype = IsNum} ; + pot111 = {s = table {p => "tizenegy"} ; n = numNumber ; numtype = IsNum} ; -- : Digit -> Sub100 ; -- 10 + d pot1to19 d = {s = table {p => "tizen" ++ d.s ! } ; - n = Pl ; numtype = IsNum} ; + n = numNumber ; numtype = IsNum} ; -- : Sub10 -> Sub100 ; -- coercion of 1..9 pot0as1 n = {s = table {p => n.s ! } ; - n = Pl ; numtype = IsNum} ; + n = numNumber ; numtype = IsNum} ; -- : Digit -> Sub100 ; -- d * 10 pot1 d = {s = table {p => d.s ! } ; - n = Pl ; numtype = IsNum} ; + n = numNumber ; numtype = IsNum} ; -- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n pot1plus d e = {s = table {p => (d.s ! ) ++ e.s ! } ; - n = Pl ; numtype = IsNum} ; + n = numNumber ; numtype = IsNum} ; -- : Sub100 -> Sub1000 ; -- coercion of 1..99 pot1as2 n = n ; -- : Sub10 -> Sub1000 ; -- m * 100 pot2 d = {s = table {p => (d.s ! ) ++ "száz"} ; - n = Pl ; numtype = IsNum} ; + n = numNumber ; numtype = IsNum} ; -- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n pot2plus d e = {s = table {p => (d.s ! ) ++ "száz" ++ e.s ! p} ; - n = Pl ; numtype = IsNum} ; + n = numNumber ; numtype = IsNum} ; -- : Sub1000 -> Sub1000000 ; -- coercion of 1..999 pot2as3 n = n ; -- : Sub1000 -> Sub1000000 ; -- m * 1000 pot3 n = {s = table {p => n.s ! Attrib ++ "ezer"} ; - n = Pl ; numtype = IsNum} ; + n = numNumber ; numtype = IsNum} ; -- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n pot3plus n m = {s = table {p => n.s ! Attrib ++ "ezer" ++ m.s ! p} ; - n = Pl ; numtype = IsNum} ; + n = numNumber ; numtype = IsNum} ; oper LinDigit : Type = {s : DForm*Place => Str ; n : Number} ; @@ -85,8 +84,9 @@ oper => ua ; => ta } ; -- ord = ord ; -- TODO figure out where to use ordinal - n = Pl ; + n = numNumber ; numType = IsNum ; } ; - } + numNumber = Sg ; + From 738dd44ec8cf4b4d3820d47befb23a2d951eb928 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 13:29:13 +0200 Subject: [PATCH 57/97] (Hun) Add digits --- src/hungarian/NounHun.gf | 5 ++++- src/hungarian/NumeralHun.gf | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 180a38dfa..20cefd26f 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -87,7 +87,10 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { } ; -- : Digits -> Card ; - -- NumDigits dig = + NumDigits dig = dig ** { + s = \\place => dig.s ! NCard ; + numtype = IsNum ; + } ; -- : Numeral -> Card ; NumNumeral num = num ; diff --git a/src/hungarian/NumeralHun.gf b/src/hungarian/NumeralHun.gf index ca2a9e938..f9c66af18 100644 --- a/src/hungarian/NumeralHun.gf +++ b/src/hungarian/NumeralHun.gf @@ -90,3 +90,40 @@ oper numNumber = Sg ; + -- numerals as sequences of digits + lincat + Dig = TDigit ; + + lin + -- : Dig -> Digits ; -- 8 + IDig d = d ** {s = \\_ => d.s} ; + + -- : Dig -> Digits -> Digits ; -- 876 + IIDig d i = { + s = \\x => d.s ++ BIND ++ i.s ! x ; + n = numNumber + } ; + + D_0 = mkDig "0" ; + D_1 = mkDig "1" ; + D_2 = mkDig "2" ; + D_3 = mkDig "3" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mkDig : Str -> TDigit = \s -> { + s = s ; + n = numNumber + } ; + + TDigit = { + s : Str ; -- TODO add ordinals + n : Number + } ; + +} From cc85e4aaeba31e6f3f990d12ed7852eb07e63ae5 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 14:45:44 +0200 Subject: [PATCH 58/97] (Hun) Make comparative discontinuous --- src/hungarian/AdjectiveHun.gf | 31 +++++++++++++++++++------------ src/hungarian/ConjunctionHun.gf | 8 ++++++-- src/hungarian/ResHun.gf | 10 +++++++++- src/hungarian/VerbHun.gf | 3 ++- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 19134c2c7..08128e15f 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -5,11 +5,14 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { lin -- : A -> AP ; - PositA a = {s = a.s ! Posit} ; + PositA a = emptyAP ** { + s = a.s ! Posit + } ; -- : A -> NP -> AP ; - ComparA a np = a ** { - s = \\n => a.s ! Compar ! n ++ np.s ! Ade ; + ComparA a np = emptyAP ** { + s = a.s ! Compar ; + compar = np.s ! Ade ; } ; -- : A2 -> NP -> AP ; -- married to her @@ -22,20 +25,20 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { UseA2 = PositA ; -- : A -> AP ; -- warmer - UseComparA a = a ** { - s = \\n => a.s ! Compar ! n ; + UseComparA a = emptyAP ** { + s = a.s ! Compar ; } ; - -- : CAdv -> AP -> NP -> AP ; -- as cool as John - -- CAdvAP adv ap np = ap ** { } ; + CAdvAP adv ap np = ap ** { + s = \\n => adv.s ++ ap.s ! n ; + compar = ap.compar ++ adv.p ++ np.s ! Nom + } ; -- The superlative use is covered in $Ord$. -- : Ord -> AP ; -- warmest - AdjOrd ord = ord ** { - s = \\_ => ord.s ; - } ; + -- AdjOrd ord = emptyAP ** ord ; -- Sentence and question complements defined for all adjectival -- phrases, although the semantics is only clear for some adjectives. @@ -46,12 +49,16 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- An adjectival phrase can be modified by an *adadjective*, such as "very". -- : AdA -> AP -> AP ; - AdAP ada ap = ap ** {s = \\af => ada.s ++ ap.s ! af} ; + AdAP ada ap = ap ** { + s = \\af => ada.s ++ ap.s ! af ; + } ; -- It can also be postmodified by an adverb, typically a prepositional phrase. -- : AP -> Adv -> AP ; -- warm by nature - -- AdvAP ap adv = ap ** {} ; + AdvAP ap adv = ap ** { + s = \\af => ap.s ! af ++ adv.s ; + } ; } diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index 7ef00d654..88c05a30f 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -40,9 +40,13 @@ lincat [AP] = {s1,s2 : Number => Str} ; lin - BaseAP = twoTable Number ; + 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 ; ConsAP = consrTable Number comma ; - ConjAP = conjunctDistrTable Number ; + ConjAP co as = conjunctDistrTable Number co as ** {compar = []} ; -- Noun phrases lincat diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index ef964cf2a..1319cbbe9 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -116,7 +116,15 @@ oper -------------------------------------------------------------------------------- -- Adjectives - AdjPhrase : Type = {s : Number => Str} ; + AdjPhrase : Type = { + s : Number => Str ; + compar : Str -- Discontinuous: Én *nagyobb* vagyok *nálad*. + } ; + + emptyAP : AdjPhrase = { + s = \\_ => [] ; + compar = [] ; + } ; Adjective : Type = {s : Degree => Number => Str} ; diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 946882cf1..0202aa980 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -111,7 +111,8 @@ lin 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.s ! Sg ++ copula.s ! vf} + ++ ap.compar ; } ; -- : CN -> Comp ; From 822cfc4bef8f69868abfd67252aa1989cb9a1041 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 14:46:44 +0200 Subject: [PATCH 59/97] (Hun) Change lincat of Ord + add OrdSuperl, DetQuantOrd --- src/hungarian/AdjectiveHun.gf | 2 +- src/hungarian/CatHun.gf | 2 +- src/hungarian/NounHun.gf | 16 +++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 08128e15f..5bb3feb49 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -38,7 +38,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- The superlative use is covered in $Ord$. -- : Ord -> AP ; -- warmest - -- AdjOrd ord = emptyAP ** ord ; + AdjOrd ord = emptyAP ** ord ; -- Sentence and question complements defined for all adjectival -- phrases, although the semantics is only clear for some adjectives. diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index a4471e71d..423c2f775 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -66,7 +66,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { Quant = ResHun.Quant ; Num = ResHun.Num ; Ord = { - s : Str ; -- Number => Case => Str ; -- Ord can come from AP and become AP again + s : Number => Str ; -- 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 ; diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 20cefd26f..98e351ec4 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -67,9 +67,11 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { } ; -- : Quant -> Num -> Ord -> Det ; -- these five best - -- DetQuantOrd quant num ord = - -- let theseFive = DetQuant quant num in theseFive ** { - -- } ; + 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 ; + } ; -- Whether the resulting determiner is singular or plural depends on the -- cardinal. @@ -106,18 +108,18 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { OrdNumeral num = num ** { s = \\_ => num.ord } ; - +-} -- : A -> Ord ; OrdSuperl a = { - s = \\af => "제일" ++ a.s ! af ; + s = a.s ! Superl ; n = Sg -- ?? is this meaningful? } ; -- One can combine a numeral and a superlative. -- : Numeral -> A -> Ord ; -- third largest - OrdNumeralSuperl num a = num ** { } ; --} + -- OrdNumeralSuperl num a = num ** { } ; + -- : Quant DefArt = { s, From 7c0ea34127356415aeecd216414fe03129655fe2 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 14:47:10 +0200 Subject: [PATCH 60/97] (Hun) Add A2, ComplA2, CAdv --- src/hungarian/AdjectiveHun.gf | 5 ++++- src/hungarian/CatHun.gf | 2 +- src/hungarian/LexiconHun.gf | 2 +- src/hungarian/ParadigmsHun.gf | 12 +++++++++++- src/hungarian/ResHun.gf | 12 +++++++++--- src/hungarian/StructuralHun.gf | 5 +++-- 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 5bb3feb49..a718d87ac 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -16,7 +16,10 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { } ; -- : A2 -> NP -> AP ; -- married to her - -- ComplA2 a2 np = a2 ** { } ; + ComplA2 a2 np = emptyAP ** { + s = a2.s ! Posit ; + compar = np.s ! a2.c2.c ++ a2.c2.s + } ; -- : A2 -> AP ; -- married to itself -- ReflA2 a2 = a2 ** { } ; diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 423c2f775..8449d206c 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -111,7 +111,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { V3 = ResHun.Verb3 ; A = ResHun.Adjective ; - A2 = ResHun.Adjective ; + A2 = ResHun.Adjective2 ; N, N2, diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 6646f1036..8805853bc 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -223,7 +223,7 @@ lin house_N = mkN "ház" ; -- M lin man_N = mkN "férfi" "ak" harmA ; -- force plural allomorph and a-harmony --- lin married_A2 = mkA "" ; +lin married_A2 = mkA2 "házas" Ins ; -- lin meat_N = mkN "" ; -- lin milk_N = mkN "" ; -- lin moon_N = mkN "" ; diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index d4f23d993..a8783faa8 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -29,7 +29,10 @@ oper -- mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A. } ; - -- mkA2 : Str -> Prep -> A2 ; + mkA2 : overload { + mkA2 : Str -> Prep -> A2 ; + mkA2 : Str -> Case -> A2 + } ; --2 Verbs @@ -133,6 +136,13 @@ oper -- jakda ** {s = \\af => kiga ++ jakda.s ! af} ; } ; + mkA2 = overload { + 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}} + } ; + mkV = overload { mkV : (sg3 : Str) -> V = \v -> lin V (mkVerb v) ; -- mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** { diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 1319cbbe9..4ea9955a9 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -126,7 +126,12 @@ oper compar = [] ; } ; - Adjective : Type = {s : Degree => Number => Str} ; + Adjective : Type = { + s : Degree => Number => Str + } ; + Adjective2 : Type = Adjective ** { + c2 : Postposition ; + } ; mkAdj : Str -> Adjective = \sg -> { s = \\d,n => @@ -149,11 +154,12 @@ oper "ifju" => "ifjabb" ; "hosszú" => "hosszabb" ; "sok" => "több" ; + "felső" => "felsőbb" ; + "belső" => "belsőbb" ; _ + #v => stem + "bb" ; - _ => harm "abb" "ebb" ! getHarm stem + _ => stem + harm "abb" "ebb" ! getHarm stem } ; - pluralAdj : Str -> Str = \stem -> case vowFinal stem of { True => -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 24d610d69..02f4a54de 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -11,8 +11,9 @@ lin at_most_AdN = ss "" ; lin so_AdA = mkAdA "" ; lin too_AdA = mkAdA "" ; lin very_AdA = mkAdA "" ; - -lin as_CAdv = { s = "" ; p = [] } ; +-} +lin as_CAdv = {s = "olyan" ; p = "mint"} ; +{- lin less_CAdv = { s = "" ; p = [] } ; lin more_CAdv = { s = "" ; p = [] } ; lin how_IAdv = ss "" : From 469cdbf0d14def5d7bac9efbe1e57748c0b6b3f4 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 14:47:28 +0200 Subject: [PATCH 61/97] (Hun) New unit tests --- src/hungarian/unittest/adjective.gftest | 34 +++++++++++++++++++++++++ src/hungarian/unittest/dative.gftest | 7 +++++ src/hungarian/unittest/numerals.gftest | 9 +++++++ 3 files changed, 50 insertions(+) create mode 100644 src/hungarian/unittest/adjective.gftest create mode 100644 src/hungarian/unittest/dative.gftest create mode 100644 src/hungarian/unittest/numerals.gftest diff --git a/src/hungarian/unittest/adjective.gftest b/src/hungarian/unittest/adjective.gftest new file mode 100644 index 000000000..242363533 --- /dev/null +++ b/src/hungarian/unittest/adjective.gftest @@ -0,0 +1,34 @@ +-------------------------------- +-- Adjectives with complement -- +-------------------------------- +-- LangEng: I am married to you +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompAP (ComplA2 married_A2 (UsePron youSg_Pron))))))) NoVoc +LangHun: én házas vagyok veled + + +---------------- +-- Comparison -- +---------------- +-- LangEng: I am as red as you +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompAP (CAdvAP as_CAdv (PositA red_A) (UsePron youSg_Pron))))))) NoVoc +LangHun: én olyan piros vagyok mint te + +-- LangEng: I am redder than you +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompAP (ComparA red_A (UsePron youSg_Pron))))))) NoVoc +LangHun: én pirosabb vagyok nálad + + +------------------ +-- Superlatives -- +------------------ +-- 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 + +-- 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 + +-- !! I suspect this is nonsense +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 new file mode 100644 index 000000000..2e81c531a --- /dev/null +++ b/src/hungarian/unittest/dative.gftest @@ -0,0 +1,7 @@ +-- 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 + +-- 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 diff --git a/src/hungarian/unittest/numerals.gftest b/src/hungarian/unittest/numerals.gftest new file mode 100644 index 000000000..23543b59b --- /dev/null +++ b/src/hungarian/unittest/numerals.gftest @@ -0,0 +1,9 @@ +-- Plural +-- LangEng: the cats fly +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumPl) (UseN cat_N)) (UseV fly_V)))) NoVoc +LangHun: a macskák repülnek + +-- Numeral +-- LangEng: two cats fly +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant IndefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2)))))))) (UseN cat_N)) (UseV fly_V)))) NoVoc +LangHun: két macska repül From 16caf7e041e1fa785e85d8c3bf83b5f2804cd1ad Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 15:29:17 +0200 Subject: [PATCH 62/97] (Hun) Add UttX : X -> Utt funs --- src/hungarian/PhraseHun.gf | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 83931ee5b..a96c97377 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -12,14 +12,15 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { UttImpPol = UttImpSg ; UttIP ip = {s = ip.s ! } ; - UttNP np = {s = np.s ! } ; - UttVP vp = {s = } ; - UttAdv adv = {s = } ; - UttCN n = {s = } ; - UttCard n = {s = } ; - UttAP ap = { s = ap.s ! } ; - UttInterj i = i ; -} + UttNP np = {s = np.s ! Nom} ; + UttVP vp = {s = vp.obj ++ vp.adv ++ vp.s ! VInf} ; + UttAdv adv = adv ; + UttCN cn = {s = cn.s ! Sg ! Nom} ; + UttCard n = {s = n.s ! Indep} ; + UttAP ap = {s = ap.s ! Sg ++ ap.compar} ; + UttInterj i = i ; + NoPConj = {s = []} ; -- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ; From 2cf99611bcfbdd0e29fcc7b33fdb64d917432716 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 15:30:09 +0200 Subject: [PATCH 63/97] (Hun) Update SymbOrd after changes in lincat of Ord --- src/hungarian/SymbolHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/SymbolHun.gf b/src/hungarian/SymbolHun.gf index 5a645302d..47f7c990a 100644 --- a/src/hungarian/SymbolHun.gf +++ b/src/hungarian/SymbolHun.gf @@ -42,7 +42,7 @@ lin SymbNum sy = baseNum ** {s = \\_ => sy.s} ; -- : Symb -> Ord ; - SymbOrd sy = {s = sy.s ; n=Pl} ; + SymbOrd sy = {s = \\n => sy.s ; n=Pl} ; lincat Symb, [Symb] = SS ; From 8c9e8e35ddebb4cca6b61c0816b4ceb215bfe558 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 15:30:52 +0200 Subject: [PATCH 64/97] (Hun) Add some postpositions + comments --- src/hungarian/ResHun.gf | 1 + src/hungarian/StructuralHun.gf | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 4ea9955a9..f92d0e0b3 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -91,6 +91,7 @@ oper -------------------------------------------------------------------------------- -- Postpositions + -- TODO: personal suffixes, e.g. felettem, általam, not *felett/által én Postposition : Type = {s : Str ; c : Case} ; mkPrep : Str -> Postposition = \str -> {s=str ; c=Nom} ; diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 02f4a54de..6629cbc66 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -91,12 +91,14 @@ oper ------- -- Prep +-- List of postpositions requiring case: +-- https://en.wiktionary.org/wiki/Appendix:Hungarian_postpositions#Postpositions_Requiring_Case lin above_Prep = mkPrep "fölött" ; -- lin after_Prep = mkPrep "" -- lin before_Prep = mkPrep "" ; -- lin behind_Prep = mkPrep "" ; -- lin between_Prep = = mkPrep "" ; --- lin by8agent_Prep = mkPrep ; +lin by8agent_Prep = mkPrep "által" ; lin by8means_Prep = casePrep Ins ; -- lin during_Prep = mkPrep ; -- lin except_Prep = mkPrep ; From 6de0fe95ec484729edf3932bb3151c912459e737 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 18:23:21 +0200 Subject: [PATCH 65/97] (Hun) Add relative clauses --- src/hungarian/CatHun.gf | 6 ++-- src/hungarian/NounHun.gf | 5 ++-- src/hungarian/ParamHun.gf | 5 ++++ src/hungarian/RelativeHun.gf | 19 ++++++++---- src/hungarian/ResHun.gf | 56 +++++++++++++++++++++++++++++------- src/hungarian/SentenceHun.gf | 4 +-- 6 files changed, 73 insertions(+), 22 deletions(-) diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 8449d206c..159b97ad7 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -9,7 +9,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { S = ResHun.Sentence ; QS = SS ; - RS = SS ; + RS = ResHun.RP ; -- relative sentence. Tense and polarity fixed, -- but agreement may depend on the CN/NP it modifies. @@ -30,8 +30,8 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { --2 Subord clauses and pronouns - --RCl = ResHun.RClause ; - --RP = SS ; + RCl = ResHun.RClause ; + RP = ResHun.RP ; --2 Verb phrases diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 98e351ec4..b5651fa89 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -167,8 +167,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { } ; -- : CN -> RS -> CN ; - -- RelCN cn rs = cn ** { - -- } ; + RelCN cn rs = cn ** { + s = \\n,c => cn.s ! n ! c ++ rs.s ! n ! c + } ; {- -- : CN -> Adv -> CN ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 2157c654f..35d4e5ad8 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -46,6 +46,11 @@ oper Ins => ins ; Tra => tra } ; + sc2case : SubjCase -> Case = \sc -> + case sc of { + SCNom => Nom ; + SCDat => Dat + } ; -------------------------------------------------------------------------------- -- Numerals diff --git a/src/hungarian/RelativeHun.gf b/src/hungarian/RelativeHun.gf index 6f14093bc..84b873a19 100644 --- a/src/hungarian/RelativeHun.gf +++ b/src/hungarian/RelativeHun.gf @@ -1,22 +1,31 @@ concrete RelativeHun of Relative = CatHun ** open ResHun, Prelude, (NS=NounHun), (SS=StructuralHun) in { -{- lin -- : Cl -> RCl ; -- such that John loves her -- RelCl cl = ; -- : RP -> VP -> RCl ; - RelVP rp vp = + RelVP = relVP ; -- : RP -> ClSlash -> RCl ; -- whom John loves - RelSlash rp cls = + RelSlash = relSlash ; -- : RP ; - IdRP = {s = ""} ; + IdRP = {s = + table {Sg => caseTable "ami" "amit" "aminek" -- nom, acc, dat + "amibe" "amiben" "amiből" -- ill, ine, ela + "amihez" "aminél" "amitől" -- all, ade, abl + "amire" "amin" "amiről" -- sub, sup, del + "amiért" "amivel" "amivé" ; -- cau, ins, tra + Pl => caseTable "amik" "amiket" "amiknek" -- nom, acc, dat + "amikbe" "amikben" "amikből" -- ill, ine, ela + "amikhez" "amiknél" "amiktől" -- all, ade, abl + "amikre" "amiken" "amikről" -- sub, sup, del + "amikért" "amikkel" "amikké"}; -- cau, ins, tra + } ; -- : Prep -> NP -> RP -> RP ; -- the mother of whom --FunRP prep np rp = {} ; --} } diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index f92d0e0b3..ef5cf5411 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -301,25 +301,61 @@ oper {- After PredVP, we might still want to add more adverbs (QuestIAdv), but we're done with verb inflection. -} - ClSlash : Type = Clause ; + ClSlash : Type = Clause ** { + sc : SubjCase ; -- For RelSlash + } ; QClause : Type = Clause ; - -- RClause : Type = {s : NForm => Tense => Anteriority => Polarity => Str} ; Sentence : Type = {s : Str} ; + -- predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** { + -- s = \\t,a,p => let subjcase : Case = case vp.sc of { + -- SCNom => Nom ; + -- SCDat => Dat } + -- in np.s ! subjcase + -- ++ np.empty -- standard trick for prodrop + -- ++ vp.s ! agr2vf np.agr + -- ++ vp.obj + -- ++ vp.adv + -- } ; + predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** { - s = \\t,a,p => let subjcase : Case = case vp.sc of { - SCNom => Nom ; - SCDat => Dat } - in np.s ! subjcase - ++ np.empty -- standard trick for prodrop - ++ vp.s ! agr2vf np.agr - ++ vp.obj - ++ vp.adv + 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 } ; + + -- Relative + + 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 -> { + s = \\t,a,p,n,c => let subjcase : Case = case vp.sc of { + SCNom => c ; + SCDat => Dat } + in rp.s ! n ! subjcase + ++ vp.s ! VFin rp.agr.p1 n -- variable by number + ++ vp.obj + ++ vp.adv + } ; + + relSlash : RP -> ClSlash -> RClause = \rp,cls -> { + s = \\t,a,p,n,c => let subjcase : Case = case cls.sc of { + SCNom => c ; + SCDat => Dat } + in rp.s ! n ! subjcase + ++ cls.s ! t ! a ! p + } ; -------------------------------------------------------------------------------- -- linrefs diff --git a/src/hungarian/SentenceHun.gf b/src/hungarian/SentenceHun.gf index 8c498bd4c..7cbafa7c4 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 = predVP ; + SlashVP np vps = predVP np (vps ** {s = vps.s ! Def ; obj = []}) ; {- -- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today AdvSlash cls adv = cls ** insertAdv adv cls ; @@ -56,7 +56,7 @@ lin UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ; -- : Temp -> Pol -> RCl -> RS ; - -- UseRCl t p cl = {s = } ; + UseRCl t p cl = {s = \\n,c => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! n ! c} ; -- AdvS : Adv -> S -> S ; -- then I will go home AdvS = advS "" ; From 4bbb4d580870f51c56a2e33d3dad6df125ac32bc Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 18:34:28 +0200 Subject: [PATCH 66/97] (Hun) Add conjunction of RS --- src/hungarian/ConjunctionHun.gf | 40 ++++++--------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index 88c05a30f..f018788c0 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -1,31 +1,6 @@ concrete ConjunctionHun of Conjunction = CatHun ** open ResHun, Coordination, Prelude in { - {- Conjunction for category X needs four things: - lincat [X] - lin BaseX - lin ConsX - lin ConjX - - For example, if X is defined as - - lincat X = {s : Number => Str ; g : Gender} ; - - then [X] will split its s field into two, and retain its other fields as is: - - lincat [X] = {s1,s2 : Number => Str ; g : Gender} ; - - Let us look at a simple case: Adv is of type {s : Str} - Then [Adv] is {s1,s2 : Str}. - BaseAdv, ConsAdv and ConjAdv can all use functions defined in prelude/Coordination: - - BaseAdv = twoSS ; - ConsAdv = consrSS comma ; - ConjAdv = conjunctSS ; - - -} - - -- Adverb and other simple {s : Str} types. lincat [Adv],[AdV],[IAdv],[S] = {s1,s2 : Str} ; @@ -35,7 +10,7 @@ lin ConsAdv, ConsAdV, ConsIAdv, ConsS = consrSS comma ; ConjAdv, ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ; - +-- Adjectival phrases lincat [AP] = {s1,s2 : Number => Str} ; @@ -57,17 +32,16 @@ lin ConsNP x xs = consrTable Case comma x xs ** xs ; ConjNP co xs = conjunctDistrTable Case co xs ** xs ; -{- --- RS depends on X, Y and Z, otherwise exactly like previous. --- RS can modify CNs, which are open for …, and have inherent … +-- Relative sentences lincat - [RS] = {s1,s2 : … => Str} ; + [RS] = {s1,s2 : Number => Case => Str} ; lin - BaseRS = twoTable … ; - ConsRS = consrTable … comma ; - ConjRS = conjunctDistrTable ; + BaseRS = twoTable2 Number Case ; + ConsRS = consrTable2 Number Case comma ; + ConjRS = conjunctDistrTable2 Number Case ; +{- lincat [CN] = { } ; From de757a00e7b718f19d168f50c30aebc6a5a12eb2 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 18:58:11 +0200 Subject: [PATCH 67/97] (Hun) Fixes in relatives --- src/hungarian/ResHun.gf | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index ef5cf5411..edcf46c88 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -267,6 +267,7 @@ oper VerbPhrase : Type = Verb ** { obj : Str ; adv : Str ; + c2 : Case ; -- for RelSlash } ; -- TODO more fields VPSlash : Type = Verb2 ** { @@ -275,6 +276,7 @@ oper useV : Verb -> VerbPhrase = \v -> v ** { obj,adv = [] ; + c2 = Acc ; -- TODO check } ; useVc : Verb2 -> VPSlash = \v2 -> v2 ** { @@ -302,7 +304,7 @@ oper but we're done with verb inflection. -} ClSlash : Type = Clause ** { - sc : SubjCase ; -- For RelSlash + c2 : Case ; -- For RelSlash } ; QClause : Type = Clause ; @@ -310,24 +312,12 @@ oper Sentence : Type = {s : Str} ; - -- predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** { - -- s = \\t,a,p => let subjcase : Case = case vp.sc of { - -- SCNom => Nom ; - -- SCDat => Dat } - -- in np.s ! subjcase - -- ++ np.empty -- standard trick for prodrop - -- ++ vp.s ! agr2vf np.agr - -- ++ vp.obj - -- ++ vp.adv - -- } ; - 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 } ; - -- Relative RP : Type = {s : Number => Case => Str} ; @@ -350,11 +340,11 @@ oper } ; relSlash : RP -> ClSlash -> RClause = \rp,cls -> { - s = \\t,a,p,n,c => let subjcase : Case = case cls.sc of { - SCNom => c ; - SCDat => Dat } - in rp.s ! n ! subjcase - ++ cls.s ! t ! a ! p + s = \\t,a,p,n,c => let objcase : Case = case cls.c2 of { + Acc => c ; + _ => cls.c2 } + in rp.s ! n ! objcase + ++ cls.s ! t ! a ! p } ; -------------------------------------------------------------------------------- -- linrefs From f3726e9c0ee16f88b0715573f648e7cac93e164f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 19:32:01 +0200 Subject: [PATCH 68/97] (Hun) Add various CN funs --- src/hungarian/NounHun.gf | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index b5651fa89..258ad3cb6 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -1,4 +1,4 @@ -concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { +concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { flags optimize=all_subs ; @@ -25,20 +25,26 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { -- A noun phrase can also be postmodified by the past participle of a -- verb, by an adverb, or by a relative clause -{- -- : NP -> V2 -> NP ; -- the man seen - PPartNP np v2 = np ** { - s = \\c => v2.s ! ??? ++ np.s ! c } ; ---- - - -- : NP -> Adv -> NP ; -- Paris today ; boys, such as .. - AdvNP,ExtAdvNP = \np,adv -> np ** {} ; + -- PPartNP np v2 = np ** { + -- s = \\c => v2.s ! ??? ++ np.s ! c } ; ---- + -- : NP -> Adv -> NP ; -- Paris today + AdvNP np adv = np ** { + s = \\c => np.s ! c ++ adv.s ; + } ; + -- : NP -> Adv -> NP ; -- boys, such as .. + ExtAdvNP np adv = np ** { + s = \\c => np.s ! c ++ bindComma ++ adv.s ; + } ; -- : NP -> RS -> NP ; -- Paris, which is here - RelNP np rs = np ** {} ; + RelNP np rs = np ** { + s = \\c => np.s ! c ++ bindComma ++ rs.s ! np.agr.p2 ! c ; + } ; -- Determiners can form noun phrases directly. --} + -- : Det -> NP ; DetNP det = emptyNP ** { s = det.sp ; @@ -131,7 +137,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { -- : Quant IndefArt = { s, - sp = \\_,_ => "egy" ; + sp = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; isIndefArt = True ; objdef = Indef ; } ; @@ -171,25 +177,26 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { s = \\n,c => cn.s ! n ! c ++ rs.s ! n ! c } ; -{- -- : CN -> Adv -> CN ; - AdvCN cn adv = cn ** { } ; + AdvCN cn adv = cn ** { + s = \\n,c => cn.s ! 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 -- to decide. Sentential complements are defined in VerbHun. -- : CN -> SC -> CN ; -- question where she sleeps - SentCN cn sc = cn ** { } ; - + -- SentCN cn sc = cn ** { } ; --2 Apposition -- This is certainly overgenerating. -- : CN -> NP -> CN ; -- city Paris (, numbers x and y) - ApposCN cn np = cn ** { s = } ; --} + ApposCN cn np = cn ** { + s = \\n,c => cn.s ! n ! c ++ np.s ! Nom + } ; --2 Possessive and partitive constructs From 70326b853a42d599d4a17aea5d0d8e24846034c9 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 19:35:06 +0200 Subject: [PATCH 69/97] (Hun) Fix a few small bugs with discontinous APs --- src/hungarian/ConjunctionHun.gf | 4 +++- src/hungarian/NounHun.gf | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index f018788c0..ddf556728 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -20,7 +20,9 @@ lin 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 ; - ConsAP = consrTable Number comma ; + 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 = []} ; -- Noun phrases diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 258ad3cb6..d26722630 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -169,7 +169,7 @@ 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 + s = \\n,c => ap.s ! Sg ++ cn.s ! n ! c ++ ap.compar } ; -- : CN -> RS -> CN ; From 0fe259af38c1c861dd96827123110cbf94362084 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 19:36:08 +0200 Subject: [PATCH 70/97] (Hun) Add Hungarian to the API --- languages.csv | 2 +- src/api/CombinatorsHun.gf | 7 + src/api/ConstructorsHun.gf | 3 + src/api/SymbolicHun.gf | 5 + src/api/SyntaxHun.gf | 4 + src/api/TryHun.gf | 3 + src/hungarian/MissingHun.gf | 541 ++++++++++++++++++++++++++++++++++++ 7 files changed, 564 insertions(+), 1 deletion(-) create mode 100644 src/api/CombinatorsHun.gf create mode 100644 src/api/ConstructorsHun.gf create mode 100644 src/api/SymbolicHun.gf create mode 100644 src/api/SyntaxHun.gf create mode 100644 src/api/TryHun.gf create mode 100644 src/hungarian/MissingHun.gf diff --git a/languages.csv b/languages.csv index 1259a866a..18d0d92a5 100644 --- a/languages.csv +++ b/languages.csv @@ -18,7 +18,7 @@ Grc,Ancient Greek,ancient_greek,,,y,,n,n,,n Gre,Greek,greek,,,,,,,,y Heb,Hebrew,hebrew,,,,,n,n,,n Hin,Hindi,hindi,Hindustani,to_devanagari,y,,,,,y -Hun,Hungarian,hungarian,,,y,n,n,n,,n +Hun,Hungarian,hungarian,,,n,y,y,y,n,n Ice,Icelandic,icelandic,,,,,,n,,y Ina,Interlingua,interlingua,,,y,,n,n,,n Ita,Italian,italian,Romance,,y,,,,y,y diff --git a/src/api/CombinatorsHun.gf b/src/api/CombinatorsHun.gf new file mode 100644 index 000000000..61da40882 --- /dev/null +++ b/src/api/CombinatorsHun.gf @@ -0,0 +1,7 @@ +--# -path=.:alltenses:prelude:src/hungarian + +resource CombinatorsHun = Combinators with + (Cat = CatHun), + (Structural = StructuralHun), + (Noun = NounHun), + (Constructors = ConstructorsHun) ** open MissingHun in {} ; diff --git a/src/api/ConstructorsHun.gf b/src/api/ConstructorsHun.gf new file mode 100644 index 000000000..0b6002cb9 --- /dev/null +++ b/src/api/ConstructorsHun.gf @@ -0,0 +1,3 @@ +--# -path=.:alltenses:prelude:../hungarian + +resource ConstructorsHun = Constructors with (Grammar = GrammarHun) ** open MissingHun in {} ; diff --git a/src/api/SymbolicHun.gf b/src/api/SymbolicHun.gf new file mode 100644 index 000000000..07c68d729 --- /dev/null +++ b/src/api/SymbolicHun.gf @@ -0,0 +1,5 @@ +--# -path=.:../hungarian:../common:../abstract:../prelude + +resource SymbolicHun = Symbolic with + (Symbol = SymbolHun), + (Grammar = GrammarHun) ** open MissingHun in {} ; diff --git a/src/api/SyntaxHun.gf b/src/api/SyntaxHun.gf new file mode 100644 index 000000000..00ebb9726 --- /dev/null +++ b/src/api/SyntaxHun.gf @@ -0,0 +1,4 @@ +--# -path=.:alltenses:prelude:../hungarian + +instance SyntaxHun of Syntax = + ConstructorsHun, CatHun, StructuralHun, CombinatorsHun ; diff --git a/src/api/TryHun.gf b/src/api/TryHun.gf new file mode 100644 index 000000000..2674f64c6 --- /dev/null +++ b/src/api/TryHun.gf @@ -0,0 +1,3 @@ +--# -path=.:../hungarian:../common:../abstract:../prelude + +resource TryHun = SyntaxHun, LexiconHun, ParadigmsHun - [mkAdv] ; diff --git a/src/hungarian/MissingHun.gf b/src/hungarian/MissingHun.gf new file mode 100644 index 000000000..e6e198a9a --- /dev/null +++ b/src/hungarian/MissingHun.gf @@ -0,0 +1,541 @@ +resource MissingHun = open GrammarHun, Prelude in { +-- temporary definitions to enable the compilation of RGL API + +oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ; +oper AdNum : AdN -> Card -> Card = notYet "AdNum" ; +oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ; +oper AdVVPSlash : AdV -> VPSlash -> VPSlash = notYet "AdVVPSlash" ; +oper AddAdvQVP : QVP -> IAdv -> QVP = notYet "AddAdvQVP" ; +oper AdjDAP : DAP -> AP -> DAP = notYet "AdjDAP" ; +oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ; +oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ; +oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ; +oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ; +oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ; +oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ; +oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ; +oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ; +oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ; +oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ; +oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ; +oper CompIP : IP -> IComp = notYet "CompIP" ; +oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ; +oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ; +oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ; +oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ; +oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ; +oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ; +oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ; +oper ComplVS : VS -> S -> VP = notYet "ComplVS" ; +oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ; +oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ; +oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ; +oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ; +oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ; +oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ; +oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ; +oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ; +oper CountNP : Det -> NP -> NP = notYet "CountNP" ; +oper DetDAP : Det -> DAP = notYet "DetDAP" ; +oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ; +oper EmbedQS : QS -> SC = notYet "EmbedQS" ; +oper EmbedS : S -> SC = notYet "EmbedS" ; +oper EmbedVP : VP -> SC = notYet "EmbedVP" ; +oper ExistIP : IP -> QCl = notYet "ExistIP" ; +oper ExistIPAdv : IP -> Adv -> QCl = notYet "ExistIPAdv" ; +oper ExistNP : NP -> Cl = notYet "ExistNP" ; +oper ExistNPAdv : NP -> Adv -> Cl = notYet "ExistNPAdv" ; +oper ExtAdvVP : VP -> Adv -> VP = notYet "ExtAdvVP" ; +oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ; +oper GenericCl : VP -> Cl = notYet "GenericCl" ; +oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ; +oper IdetIP : IDet -> IP = notYet "IdetIP" ; +oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ; +oper ImpP3 : NP -> VP -> Utt = notYet "ImpP3" ; +oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ; +oper ImpVP : VP -> Imp = notYet "ImpVP" ; +oper ImpersCl : VP -> Cl = notYet "ImpersCl" ; +oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ; +oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ; +oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ; +oper PConjConj : Conj -> PConj = notYet "PConjConj" ; +oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ; +oper PartNP : CN -> NP -> CN = notYet "PartNP" ; +oper PassV2 : V2 -> VP = notYet "PassV2" ; +oper PositAdAAdj : A -> AdA = notYet "PositAdAAdj" ; +oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ; +oper PossNP : CN -> NP -> CN = notYet "PossNP" ; +oper PossPron : Pron -> Quant = notYet "PossPron" ; +oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ; +oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ; +oper ProgrVP : VP -> VP = notYet "ProgrVP" ; +oper QuestCl : Cl -> QCl = notYet "QuestCl" ; +oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ; +oper QuestIComp : IComp -> NP -> QCl = notYet "QuestIComp" ; +oper QuestQVP : IP -> QVP -> QCl = notYet "QuestQVP" ; +oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ; +oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ; +oper ReflA2 : A2 -> AP = notYet "ReflA2" ; +oper ReflVP : VPSlash -> VP = notYet "ReflVP" ; +oper RelCl : Cl -> RCl = notYet "RelCl" ; +oper RelNP : NP -> RS -> NP = notYet "RelNP" ; +oper RelS : S -> RS -> S = notYet "RelS" ; +oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ; +oper SSubjS : S -> Subj -> S -> S = notYet "SSubjS" ; +oper SelfAdVVP : VP -> VP = notYet "SelfAdVVP" ; +oper SelfAdvVP : VP -> VP = notYet "SelfAdvVP" ; +oper SelfNP : NP -> NP = notYet "SelfNP" ; +oper SentAP : AP -> SC -> AP = notYet "SentAP" ; +oper SentCN : CN -> SC -> CN = notYet "SentCN" ; +oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ; +oper Slash3V3 : V3 -> NP -> VPSlash = notYet "Slash3V3" ; +oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ; +oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ; +oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ; +oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ; +oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ; +oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ; +oper SlashVP : NP -> VPSlash -> ClSlash = notYet "SlashVP" ; +oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ; +oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ; +oper SubjS : Subj -> S -> Adv = notYet "SubjS" ; +oper Use2N3 : N3 -> N2 = notYet "Use2N3" ; +oper Use3N3 : N3 -> N2 = notYet "Use3N3" ; +oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ; +oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ; +oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ; +oper UttIP : IP -> Utt = notYet "UttIP" ; +oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ; +oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ; +oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ; +oper UttQS : QS -> Utt = notYet "UttQS" ; +oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ; +oper VocNP : NP -> Voc = notYet "VocNP" ; +oper above_Prep : Prep = notYet "above_Prep" ; +oper active2passive : Cl -> Cl = notYet "active2passive" ; +oper add_V3 : V3 = notYet "add_V3" ; +oper after_Prep : Prep = notYet "after_Prep" ; +oper airplane_N : N = notYet "airplane_N" ; +oper alas_Interj : Interj = notYet "alas_Interj" ; +oper almost_AdA : AdA = notYet "almost_AdA" ; +oper almost_AdN : AdN = notYet "almost_AdN" ; +oper already_Adv : Adv = notYet "already_Adv" ; +oper although_Subj : Subj = notYet "although_Subj" ; +oper always_AdV : AdV = notYet "always_AdV" ; +oper animal_N : N = notYet "animal_N" ; +oper answer_V2S : V2S = notYet "answer_V2S" ; +oper apartment_N : N = notYet "apartment_N" ; +oper art_N : N = notYet "art_N" ; +oper as_CAdv : CAdv = notYet "as_CAdv" ; +oper ashes_N : N = notYet "ashes_N" ; +oper ask_V2Q : V2Q = notYet "ask_V2Q" ; +oper at_least_AdN : AdN = notYet "at_least_AdN" ; +oper at_most_AdN : AdN = notYet "at_most_AdN" ; +oper baby_N : N = notYet "baby_N" ; +oper back_N : N = notYet "back_N" ; +oper bad_A : A = notYet "bad_A" ; +oper bank_N : N = notYet "bank_N" ; +oper bark_N : N = notYet "bark_N" ; +oper beautiful_A : A = notYet "beautiful_A" ; +oper because_Subj : Subj = notYet "because_Subj" ; +oper become_VA : VA = notYet "become_VA" ; +oper beer_N : N = notYet "beer_N" ; +oper before_Prep : Prep = notYet "before_Prep" ; +oper beg_V2V : V2V = notYet "beg_V2V" ; +oper belly_N : N = notYet "belly_N" ; +oper between_Prep : Prep = notYet "between_Prep" ; +oper bike_N : N = notYet "bike_N" ; +oper bird_N : N = notYet "bird_N" ; +oper bite_V2 : V2 = notYet "bite_V2" ; +oper blood_N : N = notYet "blood_N" ; +oper blow_V : V = notYet "blow_V" ; +oper boat_N : N = notYet "boat_N" ; +oper bone_N : N = notYet "bone_N" ; +oper boot_N : N = notYet "boot_N" ; +oper boss_N : N = notYet "boss_N" ; +oper both7and_DConj : Conj = notYet "both7and_DConj" ; +oper bottle_of_CN : NP -> CN = notYet "bottle_of_CN" ; +oper break_V2 : V2 = notYet "break_V2" ; +oper breast_N : N = notYet "breast_N" ; +oper breathe_V : V = notYet "breathe_V" ; +oper broad_A : A = notYet "broad_A" ; +oper brother_N2 : N2 = notYet "brother_N2" ; +oper brown_A : A = notYet "brown_A" ; +oper burn_V : V = notYet "burn_V" ; +oper but_PConj : PConj = notYet "but_PConj" ; +oper butter_N : N = notYet "butter_N" ; +oper buy_V2 : V2 = notYet "buy_V2" ; +oper camera_N : N = notYet "camera_N" ; +oper can8know_VV : VV = notYet "can8know_VV" ; +oper can_VV : VV = notYet "can_VV" ; +oper cap_N : N = notYet "cap_N" ; +oper car_N : N = notYet "car_N" ; +oper carpet_N : N = notYet "carpet_N" ; +oper ceiling_N : N = notYet "ceiling_N" ; +oper chair_N : N = notYet "chair_N" ; +oper cheese_N : N = notYet "cheese_N" ; +oper child_N : N = notYet "child_N" ; +oper church_N : N = notYet "church_N" ; +oper city_N : N = notYet "city_N" ; +oper clean_A : A = notYet "clean_A" ; +oper clever_A : A = notYet "clever_A" ; +oper close_V2 : V2 = notYet "close_V2" ; +oper cloud_N : N = notYet "cloud_N" ; +oper cold_A : A = notYet "cold_A" ; +oper computer_N : N = notYet "computer_N" ; +oper correct_A : A = notYet "correct_A" ; +oper count_V2 : V2 = notYet "count_V2" ; +oper country_N : N = notYet "country_N" ; +oper cousin_N : N = notYet "cousin_N" ; +oper cow_N : N = notYet "cow_N" ; +oper cup_of_CN : NP -> CN = notYet "cup_of_CN" ; +oper cut_V2 : V2 = notYet "cut_V2" ; +oper day_N : N = notYet "day_N" ; +oper dconcat : Digits -> Digits -> Digits = notYet "dconcat" ; +oper die_V : V = notYet "die_V" ; +oper dig_V : V = notYet "dig_V" ; +oper digits2num : Digits -> Numeral = notYet "digits2num" ; +oper digits2numeral : Card -> Card = notYet "digits2numeral" ; +oper dirty_A : A = notYet "dirty_A" ; +oper distance_N3 : N3 = notYet "distance_N3" ; +oper dn : Dig -> Digit = notYet "dn" ; +oper dn10 : Dig -> Sub10 = notYet "dn10" ; +oper dn100 : Dig -> Dig -> Sub100 = notYet "dn100" ; +oper dn1000 : Dig -> Dig -> Dig -> Sub1000 = notYet "dn1000" ; +oper dn1000000a : Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000a" ; +oper dn1000000b : Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000b" ; +oper dn1000000c : Dig -> Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000c" ; +oper doctor_N : N = notYet "doctor_N" ; +oper dog_N : N = notYet "dog_N" ; +oper door_N : N = notYet "door_N" ; +oper dry_A : A = notYet "dry_A" ; +oper dull_A : A = notYet "dull_A" ; +oper during_Prep : Prep = notYet "during_Prep" ; +oper dust_N : N = notYet "dust_N" ; +oper ear_N : N = notYet "ear_N" ; +oper earth_N : N = notYet "earth_N" ; +oper easy_A2V : A2 = notYet "easy_A2V" ; +oper egg_N : N = notYet "egg_N" ; +oper either7or_DConj : Conj = notYet "either7or_DConj" ; +oper empty_A : A = notYet "empty_A" ; +oper enemy_N : N = notYet "enemy_N" ; +oper every_Det : Det = notYet "every_Det" ; +oper everybody_NP : NP = notYet "everybody_NP" ; +oper everything_NP : NP = notYet "everything_NP" ; +oper everywhere_Adv : Adv = notYet "everywhere_Adv" ; +oper except_Prep : Prep = notYet "except_Prep" ; +oper eye_N : N = notYet "eye_N" ; +oper factory_N : N = notYet "factory_N" ; +oper fall_V : V = notYet "fall_V" ; +oper far_Adv : Adv = notYet "far_Adv" ; +oper fat_N : N = notYet "fat_N" ; +oper father_N2 : N2 = notYet "father_N2" ; +oper fear_V2 : V2 = notYet "fear_V2" ; +oper fear_VS : VS = notYet "fear_VS" ; +oper feather_N : N = notYet "feather_N" ; +oper few_X_short_of_Y : NP -> CN -> CN -> S = notYet "few_X_short_of_Y" ; +oper fight_V2 : V2 = notYet "fight_V2" ; +oper find_V2 : V2 = notYet "find_V2" ; +oper fingernail_N : N = notYet "fingernail_N" ; +oper fire_N : N = notYet "fire_N" ; +oper fish_N : N = notYet "fish_N" ; +oper float_V : V = notYet "float_V" ; +oper floor_N : N = notYet "floor_N" ; +oper flow_V : V = notYet "flow_V" ; +oper flower_N : N = notYet "flower_N" ; +oper fly_V : V = notYet "fly_V" ; +oper fog_N : N = notYet "fog_N" ; +oper foot_N : N = notYet "foot_N" ; +oper forest_N : N = notYet "forest_N" ; +oper forget_V2 : V2 = notYet "forget_V2" ; +oper freeze_V : V = notYet "freeze_V" ; +oper fridge_N : N = notYet "fridge_N" ; +oper friend_N : N = notYet "friend_N" ; +oper from_Prep : Prep = notYet "from_Prep" ; +oper fruit_N : N = notYet "fruit_N" ; +oper full_A : A = notYet "full_A" ; +oper fun_AV : A = notYet "fun_AV" ; +oper garden_N : N = notYet "garden_N" ; +oper glass_of_CN : NP -> CN = notYet "glass_of_CN" ; +oper glove_N : N = notYet "glove_N" ; +oper gold_N : N = notYet "gold_N" ; +oper grammar_N : N = notYet "grammar_N" ; +oper grass_N : N = notYet "grass_N" ; +oper green_A : A = notYet "green_A" ; +oper guts_N : N = notYet "guts_N" ; +oper hair_N : N = notYet "hair_N" ; +oper hand_N : N = notYet "hand_N" ; +oper harbour_N : N = notYet "harbour_N" ; +oper has_age_VP : Card -> VP = notYet "has_age_VP" ; +oper hat_N : N = notYet "hat_N" ; +oper hate_V2 : V2 = notYet "hate_V2" ; +oper have_name_Cl : NP -> NP -> Cl = notYet "have_name_Cl" ; +oper head_N : N = notYet "head_N" ; +oper hear_V2 : V2 = notYet "hear_V2" ; +oper heart_N : N = notYet "heart_N" ; +oper heavy_A : A = notYet "heavy_A" ; +oper here7from_Adv : Adv = notYet "here7from_Adv" ; +oper here7to_Adv : Adv = notYet "here7to_Adv" ; +oper here_Adv : Adv = notYet "here_Adv" ; +oper hill_N : N = notYet "hill_N" ; +oper hit_V2 : V2 = notYet "hit_V2" ; +oper hold_V2 : V2 = notYet "hold_V2" ; +oper hope_VS : VS = notYet "hope_VS" ; +oper horn_N : N = notYet "horn_N" ; +oper horse_N : N = notYet "horse_N" ; +oper hot_A : A = notYet "hot_A" ; +oper how8many_IDet : IDet = notYet "how8many_IDet" ; +oper how8much_IAdv : IAdv = notYet "how8much_IAdv" ; +oper how_IAdv : IAdv = notYet "how_IAdv" ; +oper how_far_QCl : NP -> QCl = notYet "how_far_QCl" ; +oper how_old_QCl : NP -> QCl = notYet "how_old_QCl" ; +oper hungry_VP : VP = notYet "hungry_VP" ; +oper hunt_V2 : V2 = notYet "hunt_V2" ; +oper husband_N : N = notYet "husband_N" ; +oper ice_N : N = notYet "ice_N" ; +oper if_Subj : Subj = notYet "if_Subj" ; +oper if_then_Conj : Conj = notYet "if_then_Conj" ; +oper ill_VP : VP = notYet "ill_VP" ; +oper important_A : A = notYet "important_A" ; +oper in8front_Prep : Prep = notYet "in8front_Prep" ; +oper industry_N : N = notYet "industry_N" ; +oper iron_N : N = notYet "iron_N" ; +oper is_right_VP : VP = notYet "is_right_VP" ; +oper is_wrong_VP : VP = notYet "is_wrong_VP" ; +oper it_Pron : Pron = notYet "it_Pron" ; +oper john_PN : PN = notYet "john_PN" ; +oper jump_V : V = notYet "jump_V" ; +oper kill_V2 : V2 = notYet "kill_V2" ; +oper king_N : N = notYet "king_N" ; +oper knee_N : N = notYet "knee_N" ; +oper know_V2 : V2 = notYet "know_V2" ; +oper know_VQ : VQ = notYet "know_VQ" ; +oper know_VS : VS = notYet "know_VS" ; +oper lake_N : N = notYet "lake_N" ; +oper lamp_N : N = notYet "lamp_N" ; +oper language_N : N = notYet "language_N" ; +oper leaf_N : N = notYet "leaf_N" ; +oper learn_V2 : V2 = notYet "learn_V2" ; +oper leather_N : N = notYet "leather_N" ; +oper leave_V2 : V2 = notYet "leave_V2" ; +oper left_Ord : Ord = notYet "left_Ord" ; +oper leg_N : N = notYet "leg_N" ; +oper less_CAdv : CAdv = notYet "less_CAdv" ; +oper lie_V : V = notYet "lie_V" ; +oper listen_V2 : V2 = notYet "listen_V2" ; +oper live_V : V = notYet "live_V" ; +oper liver_N : N = notYet "liver_N" ; +oper long_A : A = notYet "long_A" ; +oper lose_V2 : V2 = notYet "lose_V2" ; +oper louse_N : N = notYet "louse_N" ; +oper love_N : N = notYet "love_N" ; +oper love_V2 : V2 = notYet "love_V2" ; +oper married_A2 : A2 = notYet "married_A2" ; +oper married_Cl : NP -> NP -> Cl = notYet "married_Cl" ; +oper meat_N : N = notYet "meat_N" ; +oper moon_N : N = notYet "moon_N" ; +oper more_CAdv : CAdv = notYet "more_CAdv" ; +oper most_Predet : Predet = notYet "most_Predet" ; +oper mother_N2 : N2 = notYet "mother_N2" ; +oper mountain_N : N = notYet "mountain_N" ; +oper mouth_N : N = notYet "mouth_N" ; +oper much_Det : Det = notYet "much_Det" ; +oper music_N : N = notYet "music_N" ; +oper must_VV : VV = notYet "must_VV" ; +oper n_unit_CN : Card -> CN -> CN -> CN = notYet "n_unit_CN" ; +oper n_units_AP : Card -> CN -> A -> AP = notYet "n_units_AP" ; +oper n_units_of_NP : Card -> CN -> NP -> NP = notYet "n_units_of_NP" ; +oper narrow_A : A = notYet "narrow_A" ; +oper nd : Digit -> Dig = notYet "nd" ; +oper nd10 : Sub10 -> Digits = notYet "nd10" ; +oper nd100 : Sub100 -> Digits = notYet "nd100" ; +oper nd1000 : Sub1000 -> Digits = notYet "nd1000" ; +oper nd1000000 : Sub1000000 -> Digits = notYet "nd1000000" ; +oper near_A : A = notYet "near_A" ; +oper neck_N : N = notYet "neck_N" ; +oper new_A : A = notYet "new_A" ; +oper newspaper_N : N = notYet "newspaper_N" ; +oper night_N : N = notYet "night_N" ; +oper no_Quant : Quant = notYet "no_Quant" ; +oper nobody_NP : NP = notYet "nobody_NP" ; +oper nose_N : N = notYet "nose_N" ; +oper not_Predet : Predet = notYet "not_Predet" ; +oper nothing_NP : NP = notYet "nothing_NP" ; +oper num2digits : Numeral -> Digits = notYet "num2digits" ; +oper number_N : N = notYet "number_N" ; +oper oil_N : N = notYet "oil_N" ; +oper old_A : A = notYet "old_A" ; +oper on_Prep : Prep = notYet "on_Prep" ; +oper open_V2 : V2 = notYet "open_V2" ; +oper otherwise_PConj : PConj = notYet "otherwise_PConj" ; +oper paint_V2A : V2A = notYet "paint_V2A" ; +oper paper_N : N = notYet "paper_N" ; +oper paris_PN : PN = notYet "paris_PN" ; +oper peace_N : N = notYet "peace_N" ; +oper pen_N : N = notYet "pen_N" ; +oper planet_N : N = notYet "planet_N" ; +oper plastic_N : N = notYet "plastic_N" ; +oper play_V : V = notYet "play_V" ; +oper play_V2 : V2 = notYet "play_V2" ; +oper please_Voc : Voc = notYet "please_Voc" ; +oper policeman_N : N = notYet "policeman_N" ; +oper possess_Prep : Prep = notYet "possess_Prep" ; +oper priest_N : N = notYet "priest_N" ; +oper probable_AS : A = notYet "probable_AS" ; +oper pull_V2 : V2 = notYet "pull_V2" ; +oper push_V2 : V2 = notYet "push_V2" ; +oper put_V2 : V2 = notYet "put_V2" ; +oper queen_N : N = notYet "queen_N" ; +oper question_N : N = notYet "question_N" ; +oper quite_Adv : AdA = notYet "quite_Adv" ; +oper radio_N : N = notYet "radio_N" ; +oper rain_N : N = notYet "rain_N" ; +oper rain_V0 : V = notYet "rain_V0" ; +oper read_V2 : V2 = notYet "read_V2" ; +oper ready_A : A = notYet "ready_A" ; +oper ready_VP : VP = notYet "ready_VP" ; +oper reason_N : N = notYet "reason_N" ; +oper religion_N : N = notYet "religion_N" ; +oper restaurant_N : N = notYet "restaurant_N" ; +oper right_Ord : Ord = notYet "right_Ord" ; +oper river_N : N = notYet "river_N" ; +oper road_N : N = notYet "road_N" ; +oper rock_N : N = notYet "rock_N" ; +oper roof_N : N = notYet "roof_N" ; +oper root_N : N = notYet "root_N" ; +oper rope_N : N = notYet "rope_N" ; +oper rotten_A : A = notYet "rotten_A" ; +oper round_A : A = notYet "round_A" ; +oper rub_V2 : V2 = notYet "rub_V2" ; +oper rubber_N : N = notYet "rubber_N" ; +oper rule_N : N = notYet "rule_N" ; +oper run_V : V = notYet "run_V" ; +oper salt_N : N = notYet "salt_N" ; +oper sand_N : N = notYet "sand_N" ; +oper say_VS : VS = notYet "say_VS" ; +oper scared_VP : VP = notYet "scared_VP" ; +oper school_N : N = notYet "school_N" ; +oper science_N : N = notYet "science_N" ; +oper scratch_V2 : V2 = notYet "scratch_V2" ; +oper sea_N : N = notYet "sea_N" ; +oper seed_N : N = notYet "seed_N" ; +oper seek_V2 : V2 = notYet "seek_V2" ; +oper sell_V3 : V3 = notYet "sell_V3" ; +oper send_V3 : V3 = notYet "send_V3" ; +oper sew_V : V = notYet "sew_V" ; +oper sharp_A : A = notYet "sharp_A" ; +oper sheep_N : N = notYet "sheep_N" ; +oper ship_N : N = notYet "ship_N" ; +oper shoe_N : N = notYet "shoe_N" ; +oper shop_N : N = notYet "shop_N" ; +oper silver_N : N = notYet "silver_N" ; +oper sister_N : N = notYet "sister_N" ; +oper sit_V : V = notYet "sit_V" ; +oper skin_N : N = notYet "skin_N" ; +oper sky_N : N = notYet "sky_N" ; +oper sleep_V : V = notYet "sleep_V" ; +oper smell_V : V = notYet "smell_V" ; +oper smoke_N : N = notYet "smoke_N" ; +oper smooth_A : A = notYet "smooth_A" ; +oper snake_N : N = notYet "snake_N" ; +oper snow_N : N = notYet "snow_N" ; +oper so_AdA : AdA = notYet "so_AdA" ; +oper sock_N : N = notYet "sock_N" ; +oper somebody_NP : NP = notYet "somebody_NP" ; +oper somewhere_Adv : Adv = notYet "somewhere_Adv" ; +oper song_N : N = notYet "song_N" ; +oper speak_V2 : V2 = notYet "speak_V2" ; +oper spit_V : V = notYet "spit_V" ; +oper split_V2 : V2 = notYet "split_V2" ; +oper squeeze_V2 : V2 = notYet "squeeze_V2" ; +oper stab_V2 : V2 = notYet "stab_V2" ; +oper stand_V : V = notYet "stand_V" ; +oper star_N : N = notYet "star_N" ; +oper steel_N : N = notYet "steel_N" ; +oper stick_N : N = notYet "stick_N" ; +oper stone_N : N = notYet "stone_N" ; +oper stop_V : V = notYet "stop_V" ; +oper stove_N : N = notYet "stove_N" ; +oper straight_A : A = notYet "straight_A" ; +oper student_N : N = notYet "student_N" ; +oper stupid_A : A = notYet "stupid_A" ; +oper suck_V2 : V2 = notYet "suck_V2" ; +oper sun_N : N = notYet "sun_N" ; +oper swell_V : V = notYet "swell_V" ; +oper swim_V : V = notYet "swim_V" ; +oper switch8off_V2 : V2 = notYet "switch8off_V2" ; +oper switch8on_V2 : V2 = notYet "switch8on_V2" ; +oper table_N : N = notYet "table_N" ; +oper tail_N : N = notYet "tail_N" ; +oper talk_V3 : V3 = notYet "talk_V3" ; +oper teach_V2 : V2 = notYet "teach_V2" ; +oper teacher_N : N = notYet "teacher_N" ; +oper television_N : N = notYet "television_N" ; +oper that_Subj : Subj = notYet "that_Subj" ; +oper there7from_Adv : Adv = notYet "there7from_Adv" ; +oper there7to_Adv : Adv = notYet "there7to_Adv" ; +oper there_Adv : Adv = notYet "there_Adv" ; +oper therefore_PConj : PConj = notYet "therefore_PConj" ; +oper they_Pron : Pron = notYet "they_Pron" ; +oper thick_A : A = notYet "thick_A" ; +oper thin_A : A = notYet "thin_A" ; +oper think_V : V = notYet "think_V" ; +oper thirsty_VP : VP = notYet "thirsty_VP" ; +oper through_Prep : Prep = notYet "through_Prep" ; +oper throw_V2 : V2 = notYet "throw_V2" ; +oper tie_V2 : V2 = notYet "tie_V2" ; +oper tired_VP : VP = notYet "tired_VP" ; +oper tongue_N : N = notYet "tongue_N" ; +oper too_AdA : AdA = notYet "too_AdA" ; +oper tooth_N : N = notYet "tooth_N" ; +oper train_N : N = notYet "train_N" ; +oper travel_V : V = notYet "travel_V" ; +oper tree_N : N = notYet "tree_N" ; +oper turn_V : V = notYet "turn_V" ; +oper ugly_A : A = notYet "ugly_A" ; +oper uncertain_A : A = notYet "uncertain_A" ; +oper under_Prep : Prep = notYet "under_Prep" ; +oper understand_V2 : V2 = notYet "understand_V2" ; +oper university_N : N = notYet "university_N" ; +oper village_N : N = notYet "village_N" ; +oper vomit_V : V = notYet "vomit_V" ; +oper wait_V2 : V2 = notYet "wait_V2" ; +oper walk_V : V = notYet "walk_V" ; +oper want_VV : VV = notYet "want_VV" ; +oper war_N : N = notYet "war_N" ; +oper warm_A : A = notYet "warm_A" ; +oper wash_V2 : V2 = notYet "wash_V2" ; +oper watch_V2 : V2 = notYet "watch_V2" ; +oper water_N : N = notYet "water_N" ; +oper we_Pron : Pron = notYet "we_Pron" ; +oper weather_adjCl : AP -> Cl = notYet "weather_adjCl" ; +oper wet_A : A = notYet "wet_A" ; +oper whatPl_IP : IP = notYet "whatPl_IP" ; +oper whatSg_IP : IP = notYet "whatSg_IP" ; +oper what_name_QCl : NP -> QCl = notYet "what_name_QCl" ; +oper when_IAdv : IAdv = notYet "when_IAdv" ; +oper when_Subj : Subj = notYet "when_Subj" ; +oper where_IAdv : IAdv = notYet "where_IAdv" ; +oper which_IQuant : IQuant = notYet "which_IQuant" ; +oper white_A : A = notYet "white_A" ; +oper whoPl_IP : IP = notYet "whoPl_IP" ; +oper whoSg_IP : IP = notYet "whoSg_IP" ; +oper why_IAdv : IAdv = notYet "why_IAdv" ; +oper wide_A : A = notYet "wide_A" ; +oper wife_N : N = notYet "wife_N" ; +oper win_V2 : V2 = notYet "win_V2" ; +oper wind_N : N = notYet "wind_N" ; +oper window_N : N = notYet "window_N" ; +oper wine_N : N = notYet "wine_N" ; +oper wing_N : N = notYet "wing_N" ; +oper wipe_V2 : V2 = notYet "wipe_V2" ; +oper with_Prep : Prep = notYet "with_Prep" ; +oper without_Prep : Prep = notYet "without_Prep" ; +oper wonder_VQ : VQ = notYet "wonder_VQ" ; +oper wood_N : N = notYet "wood_N" ; +oper worm_N : N = notYet "worm_N" ; +oper write_V2 : V2 = notYet "write_V2" ; +oper year_N : N = notYet "year_N" ; +oper yellow_A : A = notYet "yellow_A" ; +oper young_A : A = notYet "young_A" ; +} From 9680d0b151a598704971f4a97dc55daa991c5fe8 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Apr 2020 19:36:18 +0200 Subject: [PATCH 71/97] (Hun) New unit tests --- src/hungarian/unittest/relative.gftest | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/hungarian/unittest/relative.gftest diff --git a/src/hungarian/unittest/relative.gftest b/src/hungarian/unittest/relative.gftest new file mode 100644 index 000000000..01a9c4d85 --- /dev/null +++ b/src/hungarian/unittest/relative.gftest @@ -0,0 +1,68 @@ +------------------------------ +-- These need to be correct -- +------------------------------ + + +-- 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 + +-- 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 + +-- 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 + +-- 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 + +-- 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 + +-- 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 + +-- 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. +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 + +-- 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 + + +------------------------------------------------------------- +-- These are just for fun and lower prio to fix in grammar -- +------------------------------------------------------------- + +-- 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 + +-- LangEng: I see a man that the cat sees +-- Should this be "amit a macska lát"? +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 + +-- 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 + +-- 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 + +-- 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 + +-- 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 From 753c57296dc987c9d6d6beedc20c6ba85eaee126 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 18 Apr 2020 08:14:44 +0200 Subject: [PATCH 72/97] (Hun) New lexicon --- src/hungarian/LexiconHun.gf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 8805853bc..79336d236 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -29,14 +29,14 @@ lin bank_N = mkN "bank" ; lin beer_N = mkN "sör" ; -- lin beg_V2V = mkV2 "" ; lin belly_N = mkN "has" ; --- lin big_A = mkA "" ; +lin big_A = mkA "nagy" ; -- lin bike_N = mkN "" ; lin bird_N = mkN "madár" ; -- lin bite_V2 = mkV2 "" ; --- lin black_A = mkA "" ; +lin black_A = mkA "fekete" ; -- lin blood_N = mkN "" ; -- lin blow_V = mkV "" ; --- lin blue_A = mkA "" ; +lin blue_A = mkA "kék" ; -- lin boat_N = mkN "" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; @@ -72,7 +72,7 @@ lin city_N = mkN "város" ; -- lin clever_A = mkA "" ; -- lin close_V2 = mkV2 "" ; -- lin cloud_N = mkN "" ; --- lin coat_N = mkN "" ; +lin coat_N = mkN "kabát" ; -- lin cold_A = mkA "" ; -- lin come_V = mkV "" ; -- lin computer_N = mkN "" ; @@ -314,7 +314,7 @@ lin see_V2 = mkV2 "lát" ; -- lin sharp_A = mkA "" ; -- lin sheep_N = mkN "" fem ; -- lin ship_N = mkN "" ; --- lin shirt_N = mkN "" ; +lin shirt_N = mkN "ing" ; lin shoe_N = mkN "cipő" ; -- lin shop_N = mkN "" ; -- lin short_A = mkA "" ; From 0a21ed5e5ee5aa90f3d15808fe84e7e85c465154 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 18 Apr 2020 08:15:10 +0200 Subject: [PATCH 73/97] (Hun) Change constructor of mkDet + new Dets --- src/hungarian/ResHun.gf | 8 ++++++++ src/hungarian/StructuralHun.gf | 29 ++++++++++++++++------------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index edcf46c88..30913433b 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -68,6 +68,14 @@ oper objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object } ; + mkDet : (s : Str) -> ObjDef -> Number -> Determiner = \s,d,n -> { + s, + sp = (mkNoun s).s ! n ; + n = n ; + numtype = NoNum ; + objdef = d ; + } ; + Numeral : Type = { s : Place => Str ; -- Independent or attribute numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 6629cbc66..32161539a 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -58,17 +58,17 @@ lin all_Predet = {s = ""} ; lin not_Predet = {s = ""} ; lin only_Predet = {s = ""} ; lin most_Predet = {s = ""} ; - - -lin every_Det = -lin few_Det = -lin many_Det = -lin much_Det = - -lin somePl_Det = -lin someSg_Det = -lin no_Quant = -} + +--lin every_Det = +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 no_Quant = + lin that_Quant = mkQuant "az" "az" ; lin this_Quant = mkQuant "ez" "ez" ; {-lin which_IQuant = @@ -82,11 +82,14 @@ lin everything_NP = defNP "" N.NumSg ; lin nobody_NP = mkVerb; "" lin nothing_NP = defNP "" N.NumSg ; lin somebody_NP = defNP "" N.NumSg ; -lin something_NP = defNP "" N.NumSg ; +-} +lin something_NP = defNP "valami" Sg ; oper - defNP : Str -> Num -> NP = {} ; --} + defNP : Str -> Number -> NP = \s,n -> emptyNP ** { + s = (mkNoun s).s ! n ; + n = n + } ; ------- -- Prep From f26b10a8b3527dd0738869bb0d9b7b9879edafa7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 18 Apr 2020 08:15:20 +0200 Subject: [PATCH 74/97] (Hun) Add UttIP --- src/hungarian/MissingHun.gf | 1 - src/hungarian/PhraseHun.gf | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hungarian/MissingHun.gf b/src/hungarian/MissingHun.gf index e6e198a9a..b060230d4 100644 --- a/src/hungarian/MissingHun.gf +++ b/src/hungarian/MissingHun.gf @@ -104,7 +104,6 @@ oper Use3N3 : N3 -> N2 = notYet "Use3N3" ; oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ; oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ; oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ; -oper UttIP : IP -> Utt = notYet "UttIP" ; oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ; oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ; oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ; diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index a96c97377..14fcb2cab 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -10,10 +10,9 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { UttImpSg pol imp = UttImpPl pol imp = UttImpPol = UttImpSg ; - - UttIP ip = {s = ip.s ! } ; -} - UttNP np = {s = np.s ! Nom} ; + UttIP, + UttNP = \np -> {s = np.s ! Nom} ; UttVP vp = {s = vp.obj ++ vp.adv ++ vp.s ! VInf} ; UttAdv adv = adv ; UttCN cn = {s = cn.s ! Sg ! Nom} ; From 18a763d764b97b77839c719648671246c35b0e59 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 18 Apr 2020 08:21:46 +0200 Subject: [PATCH 75/97] (Hun) New paradigms for PN --- src/hungarian/ParadigmsHun.gf | 13 +++++++++++-- src/hungarian/ResHun.gf | 5 +++++ src/hungarian/StructuralHun.gf | 6 ------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index a8783faa8..247fe301f 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -22,6 +22,12 @@ oper mkN : (férfi : Str) -> (harm : Harmony) -> (ak : Str) -> N ; -- Noun with unpredictable vowel harmony and plural allomorph } ; + mkPN : overload { + mkPN : Str -> PN ; -- Singular PN out of a string + mkPN : Str -> Number -> PN -- PN with a given number + -- mkPN : N -> Number -> PN ; + } ; + --2 Adjectives mkA : overload { @@ -127,8 +133,11 @@ oper mkN2 : N -> N2 = \n -> lin N2 n ; } ; - -- mkPN = overload { - -- } ; + mkPN = overload { + mkPN : Str -> PN = \s -> lin PN (defNP s Sg) ; + mkPN : Str -> Number -> PN = \s,n -> lin PN (defNP s n) ; + -- mkPN : N -> Number -> PN ; + } ; mkA = overload { mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 30913433b..4d6697933 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -32,6 +32,11 @@ oper indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ; + defNP : Str -> Number -> NounPhrase = \s,n -> emptyNP ** { + s = (mkNoun s).s ! n ; + n = n ; + objdef = Def ; + } ; -------------------------------------------------------------------------------- -- Pronouns diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 32161539a..c74115449 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -85,12 +85,6 @@ lin somebody_NP = defNP "" N.NumSg ; -} lin something_NP = defNP "valami" Sg ; -oper - defNP : Str -> Number -> NP = \s,n -> emptyNP ** { - s = (mkNoun s).s ! n ; - n = n - } ; - ------- -- Prep From f554187f77c578c8cafc0058d935813e353c99d3 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 18 Apr 2020 08:59:12 +0200 Subject: [PATCH 76/97] (Hun) New tests --- src/hungarian/unittest/dative.gftest | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hungarian/unittest/dative.gftest b/src/hungarian/unittest/dative.gftest index 2e81c531a..053202000 100644 --- a/src/hungarian/unittest/dative.gftest +++ b/src/hungarian/unittest/dative.gftest @@ -5,3 +5,11 @@ LangHun: nekem van egy macska -- 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 + +-- 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 macska + +-- 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 vannak némelyek macskák From 1eabf5c8637286a64c2394503de11a4197bf6c2e Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Sat, 18 Apr 2020 09:07:51 +0200 Subject: [PATCH 77/97] initialized Slovak (Slo) by cloning from Czech --- src/api/CombinatorsSlo.gf | 9 + src/api/ConstructorsSlo.gf | 5 + src/api/SymbolicSlo.gf | 6 + src/api/SyntaxSlo.gf | 4 + src/api/TrySlo.gf | 13 + src/slovak/AdjectiveSlo.gf | 23 + src/slovak/AdverbSlo.gf | 9 + src/slovak/AllSlo.gf | 6 + src/slovak/AllSloAbs.gf | 6 + src/slovak/CatSlo.gf | 70 +++ src/slovak/ConjunctionSlo.gf | 56 +++ src/slovak/GrammarSlo.gf | 19 + src/slovak/IdiomSlo.gf | 5 + src/slovak/LangSlo.gf | 10 + src/slovak/LexiconSlo.gf | 59 +++ src/slovak/MissingSlo.gf | 102 ++++ src/slovak/NounSlo.gf | 100 ++++ src/slovak/NumeralSlo.gf | 120 +++++ src/slovak/ParadigmsSlo.gf | 141 ++++++ src/slovak/PhraseSlo.gf | 19 + src/slovak/QuestionSlo.gf | 7 + src/slovak/RelativeSlo.gf | 18 + src/slovak/ResSlo.gf | 885 +++++++++++++++++++++++++++++++++++ src/slovak/SentenceSlo.gf | 32 ++ src/slovak/StructuralSlo.gf | 27 ++ src/slovak/SymbolSlo.gf | 11 + src/slovak/TenseSlo.gf | 20 + src/slovak/TextSlo.gf | 8 + src/slovak/VerbSlo.gf | 48 ++ 29 files changed, 1838 insertions(+) create mode 100644 src/api/CombinatorsSlo.gf create mode 100644 src/api/ConstructorsSlo.gf create mode 100644 src/api/SymbolicSlo.gf create mode 100644 src/api/SyntaxSlo.gf create mode 100644 src/api/TrySlo.gf create mode 100644 src/slovak/AdjectiveSlo.gf create mode 100644 src/slovak/AdverbSlo.gf create mode 100644 src/slovak/AllSlo.gf create mode 100644 src/slovak/AllSloAbs.gf create mode 100644 src/slovak/CatSlo.gf create mode 100644 src/slovak/ConjunctionSlo.gf create mode 100644 src/slovak/GrammarSlo.gf create mode 100644 src/slovak/IdiomSlo.gf create mode 100644 src/slovak/LangSlo.gf create mode 100644 src/slovak/LexiconSlo.gf create mode 100644 src/slovak/MissingSlo.gf create mode 100644 src/slovak/NounSlo.gf create mode 100644 src/slovak/NumeralSlo.gf create mode 100644 src/slovak/ParadigmsSlo.gf create mode 100644 src/slovak/PhraseSlo.gf create mode 100644 src/slovak/QuestionSlo.gf create mode 100644 src/slovak/RelativeSlo.gf create mode 100644 src/slovak/ResSlo.gf create mode 100644 src/slovak/SentenceSlo.gf create mode 100644 src/slovak/StructuralSlo.gf create mode 100644 src/slovak/SymbolSlo.gf create mode 100644 src/slovak/TenseSlo.gf create mode 100644 src/slovak/TextSlo.gf create mode 100644 src/slovak/VerbSlo.gf diff --git a/src/api/CombinatorsSlo.gf b/src/api/CombinatorsSlo.gf new file mode 100644 index 000000000..ef7fe69b4 --- /dev/null +++ b/src/api/CombinatorsSlo.gf @@ -0,0 +1,9 @@ +--# -path=.:alltenses:prelude + +resource CombinatorsSlo = Combinators with + (Cat = CatSlo), + (Structural = StructuralSlo), + (Constructors = ConstructorsSlo) + ** open MissingSlo in {} + + diff --git a/src/api/ConstructorsSlo.gf b/src/api/ConstructorsSlo.gf new file mode 100644 index 000000000..144198d76 --- /dev/null +++ b/src/api/ConstructorsSlo.gf @@ -0,0 +1,5 @@ +--# -path=.:alltenses:prelude + +resource ConstructorsSlo = Constructors with (Grammar = GrammarSlo) + ** open MissingSlo in {} + diff --git a/src/api/SymbolicSlo.gf b/src/api/SymbolicSlo.gf new file mode 100644 index 000000000..804ccf992 --- /dev/null +++ b/src/api/SymbolicSlo.gf @@ -0,0 +1,6 @@ +--# -path=.:../slovak:../common:../abstract:../prelude + +resource SymbolicSlo = Symbolic with + (Symbol = SymbolSlo), + (Grammar = GrammarSlo) + ** open MissingSlo in {} diff --git a/src/api/SyntaxSlo.gf b/src/api/SyntaxSlo.gf new file mode 100644 index 000000000..48fddc911 --- /dev/null +++ b/src/api/SyntaxSlo.gf @@ -0,0 +1,4 @@ +--# -path=.:./alltenses:../prelude + +instance SyntaxSlo of Syntax = + ConstructorsSlo, CatSlo, StructuralSlo, CombinatorsSlo ; diff --git a/src/api/TrySlo.gf b/src/api/TrySlo.gf new file mode 100644 index 000000000..c81174a13 --- /dev/null +++ b/src/api/TrySlo.gf @@ -0,0 +1,13 @@ +--# -path=.:../slovak:../common:../abstract:../prelude + +resource TrySlo = SyntaxSlo, LexiconSlo, ParadigmsSlo -[mkAdv, mkDet,mkQuant]** + open (P = ParadigmsSlo) in { + +-- oper + +-- mkAdv = overload SyntaxSlo { +-- mkAdv : Str -> Adv = P.mkAdv ; +-- } ; + +} + diff --git a/src/slovak/AdjectiveSlo.gf b/src/slovak/AdjectiveSlo.gf new file mode 100644 index 000000000..623faa7e6 --- /dev/null +++ b/src/slovak/AdjectiveSlo.gf @@ -0,0 +1,23 @@ +concrete AdjectiveSlo of Adjective = CatSlo ** open ResSlo, Prelude in { + + lin + + PositA a = adjFormsAdjective a ** {isPost = False} ; + + AdAP ada ap = ap ** {s = \\g,n,c => ada.s ++ ap.s ! g ! n ! c} ; + + ComplA2 a np = + let ap = adjFormsAdjective a + in + ap ** { + s = \\g,n,c => ap.s ! g ! n ! c ++ a.c.s ++ np.s ! a.c.c ; + isPost = True ; + } ; + + UseA2 a = adjFormsAdjective a ** {isPost = False} ; + + UseComparA a = adjFormsAdjective a ** {isPost = False} ; ---- TODO: this gives positive forms + + AdvAP ap adv = ap ** {s = \\g,n,c => ap.s ! g ! n ! c ++ adv.s} ; + +} diff --git a/src/slovak/AdverbSlo.gf b/src/slovak/AdverbSlo.gf new file mode 100644 index 000000000..6b993fb5d --- /dev/null +++ b/src/slovak/AdverbSlo.gf @@ -0,0 +1,9 @@ +concrete AdverbSlo of Adverb = CatSlo ** + open ResSlo, Prelude in { + +lin + PrepNP prep np = { + s = prep.s ++ np.prep ! prep.c + } ; + +} diff --git a/src/slovak/AllSlo.gf b/src/slovak/AllSlo.gf new file mode 100644 index 000000000..021062dad --- /dev/null +++ b/src/slovak/AllSlo.gf @@ -0,0 +1,6 @@ +--# -path=.:../abstract:../common:../api + +concrete AllSlo of AllSloAbs = + LangSlo + ; + diff --git a/src/slovak/AllSloAbs.gf b/src/slovak/AllSloAbs.gf new file mode 100644 index 000000000..f7eaf6830 --- /dev/null +++ b/src/slovak/AllSloAbs.gf @@ -0,0 +1,6 @@ +--# -path=.:../abstract:../common:prelude + +abstract AllSloAbs = + Lang + ; + diff --git a/src/slovak/CatSlo.gf b/src/slovak/CatSlo.gf new file mode 100644 index 000000000..2f737358d --- /dev/null +++ b/src/slovak/CatSlo.gf @@ -0,0 +1,70 @@ +concrete CatSlo of Cat = +--- CommonX ** + + open ResSlo, Prelude in { + + lincat + Text = {s : Str} ; + Phr = {s : Str} ; + Utt = {s : Str} ; + + S = {s : Str} ; + Cl = {subj,clit,compl : Str ; verb : VerbForms ; a : Agr} ; + Comp = {s : Agr => Str} ; + + QS = {s : Str} ; ---- TODO: indirect questions + QCl = {subj,clit,compl : Str ; verb : VerbForms ; a : Agr} ; -- = Cl ---- check if enough + IAdv = {s : Str} ; + + RS = {s : Agr => Str} ; + RCl = {subj,clit,compl : Agr => Str ; verb : VerbForms} ; ---- RAgr with composite RP + RP = AdjForms ; + + VP = {verb : VerbForms ; clit,compl : Agr => Str} ; ---- more fields probably needed + VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ---- + V = ResSlo.VerbForms ; + V2 = ResSlo.VerbForms ** {c : ComplementCase} ; + + A = ResSlo.AdjForms ; + AP = ResSlo.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str} + A2 = ResSlo.AdjForms ** {c : ComplementCase} ; + + AdA = {s : Str} ; + + N = ResSlo.NounForms ; + CN = ResSlo.Noun ; -- {s : Number => Case => Str ; g : Gender} + NP = {s,clit,prep : Case => Str ; a : Agr ; hasClit : Bool} ; -- clit,prep differ for pronouns + PN = {s : Case => Str ; g : Gender} ; + Det = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; -- can contain a numeral, therefore NumSize + Quant = {s : Gender => Number => Case => Str} ; -- same as AP + Num = Determiner ; + Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; + Pron = PronForms ; + + Adv = {s : Str} ; + Prep = ResSlo.ComplementCase ; -- {s : Str ; c : Case ; hasPrep : Bool} ; + Conj = {s1,s2 : Str} ; ---- may need a number + + Pol = {s : Str ; p : Bool} ; + Temp = {s : Str ; t : CTense} ; + Tense = {s : Str ; t : CTense} ; + Ant = {s : Str ; t : CTense} ; + + PConj = {s : Str} ; + Voc = {s : Str} ; + + AdN = {s : Str} ; + AdV = {s : Str} ; + CAdv = {s : Str} ; + SC = {s : Str} ; + + linref + N = \s -> s.snom ; + A = \s -> s.msnom ; + + + lincat Numeral = Determiner ; ---- TODO: should contain Ord as well + lincat Digits = {s:Str ; size : NumSize} ; + + +} diff --git a/src/slovak/ConjunctionSlo.gf b/src/slovak/ConjunctionSlo.gf new file mode 100644 index 000000000..085254168 --- /dev/null +++ b/src/slovak/ConjunctionSlo.gf @@ -0,0 +1,56 @@ +concrete ConjunctionSlo of Conjunction = CatSlo ** + open ResSlo, Coordination, Prelude in { + + lincat + [Adv] = {s1,s2 : Str} ; + [AP] = {s1,s2 : Gender => Number => Case => Str ; isPost : Bool} ; + [NP] = {s1,s2,prep1,prep2 : Case => Str ; a : Agr} ; + [S] = {s1,s2 : Str} ; + [RS] = {s1,s2 : Agr => Str} ; + + lin + BaseAdv = twoSS ; + ConsAdv = consrSS comma ; + + BaseAP x y = twoTable3 Gender Number Case x y + ** {isPost = orB x.isPost y.isPost} ; ---- should be so in Pol too + ConsAP x xs = consrTable3 Gender Number Case comma x xs + ** {isPost = orB x.isPost xs.isPost} ; + + BaseNP x y = { + s1 = x.s ; + s2 = y.s ; + prep1 = x.prep ; + prep2 = y.prep ; + a = y.a + } ; -- clitics disappear ---- Agr TODO + ConsNP x xs = { + s1 = \\c => x.s ! c ++ comma ++ xs.s1 ! c ; + s2 = xs.s2 ; + prep1 = \\c => x.prep ! c ++ comma ++ xs.prep1 ! c ; + prep2 = xs.prep2 ; + a = xs.a ---- + } ; + + BaseS = twoSS ; + ConsS = consrSS comma ; + + BaseRS = twoTable Agr ; + ConsRS = consrTable Agr comma ; + + ConjAdv = conjunctDistrSS ; + + ConjAP conj xs = conjunctDistrTable3 Gender Number Case conj xs + ** {isPost = xs.isPost} ; + + ConjNP conj xs = { + s,clit = \\c => conj.s1 ++ xs.s1 ! c ++ conj.s2 ++ xs.s2 ! c ; + prep = \\c => conj.s1 ++ xs.prep1 ! c ++ conj.s2 ++ xs.prep2 ! c ; + a = xs.a ; ---- dep. on conj as well + hasClit = False ; + } ; + + ConjS = conjunctDistrSS ; + ConjRS = conjunctDistrTable Agr ; + +} diff --git a/src/slovak/GrammarSlo.gf b/src/slovak/GrammarSlo.gf new file mode 100644 index 000000000..b711fba9d --- /dev/null +++ b/src/slovak/GrammarSlo.gf @@ -0,0 +1,19 @@ +--# -path=.:../abstract:../common:prelude + +concrete GrammarSlo of Grammar = + NounSlo, + VerbSlo, + AdjectiveSlo, + AdverbSlo, + NumeralSlo, + SentenceSlo, + QuestionSlo, + RelativeSlo, + ConjunctionSlo, + PhraseSlo, + TextSlo, + StructuralSlo, + IdiomSlo, + TenseSlo + ** { +} diff --git a/src/slovak/IdiomSlo.gf b/src/slovak/IdiomSlo.gf new file mode 100644 index 000000000..4f5f867d3 --- /dev/null +++ b/src/slovak/IdiomSlo.gf @@ -0,0 +1,5 @@ +concrete IdiomSlo of Idiom = CatSlo ** open Prelude, ResSlo in { + + + +} diff --git a/src/slovak/LangSlo.gf b/src/slovak/LangSlo.gf new file mode 100644 index 000000000..55fcce474 --- /dev/null +++ b/src/slovak/LangSlo.gf @@ -0,0 +1,10 @@ +--# -path=.:../abstract:../common:../api + +concrete LangSlo of Lang = + GrammarSlo, + LexiconSlo +-- ,ConstructionSlo +-- ,DocumentationSlo --# notpresent + ** { + +} diff --git a/src/slovak/LexiconSlo.gf b/src/slovak/LexiconSlo.gf new file mode 100644 index 000000000..e4e27d48d --- /dev/null +++ b/src/slovak/LexiconSlo.gf @@ -0,0 +1,59 @@ +concrete LexiconSlo of Lexicon = + CatSlo + ** + open + ResSlo, ParadigmsSlo + in { + + lin + boy_N = declPAN "kluk" ; + man_N = declMUZ "muž" ; + teacher_N = declMUZ "učitel" ; + horse_N = declMUZ "kůň" ; + father_N = declMUZ "otec" ; + husband_N = declPAN "manžel" ; + + castle_N = declHRAD "hrad" ; + forest_N = declHRAD "les" ; + machine_N = declSTROJ "stroj" ; + + woman_N = declZENA "žena" ; + school_N = declZENA "škola" ; ---- + skirt_N = declRUZE "sukně"; + street_N = declRUZE "ulice" ; + rose_N = declRUZE "růže" ; + song_N = declPISEN "píseň" ; + bed_N = declPISEN "postel" ; + door_N = declRUZE "dveře" ; + bone_N = declKOST "kost" ; + village_N = declKOST "ves" ; ---- + + city_N = declMESTO "město" ; + apple_N = declMESTO "jablko" ; ---- + sea_N = declMORE "moře" ; + airport_N = declMORE "letiště" ; + chicken_N = declKURE "kuře" ; + house_N = declSTAVENI "stavení" ; --- building, house + station_N = declSTAVENI "nádraží" ; + + young_A = mkA "mladý" ; + old_A = mkA "starý" ; + good_A = mkA "dobrý" ; + bad_A = mkA "špatný" ; + beautiful_A = mkA "krásný" ; + clean_A = mkA "čistý" ; + dirty_A = mkA "špinavý" ; + + white_A = mkA "bílý" ; + black_A = mkA "černý" ; + red_A = mkA "červený" ; + brown_A = mkA "hnědý" ; + blue_A = mkA "modrý" ; + green_A = mkA "zelený" ; + yellow_A = mkA "žlutý" ; + + buy_V2 = mkV2 (iii_kupovatVerbForms "kupovat") ; + love_V2 = mkV2 (iii_kupovatVerbForms "milovat") ; + +} + diff --git a/src/slovak/MissingSlo.gf b/src/slovak/MissingSlo.gf new file mode 100644 index 000000000..4408f8f2c --- /dev/null +++ b/src/slovak/MissingSlo.gf @@ -0,0 +1,102 @@ +resource MissingSlo = open GrammarSlo, Prelude in { + +-- temporary definitions to enable the compilation of RGL API +oper AAnter : Ant = notYet "AAnter" ; +oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ; +oper AdNum : AdN -> Card -> Card = notYet "AdNum" ; +oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ; +oper AdjOrd : Ord -> AP = notYet "AdjOrd" ; +oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ; +oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ; +oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ; +oper AdvS : Adv -> S -> S = notYet "AdvS" ; +oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ; +oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ; +oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ; +oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ; +oper CompCN : CN -> Comp = notYet "CompCN" ; +oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ; +oper CompIP : IP -> IComp = notYet "CompIP" ; +oper ComparA : A -> NP -> AP = notYet "ComparA" ; +oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ; +oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ; +oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ; +oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ; +oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ; +oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ; +oper ComplVS : VS -> S -> VP = notYet "ComplVS" ; +oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ; +oper DetNP : Det -> NP = notYet "DetNP" ; +oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ; +oper EmbedQS : QS -> SC = notYet "EmbedQS" ; +oper EmbedS : S -> SC = notYet "EmbedS" ; +oper EmbedVP : VP -> SC = notYet "EmbedVP" ; +oper ExistIP : IP -> QCl = notYet "ExistIP" ; +oper ExistNP : NP -> Cl = notYet "ExistNP" ; +oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ; +oper GenericCl : VP -> Cl = notYet "GenericCl" ; +oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ; +oper IdetIP : IDet -> IP = notYet "IdetIP" ; +oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ; +oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ; +oper ImpVP : VP -> Imp = notYet "ImpVP" ; +oper ImpersCl : VP -> Cl = notYet "ImpersCl" ; +oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ; +oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ; +oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ; +oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ; +oper PassV2 : V2 -> VP = notYet "PassV2" ; +oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ; +oper PossPron : Pron -> Quant = notYet "PossPron" ; +oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ; +oper PredetNP : Predet -> NP -> NP = notYet "PredetNP" ; +oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ; +oper ProgrVP : VP -> VP = notYet "ProgrVP" ; +oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ; +oper QuestIComp : IComp -> NP -> QCl = notYet "QuestIComp" ; +oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ; +oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ; +oper ReflA2 : A2 -> AP = notYet "ReflA2" ; +oper ReflVP : VPSlash -> VP = notYet "ReflVP" ; +oper RelCl : Cl -> RCl = notYet "RelCl" ; +oper RelNP : NP -> RS -> NP = notYet "RelNP" ; +oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ; +oper SentAP : AP -> SC -> AP = notYet "SentAP" ; +oper SentCN : CN -> SC -> CN = notYet "SentCN" ; +oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ; +oper Slash3V3 : V3 -> NP -> VPSlash = notYet "Slash3V3" ; +oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ; +oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ; +oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ; +oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ; +oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ; +oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ; +oper SlashVP : NP -> VPSlash -> ClSlash = notYet "SlashVP" ; +oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ; +oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ; +oper SubjS : Subj -> S -> Adv = notYet "SubjS" ; +oper TCond : Tense = notYet "TCond" ; +oper TFut : Tense = notYet "TFut" ; +oper TPast : Tense = notYet "TPast" ; +oper Use2N3 : N3 -> N2 = notYet "Use2N3" ; +oper UseN2 : N2 -> CN = notYet "UseN2" ; +oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ; +oper UttCard : Card -> Utt = notYet "UttCard" ; +oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ; +oper UttIP : IP -> Utt = notYet "UttIP" ; +oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ; +oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ; +oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ; +oper UttQS : QS -> Utt = notYet "UttQS" ; +oper UttVP : VP -> Utt = notYet "UttVP" ; +oper by8agent_Prep : Prep = notYet "by8agent_Prep" ; +oper it_Pron : Pron = notYet "it_Pron" ; +oper they_Pron : Pron = notYet "they_Pron" ; +oper we_Pron : Pron = notYet "we_Pron" ; +oper whatSg_IP : IP = notYet "whatSg_IP" ; +oper which_IQuant : IQuant = notYet "which_IQuant" ; +oper whoSg_IP : IP = notYet "whoSg_IP" ; +oper youPl_Pron : Pron = notYet "youPl_Pron" ; +oper youPol_Pron : Pron = notYet "youPol_Pron" ; + +} diff --git a/src/slovak/NounSlo.gf b/src/slovak/NounSlo.gf new file mode 100644 index 000000000..2e60e38a8 --- /dev/null +++ b/src/slovak/NounSlo.gf @@ -0,0 +1,100 @@ +concrete NounSlo of Noun = + CatSlo +** + + open ResSlo, Prelude in { + +lin + DetCN det cn = { + s,prep,clit = \\c => det.s ! cn.g ! c ++ numSizeForm cn.s det.size c ; + a = numSizeAgr cn.g det.size P3 ; + hasClit = False ; + } ; + + MassNP cn = { + s,prep,clit = \\c => cn.s ! Sg ! c ; + a = Ag cn.g Sg P3 ; + hasClit = False ; + } ; + + DetQuant quant num = { + s = \\g,c => num.s ! g ! c ++ quant.s ! g ! numSizeNumber num.size ! c ; + size = num.size + } ; + + DefArt = {s = \\_,_,_ => []} ; + IndefArt = {s = \\_,_,_ => []} ; + NumPl = {s = \\_,_ => [] ; size = Num2_4} ; ---- size + NumSg = {s = \\_,_ => [] ; size = Num1} ; + + UsePron pron = { + s = table { + Nom | Voc => pron.nom ; + Gen => pron.gen ; + Dat => pron.dat ; + Acc => pron.acc ; + Loc => pron.loc ; + Ins => pron.ins + } ; + clit = table { + Nom => pron.cnom ; + Voc => pron.nom ; + Gen => pron.cgen ; + Dat => pron.cdat ; + Acc => pron.cacc ; + Loc => pron.loc ; + Ins => pron.ins + } ; + prep = table { + Nom | Voc => pron.nom ; + Gen => pron.pgen ; + Dat => pron.pdat ; + Acc => pron.pacc ; + Loc => pron.loc ; + Ins => pron.pins + } ; + a = pron.a ; + hasClit = True ; + } ; + + UsePN pn = { + s,clit,prep = \\c => pn.s ! c ; + a = Ag pn.g Sg P3 ; + hasClit = False ; + } ; + + AdjCN ap cn = { + s = \\n,c => ap.s ! cn.g ! n ! c ++ cn.s ! n ! c ; + g = cn.g + } ; + + RelCN cn rs = { + s = \\n,c => cn.s ! n ! c ++ rs.s ! Ag cn.g n P3 ; + g = cn.g + } ; + + AdvCN cn adv = { + s = \\n,c => cn.s ! n ! c ++ adv.s ; + g = cn.g + } ; + + AdvNP np adv = { + s,clit = \\c => np.s ! c ++ adv.s ; + prep = \\c => np.prep ! c ++ adv.s ; + a = np.a ; + hasClit = False ; + } ; + + UseN n = nounFormsNoun n ; + + ApposCN cn np = { + s = \\n,c => cn.s ! n ! c ++ np.s ! c ; ---- TODO check apposition order + g = cn.g + } ; + + NumCard c = c ; + NumDigits ds = ds ** {s = \\_,_ => ds.s} ; + NumNumeral nu = nu ; + + +} diff --git a/src/slovak/NumeralSlo.gf b/src/slovak/NumeralSlo.gf new file mode 100644 index 000000000..19538c46e --- /dev/null +++ b/src/slovak/NumeralSlo.gf @@ -0,0 +1,120 @@ +concrete NumeralSlo of Numeral = + + CatSlo ** + + open + ResSlo, + Prelude + in { + +-- from gf-contrib/numerals/czech.gf, added inflections +-- AR 2020-03-20 +---- TODO ordinal forms + + +oper LinNumeral = Determiner ; -- {s : NumeralForms ; size : NumSize} ; +oper LinDigit = {unit : Gender => Case => Str ; teen, ten, hundred : Str ; size : NumSize} ; + +lincat Digit = LinDigit ; +lincat Sub10 = LinDigit ; + +lincat Sub100 = LinNumeral ; +lincat Sub1000 = LinNumeral ; +lincat Sub1000000 = LinNumeral ; + +oper mkNum : Determiner -> Str -> Str -> Str -> LinDigit = + \dva, dvanast, dvadsat, dveste -> { + unit = dva.s ; + teen = dvanast + "náct" ; + ten = dvadsat ; + hundred = dveste ; + size = dva.size ; + } ; + +oper mk2Num : Determiner -> Str -> Str -> Str -> LinDigit = + \unit, teenbase, tenbase, hundred -> + mkNum unit teenbase (tenbase + "cet") hundred ; + +oper mk5Num : Str -> Str -> Str -> Str -> LinDigit = + \unit,uniti, teenbase, tenbase -> + mkNum (regNumeral unit uniti) teenbase (tenbase + "desát") (unit ++ "set") ; + +oper bigNumeral : Str -> LinNumeral = \s -> invarNumeral s ; + +lin num x = x ; + +lin n2 = mk2Num twoNumeral "dva" "dva" ("dvě" ++ "stě") ; +lin n3 = mk2Num threeNumeral "tři" "tři" ("tři" ++ "sta") ; +lin n4 = mk2Num fourNumeral "čtr" "čtyři" ("čtyři" ++ "sta") ; +lin n5 = mk5Num "pět" "pěti" "pat" "pa" ; +lin n6 = mk5Num "šest" "šesti" "šest" "še" ; +lin n7 = mk5Num "sedm" "sedmi" "sedm" "sedm"; +lin n8 = mk5Num "osm" "osmi" "osm" "osm"; +lin n9 = mk5Num "devět" "devíti" "devate" "deva" ; + +lin pot01 = { + unit = oneNumeral.s ; hundred = "sto" ; ten = "deset" ; teen = "jedenáct" ; + size = Num1 + } ; +lin pot0 d = d ; + +lin pot110 = bigNumeral "deset" ; +lin pot111 = bigNumeral "jedenáct" ; +lin pot1to19 d = bigNumeral d.teen ; + +lin pot0as1 n = {s = n.unit ; size = n.size} ; +lin pot1 d = bigNumeral d.ten ; +lin pot1plus d e = { + s = (invarNumeral (d.ten ++ determinerStr (e ** {s = e.unit}))).s ; ---- TODO inflection? + size = tfSize e.size + } ; + ---- variants { d.s ! ten ++ e.s ! unit ; glue (glue (e.s ! unit) "a") (d.s ! ten)} ; size = tfSize e.size} ; + +lin pot1as2 n = n ; +lin pot2 d = bigNumeral d.hundred ; +lin pot2plus d e = { + s = (invarNumeral (d.hundred ++ determinerStr e)).s ; ---- TODO inflection? + size = tfSize e.size + } ; + +lin pot2as3 n = n ; +lin pot3 n = bigNumeral (mkTh (determinerStr n) n.size) ; + +lin pot3plus n m = { + s = (invarNumeral (mkTh (determinerStr n) n.size ++ determinerStr m)).s ; ---- TODO inflection? + size = tfSize m.size + } ; + +oper tfSize : NumSize -> NumSize = \sz -> + table {Num1 => Num5 ; other => other} ! sz ; + +oper mkTh : Str -> NumSize -> Str = \attr,size -> + case size of { + Num1 => "tisíc" ; + Num2_4 => attr ++ "tisíce" ; + Num5 => attr ++ "tisíc" + } ; + +oper determinerStr : Determiner -> Str = \d -> d.s ! Masc Anim ! Nom ; + + +-- -- Numerals as sequences of digits have a separate, simpler grammar + lincat Dig = {s:Str ; size : NumSize} ; + + lin + IDig d = d ; + + IIDig d dd = {s = d.s ++ Predef.BIND ++ dd.s ; size = Num5} ; ---- leading zeros ?? + + D_0 = { s = "0" ; size = Num1} ; ---- ?? + D_1 = { s = "1" ; size = Num1} ; + D_2 = { s = "2" ; size = Num2_4} ; + D_3 = { s = "3" ; size = Num2_4} ; + D_4 = { s = "4" ; size = Num2_4} ; + D_5 = { s = "5" ; size = Num5} ; + D_6 = { s = "6" ; size = Num5} ; + D_7 = { s = "7" ; size = Num5} ; + D_8 = { s = "8" ; size = Num5} ; + D_9 = { s = "9" ; size = Num5} ; + +} diff --git a/src/slovak/ParadigmsSlo.gf b/src/slovak/ParadigmsSlo.gf new file mode 100644 index 000000000..542d3a931 --- /dev/null +++ b/src/slovak/ParadigmsSlo.gf @@ -0,0 +1,141 @@ +resource ParadigmsSlo = open CatSlo, ResSlo, Prelude in { + +---------------- +-- Parameters + +oper + singular : Number + = Sg ; + plural : Number + = Pl ; + + mascAnimate : Gender + = Masc Anim ; + mascInanimate : Gender + = Masc Inanim ; + feminine : Gender + = Fem ; + neuter : Gender + = Neutr ; + + nominative : Case + = Nom ; + genitive : Case + = Gen ; + dative : Case + = Dat ; + accusative : Case + = Acc ; + vocative : Case + = ResSlo.Voc ; + locative : Case + = Loc ; + instrumental : Case + = Ins ; + +------------------------------ +-- Nouns + +oper + mkN = overload { + mkN : (nom : Str) -> N + = \nom -> lin N (guessNounForms nom) ; + mkN : (nom,gen : Str) -> Gender -> N + = \nom,gen,g -> lin N (declensionNounForms nom gen g) ; + } ; + +-- The following standard declensions can be used with good accuracy. +-- However, they have some defaults that may have to be overwritten. +-- This can be done easily by overriding those formes with record extension (**). +-- The default extensions are shown in comments; if the default is correct, no extension is needed. + + panN : Str -> N -- default ** {pnom = +i} + = \s -> lin N (declPAN s) ; + predsedaN : Str -> N -- default ** {sgen = +i} + = \s -> lin N (declPREDSEDA s) ; + hradN : Str -> N -- default ** {sgen,sloc = +u} + = \s -> lin N (declHRAD s) ; + zenaN : Str -> N -- default ** {pgen = zen} + = \s -> lin N (declZENA s) ; + mestoN : Str -> N -- default ** {sloc = +u ; pgen = mest ; ploc = +ech} + = \s -> lin N (declMESTO s) ; + muzN : Str -> N + = \s -> lin N (declMUZ s) ; + soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i} + = \s -> lin N (declSOUDCE s) ; + strojN : Str -> N + = \s -> lin N (declSTROJ s) ; + ruzeN : Str -> N + = \s -> lin N (declRUZE s) ; + pisenN : Str -> N + = \s -> lin N (declPISEN s) ; + kostN : Str -> N + = \s -> lin N (declKOST s) ; + kureN : Str -> N + = \s -> lin N (declKURE s) ; + moreN : Str -> N -- default ** {pgen = +í} + = \s -> lin N (declMORE s) ; + staveniN : Str -> N + = \s -> lin N (declSTAVENI s) ; + +-- The full definition of the noun record is +-- { +-- snom,sgen,sdat,sacc,svoc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ; +-- g : Gender +-- } + + +--------------------- +-- Adjectives + +-- Only positive forms so far ---- + + mkA = overload { + mkA : Str -> A + = \s -> lin A (case s of { + _ + "ý" => mladyAdjForms s ; + _ + "í" => jarniAdjForms s ; + _ + "ův" => otcuvAdjForms s ; + _ + "in" => matcinAdjForms s ; + _ => Predef.error ("no mkA for" ++ s) + }) ; + } ; + + mladyA : Str -> A + = \s -> lin A (mladyAdjForms s) ; + jarniA : Str -> A + = \s -> lin A (jarniAdjForms s) ; + otcuvA : Str -> A + = \s -> lin A (otcuvAdjForms s) ; + matcinA : Str -> A + = \s -> lin A (matcinAdjForms s) ; + + mkA2 : A -> Prep -> A2 + = \a,p -> lin A2 (a ** {c = p}) ; + +------------------------- +-- Verbs + + mkV2 = overload { + mkV2 : VerbForms -> VerbForms ** {c : ComplementCase} + = \vf -> vf ** {c = {s = [] ; c = Acc ; hasPrep = False}} ; + mkV2 : VerbForms -> Case -> VerbForms ** {c : ComplementCase} + = \vf,c -> vf ** {c = {s = [] ; c = c ; hasPrep = False}} ; + mkV2 : VerbForms -> ComplementCase -> VerbForms ** {c : ComplementCase} + = \vf,c -> vf ** {c = c} ; + } ; + +------------------------ +-- Adverbs, prepositions, conjunctions, ... + + mkAdv : Str -> Adv + = \s -> lin Adv {s = s} ; + + mkPrep : Str -> Case -> Prep + = \s,c -> lin Prep {s = s ; c = c ; hasPrep = True} ; ---- True if s /= "" + + mkConj : Str -> Conj + = \s -> lin Conj {s1 = [] ; s2 = s} ; + + +} diff --git a/src/slovak/PhraseSlo.gf b/src/slovak/PhraseSlo.gf new file mode 100644 index 000000000..4510ff084 --- /dev/null +++ b/src/slovak/PhraseSlo.gf @@ -0,0 +1,19 @@ +concrete PhraseSlo of Phrase = CatSlo ** open Prelude, ResSlo in { + +lin + UttS s = s ; + UttAdv adv = adv ; + UttCN cn = {s = cn.s ! Sg ! Nom} ; + UttAP ap = {s = ap.s ! Masc Anim ! Sg ! Nom} ; + UttNP np = {s = np.s ! Nom} ; + + PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; + + + NoPConj = {s = []} ; + PConjConj conj = {s = conj.s2} ; + + NoVoc = {s = []} ; + VocNP np = {s = np.s ! Voc} ; + +} diff --git a/src/slovak/QuestionSlo.gf b/src/slovak/QuestionSlo.gf new file mode 100644 index 000000000..839b576c3 --- /dev/null +++ b/src/slovak/QuestionSlo.gf @@ -0,0 +1,7 @@ +concrete QuestionSlo of Question = CatSlo ** + open ResSlo, Prelude in { + +lin + QuestCl cl = cl ; ---- + +} diff --git a/src/slovak/RelativeSlo.gf b/src/slovak/RelativeSlo.gf new file mode 100644 index 000000000..3def5503e --- /dev/null +++ b/src/slovak/RelativeSlo.gf @@ -0,0 +1,18 @@ +concrete RelativeSlo of Relative = CatSlo ** open + ParadigmsSlo, + ResSlo, + Prelude in { + +lin + RelVP rp vp = vp ** { + subj = + let rel = (adjFormsAdjective rp).s + in \\a => case a of { + Ag g n _ => rel ! g ! n ! Nom + } + } ; + + IdRP = mkA "který" ; + + +} diff --git a/src/slovak/ResSlo.gf b/src/slovak/ResSlo.gf new file mode 100644 index 000000000..be2179529 --- /dev/null +++ b/src/slovak/ResSlo.gf @@ -0,0 +1,885 @@ +resource ResSlo = open Prelude in { + +-- AR March 2020 +-- sources: +-- Wiki = https://en.wikipedia.org/wiki/Czech_declension, https://en.wikipedia.org/wiki/Czech_conjugation +-- CEG = J. Naughton, Czech: an Essential Grammar, Routledge 2005. + +-- parameters + +param + Number = Sg | Pl ; + + Animacy = Anim | Inanim ; + Gender = Masc Animacy | Fem | Neutr ; + + Case = Nom | Gen | Dat | Acc | Voc | Loc | Ins ; -- traditional order + + Person = P1 | P2 | P3 ; + + Agr = Ag Gender Number Person ; + + CTense = CTPres | CTPast ; ----- TODO complete the tense system to match Czech verb morphology + +-- phonology + +oper + hardConsonant : pattern Str = #("d"|"t"|"g"|"h"|"k"|"n"|"r") ; + softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"ř"|"š"|"c"|"č"|"ž") ; + neutralConsonant : pattern Str = #("b"|"f"|"l"|"m"|"p"|"s"|"v") ; + + consonant : pattern Str = + #( + "d" | "t" | "g" | "h" | "k" | "n" | "r" | + "ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" | + "b" | "f" | "l" | "m" | "p" | "s" | "v" + ) ; + + dropFleetingE : Str -> Str = \s -> case s of { + x + "e" + c@("k"|"c"|"n") => x + c ; + x + "e" + "ň" => x + "n" ; + _ => s + } ; + + shortenVowel : Str -> Str = \s -> case s of { + x + "á" + y => x + "a" + y ; + x + "é" + y => x + "e" + y ; + x + "í" + y => x + "i" + y ; + x + "ý" + y => x + "y" + y ; + x + "ó" + y => x + "o" + y ; + x + "ú" + y => x + "u" + y ; + x + "ů" + y => x + "o" + y ; + _ => s + } ; + + addI : Str -> Str = \s -> case s of { + klu + "k" => klu + "ci" ; + vra + "h" => vra + "zi" ; + ce + "ch" => ce + "ši" ; + dokto + "r" => dokto + "ři" ; + pan => pan + "i" + } ; + + addAdjI : Str -> Str = \s -> case s of { + angli + "ck" => angli + "čtí" ; + ce + "sk" => ce + "ští" ; + _ => init (addI s) + "í" + } ; + + -- 3.4.10, in particular when also final 'a' is dropped + addE : Str -> Str = \s -> case s of { + re + "k" => re + "ce" ; + pra + ("g"|"h") => pra + "ze" ; + stre + "ch" => stre + "še" ; + sest + "r" => sest + "ře" ; + pan => pan + "ě" + } ; + + addEch : Str -> Str = \s -> case s of { + klu + "k" => klu + "cich" ; + vra + ("h"|"g") => vra + "zich" ; + ce + "ch" => ce + "šich" ; + pan => pan + "ech" + } ; + + shortFemPlGen : Str -> Str = \s -> case s of { + ul + "ice" => ul + "ic" ; + koleg + "yně" => koleg + "yň" ; + ruz + "e" => ruz + "í" ; + _ => Predef.error ("shortFemPlGen does not apply to" ++ s) + } ; + +--------------- +-- Nouns +--------------- + +-- novel idea (for RGL): lexical items stored as records rather than tables +-- advantages: +-- - easier to make exceptions to paradigms (by ** {}) +-- - easier to keep the number of forms minimal +-- - easier to see what is happening than with lots of anonymous arguments to mkN, mkA, mkV + +-- so this is the lincat of N + + NounForms : Type = {snom,sgen,sdat,sacc,svoc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ; g : Gender} ; + +-- But traditional tables make agreement easier to handle in syntax +-- so this is the lincat of CN + + Noun : Type = {s : Number => Case => Str ; g : Gender} ; + +-- this is used in UseN + + nounFormsNoun : NounForms -> Noun + = \forms -> { + s = table { + Sg => table { + Nom => forms.snom ; + Gen => forms.sgen ; + Dat => forms.sdat ; + Acc => forms.sacc ; + Voc => forms.svoc ; + Loc => forms.sloc ; + Ins => forms.sins + } ; + Pl => table { + Nom | Voc => forms.pnom ; + Gen => forms.pgen ; + Dat => forms.pdat ; + Acc => forms.pacc ; + Loc => forms.ploc ; + Ins => forms.pins + } + } ; + g = forms.g + } ; + +-- terminology of CEG + DeclensionType : Type = Str -> NounForms ; + + declensionNounForms : (nom,gen : Str) -> Gender -> NounForms + = \nom,gen,g -> + let decl : DeclensionType = case of { + => declPAN ; + => declPREDSEDA ; + => declHRAD ; + => declZENA ; + => declMESTO ; + => declMUZ ; + => declMUZ ; + => declSOUDCE ; + => declSTROJ ; + => declRUZE ; + => declPISEN ; + => declKOST ; --- also many other "st" 3.6.3 + => declKURE ; + => declMORE ; + => declSTAVENI ; + _ => Predef.error ("cannot infer declension type for" ++ nom ++ gen) + } + in decl nom ; + +-- the "smartest" one-argument mkN + + guessNounForms : Str -> NounForms + = \s -> case s of { + _ + "ost" => declKOST s ; + _ + "tel" => declMUZ s ; + _ + #hardConsonant => declHRAD s ; + _ + #softConsonant => declSTROJ s ; + _ + "a" => declZENA s ; + _ + "o" => declMESTO s ; + _ + "ce" => declSOUDCE s ; + _ + "e" => declMORE s ; + _ + "í" => declSTAVENI s ; + _ => Predef.error ("cannot guess declension type for" ++ s) + } ; + +-- the traditional declensions, in both CEG and Wiki +-- they are also exported in ParadigmsSlo with names panN etc + + declPAN : DeclensionType = \pan -> --- plural nom ové|i|é can be changed with ** {pnom = ...} CEG 3.5.1 + { + snom = pan ; + sgen,sacc = pan + "a" ; + sdat,sloc = pan + "ovi" ; --- pánu + svoc = shortenVowel pan + "e" ; --- "irregular shortening" 3.5.1 + sins = pan + "em" ; + + pnom = addI pan ; -- pani, kluk-kluci --- panové, host-hosté + pgen = pan + "ů" ; + pdat = pan + "ům" ; + pacc,pins = pan + "y" ; + ploc = addEch pan ; + g = Masc Anim + } ; + + declPREDSEDA : DeclensionType = \predseda -> --- 3.5.4: sgen y/i + let predsed = init predseda + in + { + snom = predseda ; + sgen = predsed + "y" ; -- pacc,pins --- i + sdat,sloc = predsed + "ovi" ; + sacc = predsed + "u" ; + svoc = predsed + "o" ; + sins = predsed + "ou" ; + + pnom = case predseda of { + tur + "ista" => tur + "isté" ; + _ => predsed + "ové" + } ; + pgen = predsed + "ů" ; + pdat = predsed + "ům" ; + pacc,pins = predsed + "y" ; + ploc = addEch predsed ; + g = Masc Anim + } ; + + declHRAD : DeclensionType = \hrad -> --- 3.5.2: sloc u/ě/e extra arg, sport-u, hrad-ě ; sgen u/a + let hrd = dropFleetingE hrad + in + { + snom,sacc = hrad ; + sgen,sdat = hrd + "u" ; --- Berlín-a + sloc = hrd + "u" ; --- addE hrad ; -- stůl-stole + svoc = hrd + "e" ; + sins = hrd + "em" ; + + pnom,pacc,pins = hrd + "y" ; + pgen = hrd + "ů" ; + pdat = hrd + "ům" ; + ploc = addEch hrd ; + g = Masc Inanim + } ; + + declZENA : DeclensionType = \zena -> --- 3.6.1 sge y/i ; pgen sometimes shortening + let zen = init zena + in + { + snom = zena ; + sgen = zen + "y" ; --- i after soft cons sometimes + sdat,sloc = zen + "ě" ; --- i after soft cons sometimes ; skol+e + sacc = zen + "u" ; + svoc = shortenVowel zen + "o" ; ---- shorten ? + sins = zen + "ou" ; + + pnom,pacc = zen + "y" ; --- also sgen + pgen = zen ; --- sometimes with vowel shortening + pdat = zen + "ám" ; + ploc = zen + "ách" ; + pins = zen + "ami" ; + g = Fem + } ; + + declMESTO : DeclensionType = \mesto -> --- 3.7.1 sloc u/e ; pgen vowel shortening sometimes ; ploc variations + let mest = init mesto + in + { + snom,sacc,svoc = mesto ; + sgen = mest + "a" ; + sdat = mest + "u" ; + sloc = mest + "u" ; --- "ě" + sins = mest + "em" ; + + pnom,pacc = mest + "a" ; + pgen = mest ; --- léta - let + pdat = mest + "ům" ; + ploc = mest + "ech" ; --- with variations + pins = mest + "y" ; + g = Neutr + } ; + + declMUZ : DeclensionType = \muz_ -> --- 3.5.3 : sdat,sloc ; pnom + let muz = dropFleetingE muz_ + in + { + snom = muz_ ; + sgen,sacc = muz + "e" ; --- pacc + sdat,sloc = muz + "i" ; --- muzovi + svoc = case muz_ of { + chlap + "ec" => chlap + "če" ; + _ => muz + "i" + } ; + sins = muz + "em" ; + + pnom = case muz_ of { + uci + "tel" => uci + "telé" ; + _ => muz + "i" --- muzové + } ; + pgen = muz + "ů" ; + pacc = muz + "e" ; + pdat = muz + "ům" ; + ploc = muz + "ích" ; + pins = muz + "i" ; + g = Masc Anim + } ; + + declSOUDCE : DeclensionType = \soudce -> --- 3.5.3: sdat/sloc i,ovi ; pnom i/ové + let soudc = init soudce + in + { + snom,sgen,sacc,svoc = soudce ; ---- pacc + sdat,sloc = soudc + "i" ; --- soudcovi + sins = soudc + "em" ; + + pnom = soudc + "i" ; --- soudcové + pgen = soudc + "ů" ; + pdat = soudc + "ům" ; + pacc = soudce ; + ploc = soudc + "ích" ; + pins = soudc + "i" ; + g = Masc Anim + } ; + + declSTROJ : DeclensionType = \stroj -> + { + snom,sacc = stroj ; + sgen = stroj + "e" ; --- pnom,pacc + sdat,svoc,sloc = stroj + "i" ; --- pins ---- svoc shorten? + sins = stroj + "em" ; + + pnom,pacc = stroj + "e" ; + pgen = stroj + "ů" ; + pdat = stroj + "ům" ; + ploc = stroj + "ích" ; + pins = stroj + "i" ; + g = Masc Inanim + } ; + + declRUZE : DeclensionType = \ruze -> --- 3.6.2: pgen ulice-ulic, chvile-cvil + let ruz = init ruze + in + { + snom,sgen,svoc = ruze ; --- pnom,pacc + sdat,sacc,sloc = ruz + "i" ; + sins = ruz + "í" ; + + pnom,pacc = ruze ; + pgen = shortFemPlGen ruze ; + pdat = ruz + "ím" ; + ploc = ruz + "ích" ; + pins = ruz + "emi" ; + g = Fem + } ; + + declPISEN : DeclensionType = \pisen -> + let pisn = dropFleetingE pisen + in + { + snom,sacc = pisen ; + sgen = pisn + "ě" ; + sdat,svoc,sloc = pisn + "i" ; -- not shortened + sins = pisn + "í" ; + + pnom,pacc = pisn + "ě" ; + pgen = pisn + "í" ; + pdat = pisn + "ím" ; + ploc = pisn + "ích" ; + pins = pisn + "ěmi" ; + g = Fem + } ; + + declKOST : DeclensionType = \kost -> + { + snom,sacc = kost ; + sgen,sdat,svoc,sloc = kost + "i" ; --- pnom,pacc + sins = kost + "í" ; --- pgen + + pnom,pacc = kost + "i" ; + pgen = kost + "í" ; + pdat = kost + "em" ; + ploc = kost + "ech" ; + pins = kost + "mi" ; + g = Fem + } ; + + declKURE : DeclensionType = \kure -> + let kur = init kure + in + { + snom,sacc,svoc = kure ; + sgen = kur + "ete" ; + sdat,sloc = kur + "eti" ; + sins = kur + "etem" ; + + pnom,pacc = kur + "ata" ; + pgen = kur + "at" ; + pdat = kur + "atům" ; + ploc = kur + "atech" ; + pins = kur + "aty" ; + g = Neutr + } ; + + declMORE : DeclensionType = \more -> --- 3.7.2 pgen zero sometimes + let mor = init more + in + { + snom,sgen,sacc,svoc = more ; --- pnom + sdat,sloc = mor + "i" ; --- pins + sins = mor + "em" ; + + pnom,pacc = more ; + pgen = mor + "í" ; --- + pdat = mor + "ím" ; + ploc = mor + "ích" ; + pins = mor + "i" ; + g = Neutr + } ; + + declSTAVENI : DeclensionType = \staveni -> + { + snom,sgen,sdat,sacc,svoc,sloc = staveni ; + sins = staveni + "m" ; + + pnom,pgen,pacc = staveni ; + pdat = staveni + "m" ; + ploc = staveni + "ch" ; + pins = staveni + "mi" ; + g = Neutr + } ; + +--------------------------- +-- Adjectives + +-- to be used for AP: 56 forms for each degree + Adjective : Type = {s : Gender => Number => Case => Str} ; + +-- to be used for A, in three degrees: 15 forms in each +---- TODO other degrees than positive + + AdjForms : Type = { + msnom, fsnom, nsnom : Str ; -- svoc = snom + msgen, fsgen : Str ; -- nsgen = msgen, pacc = fsgen + msdat, fsdat : Str ; -- nsdat = msdat + fsacc : Str ; -- amsacc = msgen, imsacc = msnom, nsacc = nsnom + msloc : Str ; -- fsloc = fsdat, nsloc = msloc + msins, fsins : Str ; -- nsins = msins, pdat = msins + + mpnom,fpnom : Str ; -- pvoc = pnom, impnom = fpnom, npnom = fsnom + pgen : Str ; -- ploc = pgen + pins : Str ; + } ; + +-- used in PositA but will also work in Compar and Superl by calling their record fields + +adjFormsAdjective : AdjForms -> Adjective = \afs -> { + s = \\g,n,c => case of { + + + | => afs.msnom ; + + | => afs.fsnom ; + => afs.nsnom ; + + + | => afs.msgen ; + + | => afs.fsgen ; + + => afs.msdat ; + => afs.fsdat ; + + => afs.fsacc ; + + => afs.msloc ; + + + | => afs.msins ; + => afs.fsins ; + + => afs.mpnom ; + => afs.fpnom ; + + => afs.pgen ; + => afs.pins + } + + } ; + +-- hard declension + + mladyAdjForms : Str -> AdjForms = \mlady -> + let mlad = init mlady + in { + msnom = mlad + "ý" ; + fsnom = mlad + "á" ; + nsnom,fsgen,fsdat,fpnom = mlad + "é" ; + msgen = mlad + "ého" ; + msdat = mlad + "ému" ; + fsacc,fsins = mlad + "ou" ; + msloc = mlad + "ém" ; + msins,pdat = mlad + "ým" ; + mpnom = addAdjI mlad ; + pgen = mlad + "ých" ; + pins = mlad + "ými" ; + } ; + +-- soft declension + + jarniAdjForms : Str -> AdjForms = \jarni -> + { + msnom,fsnom,nsnom, + fsgen,fsdat,fsacc,fsins, + mpnom,fpnom = jarni ; + msgen = jarni + "ho" ; + msdat = jarni + "mu" ; + msloc,msins = jarni + "m" ; + pgen = jarni + "ch" ; + pins = jarni + "mi" ; + } ; + +-- masculine possession: the same endings as in feminine + + otcuvAdjForms : Str -> AdjForms = \otcuv -> + let otcov = Predef.tk 2 otcuv + "ov" + in + matcinAdjForms otcov ** {msnom = otcuv} ; + +-- feminine possession + + matcinAdjForms : Str -> AdjForms = \matcin -> + { + msnom = matcin ; + fsnom,msgen = matcin + "a" ; + nsnom = matcin + "o" ; + fsgen,fpnom = matcin + "y" ; + msdat,fsacc = matcin + "u" ; + fsdat,msloc = matcin + "ě" ; + msins = matcin + "ým" ; + fsins = matcin + "ou" ; + mpnom = matcin + "i" ; + pgen = matcin + "ých" ; + pins = matcin + "ými" ; + } ; + +--------------------- +-- Verbs + + VerbForms : Type = { ---- TODO more forms to add + inf, + pressg1, pressg2, pressg3, + prespl1, prespl2, prespl3, + pastpartsg, pastpartpl, +---- passpart, + negpressg3 : Str -- matters only for copula + } ; + + ComplementCase : Type = {s : Str ; c : Case ; hasPrep : Bool} ; + + verbAgr : VerbForms -> Agr -> Bool -> Str ---- TODO tenses + = \vf,a,b -> case a of { + Ag _ Sg P1 => vf.pressg1 ; + Ag _ Sg P2 => vf.pressg2 ; + Ag _ Sg P3 => case b of { + True => vf.pressg3 ; + False => vf.negpressg3 -- matters only for copula + } ; + Ag _ Pl P1 => vf.prespl1 ; + Ag _ Pl P2 => vf.prespl2 ; + Ag _ Pl P3 => vf.prespl3 + } ; + + copulaVerbForms : VerbForms = { + inf = "být" ; + pressg1 = "jsem" ; + pressg2 = "jsi" ; + pressg3 = "je" ; + prespl1 = "jsme" ; + prespl2 = "jste" ; + prespl3 = "jsou" ; + pastpartsg = "byl" ; + pastpartpl = "byli" ; + negpressg3 = "ní" ; -- ne is added to this + } ; + + haveVerbForms : VerbForms = { + inf = "mít" ; + pressg1 = "mám" ; + pressg2 = "máš" ; + pressg3, negpressg3 = "má" ; + prespl1 = "máme" ; + prespl2 = "máte" ; + prespl3 = "mají" ; + pastpartsg = "měl" ; + pastpartpl = "měli" ; + } ; + +-- just an example of a traditional paradigm +---- TODO other traditional paradigms + + iii_kupovatVerbForms : Str -> VerbForms = \kupovat -> + let + kupo = Predef.tk 3 kupovat ; + kupu = Predef.tk 1 kupo + "u" + in + { + inf = kupovat ; + pressg1 = kupu + "ji" ; --- kupuju + pressg2 = kupu + "ješ" ; + pressg3, negpressg3 = kupu + "je" ; + prespl1 = kupu + "jeme" ; + prespl2 = kupu + "jete" ; + prespl3 = kupu + "jí" ; --- kupujou + pastpartsg = kupo + "val" ; + pastpartpl = kupo + "vali" ; + } ; + + +--------------------------- +-- Pronouns + + PronForms : Type = { + nom, cnom, -- cnom is the pro-drop subject + gen, cgen,pgen, -- bare, clitic, prepositional + acc, cacc,pacc, + dat, cdat,pdat, + loc, + ins,pins : Str ; + a : Agr + } ; + +---- TODO: possessives + + personalPron : Agr -> PronForms = \a -> + {a = a ; cnom = []} ** + case a of { + Ag _ Sg P1 => { + nom = "já" ; + gen,acc,pgen,pacc = "mne" ; + cgen,cacc = "mě" ; + dat,pdat,loc = "mně" ; + cdat = "mi" ; + ins,pins = "mnou" + } ; + Ag _ Sg P2 => { + nom = "ty" ; + gen,acc,pgen,pacc = "tebe" ; + cgen,cacc = "tě" ; + dat,pdat,loc = "tobě" ; + cdat = "ti" ; + ins,pins = "tebou" + } ; + Ag (Masc _) Sg P3 => { + nom = "on" ; + gen,acc = "jeho" ; + cgen,cacc = "ho" ; + pgen,pacc = "něho" ; + dat = "jemu" ; + cdat = "mu" ; + pdat = "němu" ; + loc = "něm" ; + ins = "jím" ; + pins = "ním" ; + } ; + Ag Fem Sg P3 => { + nom = "ona" ; + gen = "její" ; + dat,acc,cgen,cacc,cdat,ins = "ji" ; + pgen,pdat,pacc,loc,pins = "ní" ; + } ; + Ag Neutr Sg P3 => { + nom = "ono" ; + gen = "jeho" ; + cgen,cacc = "ho" ; + pgen = "něho" ; + dat = "jemu" ; + acc = "je" ; + pacc = "ně" ; + cdat = "mu" ; + pdat = "němu" ; + loc = "něm" ; + ins = "jím" ; + pins = "ním" ; + } ; + Ag _ Pl P1 => { + nom = "my" ; + gen,acc, + cgen,cacc, + pgen,pacc, + loc = "nás" ; + dat,cdat,pdat = "nám" ; + ins,pins = "námi" ; + } ; + Ag _ Pl P2 => { + nom = "vy" ; + gen,acc, + cgen,cacc, + pgen,pacc, + loc = "vás" ; + dat,cdat,pdat = "vám" ; + ins,pins = "vámi" ; + } ; + Ag g Pl P3 => { + nom = case g of { + Masc _ => "oni" ; + Fem => "ony" ; + Neutr => "ona" + } ; + gen,cgen = "jich" ; + pgen = "nich" ; + dat,cdat = "jim" ; + pdat = "nim" ; + acc,cacc = "je" ; + pacc = "ně" ; + loc = "nich" ; + ins = "jimi" ; + pins = "nimi" ; + } + + } ; + +-------------------------------- +-- demonstrative pronouns, used for Quant and Det + +oper + DemPronForms : Type = { + msnom, fsnom, nsnom, + msgen, fsgen, + msdat, -- fsdat = fsgen unlike AdjForms + fsacc, + msloc, + msins, fsins, + mpnom, fpnom, -- mpacc = fpacc = fpnom + pgen, + pdat, -- NOT msins like AdjForms + pins : Str + } ; + + demPronFormsAdjective : DemPronForms -> Str -> Adjective = + \dem,s -> + let + demAdj = dem ** {fsdat = dem.fsgen} ; + adjAdj = adjFormsAdjective demAdj + in { + s = \\g,n,c => case of { + <_,Pl,Dat> => dem.pdat ; + => dem.fpnom ; + _ => adjAdj.s ! g ! n ! c + } + s + } ; + + Determiner : Type = { + s : Gender => Case => Str ; + size : NumSize + } ; + + mkDemPronForms : Str -> DemPronForms = \t -> { + msnom = t + "en" ; + fsnom = t + "a" ; + nsnom = t + "o" ; + msgen = t + "oho" ; + fsgen = t + "é" ; + msdat = t + "omu" ; + fsacc = t + "u" ; + msloc = t + "om" ; + msins = t + "ím" ; + fsins = t + "ou" ; + mpnom = t + "i" ; + fpnom = t + "y" ; + pgen = t + "ěch" ; + pdat = t + "ěm" ; + pins = t + "ěmi" ; + } ; + + invarDemPronForms : Str -> DemPronForms = \s -> { + msnom, fsnom, nsnom, msgen, fsgen, + msdat, fsacc, msloc, msins, fsins, + mpnom, fpnom, pgen, pdat, pins = s ; + } ; + +-- interrogatives + + kdoForms : Case => Str = table { + Nom => "kdo" ; + Gen | Acc | Voc => "koho" ; + Dat => "komu" ; + Loc => "kom" ; + Ins => "kým" + } ; + + coForms : Case => Str = table { + Nom|Acc|Voc => "co" ; + Gen => "čeho" ; + Dat => "čemu" ; + Loc => "čem" ; + Ins => "čím" + } ; + +-- Numerals + + -- singular forms of demonstratives + NumeralForms : Type = { + msnom, fsnom, nsnom, + msgen, fsgen, + msdat, + fsacc, + msloc, + msins, fsins : Str + } ; + + numeralFormsDeterminer : NumeralForms -> NumSize -> Determiner = + \nume,size -> + let + dem = nume ** + {mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used + demAdj = dem ** {fsdat = dem.fsgen} ; + adjAdj = adjFormsAdjective demAdj + in { + s = \\g,c => adjAdj.s ! g ! Sg ! c ; + size = size + } ; + + -- example: number 1 + oneNumeral : Determiner = numeralFormsDeterminer ((mkDemPronForms "jedn") ** {msnom = "jeden"}) Num1 ; + + -- numbers 2,3,4 ---- to check if everything comes out right with the determiner type + twoNumeral : Determiner = + let forms = { + msnom = "dva" ; fsnom, nsnom, fsacc = "dvě" ; + msgen, fsgen, msloc = "dvou" ; + msdat, msins, fsins = "dvěma" + } + in numeralFormsDeterminer forms Num2_4 ; + + threeNumeral : Determiner = + let forms = { + msnom, fsnom, nsnom, fsacc, msgen, fsgen = "tři" ; + msdat = "třem" ; + msloc = "třech" ; + msins,fsins = "třemi" ; + } + in numeralFormsDeterminer forms Num2_4 ; + + fourNumeral : Determiner = + let forms = { + msnom, fsnom, nsnom, fsacc = "čtyři" ; + msgen, fsgen = "čtyř" ; + msdat = "čtyřem" ; + msloc = "čtyřech" ; + msins,fsins = "čtyřmi" ; + } + in numeralFormsDeterminer forms Num2_4 ; + + -- for the numbers 5 upwards + regNumeral : Str -> Str -> Determiner = \pet,peti -> + let forms = { + msnom,fsnom,nsnom = pet ; + msgen, fsgen, msdat, fsacc, msloc, msins, fsins = peti + } + in numeralFormsDeterminer forms Num5 ; + + invarDeterminer : Str -> NumSize -> Determiner = \sto,size -> + regNumeral sto sto ; + + invarNumeral : Str -> Determiner = \s -> invarDeterminer s Num5 ; + +-------------------------------- +-- combining nouns with numerals + +param + NumSize = Num1 | Num2_4 | Num5 ; -- CEG 6.1 + +oper + numSizeForm : (Number => Case => Str) -> NumSize -> Case -> Str + = \cns,n,c -> case n of { + Num1 => cns ! Sg ! c ; + Num2_4 => cns ! Pl ! c ; + Num5 => case c of { + Nom | Acc => cns ! Pl ! Gen ; + _ => cns ! Pl ! c + } + } ; + + numSizeAgr : Gender -> NumSize -> Person -> Agr + = \g,ns,p -> case ns of { + Num5 => Ag Neutr Sg p ; -- essential grammar 6.1.4 + Num2_4 => Ag g Pl p ; + Num1 => Ag g Sg p + } ; + + numSizeNumber : NumSize -> Number = \ns -> case ns of { + Num1 => Sg ; + _ => Pl ---- TO CHECK + } ; +} diff --git a/src/slovak/SentenceSlo.gf b/src/slovak/SentenceSlo.gf new file mode 100644 index 000000000..2b8103a1b --- /dev/null +++ b/src/slovak/SentenceSlo.gf @@ -0,0 +1,32 @@ +concrete SentenceSlo of Sentence = CatSlo ** + open Prelude, ResSlo in { + +lin + PredVP np vp = { + subj = case np.hasClit of { + True => np.clit ! Nom ; -- pro-drop + False => np.s ! Nom + } ; + verb = vp.verb ; + clit = vp.clit ! np.a ; + compl = vp.compl ! np.a ; + a = np.a ; + } ; + + UseCl temp pol cl = { + s = temp.s ++ cl.subj ++ cl.clit ++ pol.s ++ verbAgr cl.verb cl.a pol.p ++ cl.compl ; + } ; + + --- TODO is inversion the standard? ; add indirect questions + UseQCl temp pol cl = { + s = temp.s ++ cl.clit ++ pol.s ++ verbAgr cl.verb cl.a pol.p ++ cl.subj ++ cl.compl ; + } ; + + UseRCl temp pol rcl = { + s = \\a => temp.s ++ + rcl.subj ! a ++ rcl.clit ! a ++ + pol.s ++ verbAgr rcl.verb a pol.p ++ + rcl.compl ! a ; + } ; + +} diff --git a/src/slovak/StructuralSlo.gf b/src/slovak/StructuralSlo.gf new file mode 100644 index 000000000..6fea21060 --- /dev/null +++ b/src/slovak/StructuralSlo.gf @@ -0,0 +1,27 @@ +concrete StructuralSlo of Structural = CatSlo ** + open ParadigmsSlo, ResSlo, Prelude in { + +lin + and_Conj = mkConj "a" ; + by8agent_Prep = mkPrep "od" Gen ; ---- TODO this means "from", there might be no good translation + few_Det = invarNumeral "málo" ; -- CEG 6.8 --- TODO genitive mála + for_Prep = mkPrep "pro" accusative ; + from_Prep = mkPrep (pre {"s"|"z" => "ze" ; _ => "z"}) Gen ; ---- consonant clusters + have_V2 = mkV2 haveVerbForms ; + in_Prep = mkPrep (pre {"v"|"m" => "ve" ; _ => "v"}) Loc ; ---- + many_Det = regNumeral "mnoho" "mnoha" ; -- CEG 6.8 ---- + or_Conj = mkConj "nebo" ; + somePl_Det = regNumeral "několik" "několika" ; -- CEG 6.8 ---- + something_NP = {s,clit,prep = \\c => "ně" + coForms ! c ; a = Ag Neutr Sg P3 ; hasClit = False} ; -- CEG 5.6.3 + possess_Prep = mkPrep "" Gen ; + that_Quant = demPronFormsAdjective (mkDemPronForms "tamt") "" ; + this_Quant = demPronFormsAdjective (mkDemPronForms "t") "to" ; + to_Prep = mkPrep "do" Gen ; + with_Prep = mkPrep (pre {"s"|"z" => "se" ; _ => "s"}) Ins ; ---- + + i_Pron = personalPron (Ag (Masc Anim) Sg P1) ; + youSg_Pron = personalPron (Ag (Masc Anim) Sg P2) ; + he_Pron = personalPron (Ag (Masc Anim) Sg P3) ; + she_Pron = personalPron (Ag Fem Sg P3) ; + +} diff --git a/src/slovak/SymbolSlo.gf b/src/slovak/SymbolSlo.gf new file mode 100644 index 000000000..b76f4e211 --- /dev/null +++ b/src/slovak/SymbolSlo.gf @@ -0,0 +1,11 @@ +--# -path=.:../abstract:../common:../prelude + +concrete SymbolSlo of Symbol = CatSlo ** open Prelude, ResSlo in { + +lincat + Symb = {s : Str} ; +lin + MkSymb s = s ; + SymbPN s = lin PN {s = \\_ => s.s ; g = Neutr} ; + +} diff --git a/src/slovak/TenseSlo.gf b/src/slovak/TenseSlo.gf new file mode 100644 index 000000000..9aeb9e4eb --- /dev/null +++ b/src/slovak/TenseSlo.gf @@ -0,0 +1,20 @@ +concrete TenseSlo of Tense = + CatSlo ** + open + ResSlo, + Prelude + in { +lin + PNeg = { + s = "ne" ++ Predef.BIND ; + p = False + } ; + PPos = { + s = [] ; + p = True + } ; + ASimul = {s = [] ; t = CTPres} ; + TPres = {s = [] ; t = CTPres} ; + TTAnt t a = {s = t.s ++ a.s ; t = t.t} ; ---- + +} diff --git a/src/slovak/TextSlo.gf b/src/slovak/TextSlo.gf new file mode 100644 index 000000000..7f862cfd9 --- /dev/null +++ b/src/slovak/TextSlo.gf @@ -0,0 +1,8 @@ +concrete TextSlo of Text = CatSlo ** open ResSlo in { + + lin + TEmpty = {s = []} ; + TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; +} diff --git a/src/slovak/VerbSlo.gf b/src/slovak/VerbSlo.gf new file mode 100644 index 000000000..f9ff0a82a --- /dev/null +++ b/src/slovak/VerbSlo.gf @@ -0,0 +1,48 @@ +concrete VerbSlo of Verb = CatSlo ** open ResSlo, Prelude in { + +lin + UseV v = { + verb = v ; + clit,compl = \\_ => [] + } ; + + ComplSlash vps np = case of { + => vps ** { + clit = \\a => vps.clit ! a ++ np.clit ! vps.c.c + } ; + _ => vps ** { + compl = \\a => vps.compl ! a ++ vps.c.s ++ np.s ! vps.c.c + } + } ; + + SlashV2a v = { + verb = v ; + clit,compl = \\_ => [] ; + c = v.c + } ; + + UseComp comp = { + verb = copulaVerbForms ; + clit = \\_ => [] ; + compl = comp.s + } ; + + CompAP ap = { + s = \\a => case a of { + Ag g n p_ => ap.s ! g ! n ! Nom + } + } ; + + CompNP np = { + s = \\a_ => np.s ! Nom ; ---- InstrC in Pol + } ; + + CompAdv adv = { + s = \\a_ => adv.s + } ; + + AdvVP vp adv = vp ** { + compl = \\a => vp.compl ! a ++ adv.s + } ; + +} From ddd49c2f8659c4906ddf7897b5335177b1b3cbc7 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 18 Apr 2020 20:44:42 +0200 Subject: [PATCH 78/97] Corrected most test cases --- src/hungarian/unittest/relative.gftest | 31 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/hungarian/unittest/relative.gftest b/src/hungarian/unittest/relative.gftest index 01a9c4d85..27ab27d84 100644 --- a/src/hungarian/unittest/relative.gftest +++ b/src/hungarian/unittest/relative.gftest @@ -2,40 +2,46 @@ -- These need to be correct -- ------------------------------ +--"aki" 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 aki 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 aki 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 aki lát egy macskát +--more natural sentence would be "... aki egy macskát lát" but I think this is still correct -- 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 aki látja a macskát +--more natural sentence would be "... aki a macskat 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 akinek egy macskája van +-- from "akinek van egy macska" to "akinek 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 akinek 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 aki repül és akinek egy macskája van ------------------------------------------------------------- @@ -44,13 +50,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 akit 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 akit 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 From cd5e8c4a48a7f685fca344f4cd40fea221cc10a3 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 18 Apr 2020 21:04:20 +0200 Subject: [PATCH 79/97] Updated after possesive form and plural --- src/hungarian/unittest/dative.gftest | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hungarian/unittest/dative.gftest b/src/hungarian/unittest/dative.gftest index 053202000..990bfc0fd 100644 --- a/src/hungarian/unittest/dative.gftest +++ b/src/hungarian/unittest/dative.gftest @@ -1,15 +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 macska +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 vannak némelyek macskák +LangHun: nekem van néhány macskám +-- "néhány" better translation than "némely" From 2cdc0830afd248964745484d053221ee73b4018e Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 18 Apr 2020 21:09:46 +0200 Subject: [PATCH 80/97] Changed word order --- src/hungarian/unittest/adjective.gftest | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From d3f4baa65586311b0f6bdbf6ab06b32a5d5fd496 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 18 Apr 2020 21:59:52 +0200 Subject: [PATCH 81/97] Added many more words to Lexicon --- src/hungarian/LexiconHun.gf | 322 ++++++++++++++++++------------------ 1 file changed, 161 insertions(+), 161 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 79336d236..e02b6112a 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" ; -- 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 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 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,28 @@ 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 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" ; } From 296132e325747f7251b8d4eec69166866da052e8 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sun, 19 Apr 2020 11:40:47 +0200 Subject: [PATCH 82/97] =?UTF-8?q?Fixed=20"r=C3=A1k"=20and=20"r=C3=A9t"=20c?= =?UTF-8?q?ases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/NounMorphoHun.gf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index b09c33c68..86d7c875b 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -45,8 +45,6 @@ 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" ; @@ -75,7 +73,6 @@ 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" ; @@ -154,8 +151,10 @@ oper -- and decides which (non-smart) paradigm is the most likely to match. regNoun : Str -> Noun = \sgnom -> case sgnom of { _ + "a"|"e" => dAlma sgnom ; + c1@(? | #digraph | #trigraph) + ("á"|"é") + c2@(? | #digraph | #trigraph) => mkNoun sgnom; _ + ("á"|"é") + ? => dMadár sgnom ; - _ + ("ó"|"ő") => dLó sgnom ; + _ + "é"|"ő"|"ű" => dLó sgnom ; + _ + "ó" => dTó sgnom ; _ + "alom" => dFarok sgnom ; _ + "elem" => dMajom sgnom ; @@ -165,6 +164,11 @@ oper _ => 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 + -------------------------------------------------------------------------------- -- Following code by EG in 2009 (?), comments and some additions by IL 2020 From 6b7ea904058dcc6f40cae208833a0cd24a5f7b5d Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 14:02:20 +0200 Subject: [PATCH 83/97] (Hun) Retain VPs subjectcase in relVP --- src/hungarian/ResHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 4d6697933..ff7379b71 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -344,7 +344,7 @@ 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 From dfd370830fb6ac375bce642f577f3ba5323f7004 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sun, 19 Apr 2020 15:00:42 +0200 Subject: [PATCH 84/97] added special accusative case + lower stem plural allomorph --- src/hungarian/NounMorphoHun.gf | 48 +++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 86d7c875b..eb7012470 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -6,7 +6,7 @@ oper -- Paradigm functions -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf - -- Words like alma, kefe: + -- Words like "alma, kefe, apa, anya, fa": dAlma : Str -> Noun = \alma -> let almá : Str = lengthen alma ; @@ -24,11 +24,16 @@ oper -- 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 ; @@ -151,7 +156,7 @@ oper -- and decides which (non-smart) paradigm is the most likely to match. regNoun : Str -> Noun = \sgnom -> case sgnom of { _ + "a"|"e" => dAlma sgnom ; - c1@(? | #digraph | #trigraph) + ("á"|"é") + c2@(? | #digraph | #trigraph) => mkNoun sgnom; + (? | #digraph | #trigraph) + ("á"|"é") + (? | #digraph | #trigraph) => mkNoun sgnom ; _ + ("á"|"é") + ? => dMadár sgnom ; _ + "é"|"ő"|"ű" => dLó sgnom ; _ + "ó" => dTó sgnom ; @@ -168,7 +173,9 @@ oper --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 @@ -278,6 +285,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" ; @@ -290,12 +304,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 } ; @@ -307,10 +325,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 ; From c47a6cd279d79be03165fa8a08a9ab8e5b7067f1 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sun, 19 Apr 2020 17:01:57 +0200 Subject: [PATCH 85/97] Progress on writing multi-argument paradigm --- src/hungarian/NounMorphoHun.gf | 123 ++------ src/hungarian/NounMorphoHunOneArgument.gf | 361 ++++++++++++++++++++++ 2 files changed, 387 insertions(+), 97 deletions(-) create mode 100644 src/hungarian/NounMorphoHunOneArgument.gf diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index eb7012470..39858249a 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -7,8 +7,8 @@ oper -- 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 ; + 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,17 +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: "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 ; + 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 { @@ -49,24 +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: - 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. @@ -75,51 +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 - 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 ; + => nMajm.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "majom" as the stem. @@ -127,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) @@ -154,20 +91,12 @@ 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 ; - (? | #digraph | #trigraph) + ("á"|"é") + (? | #digraph | #trigraph) => mkNoun sgnom ; - _ + ("á"|"é") + ? => dMadár sgnom ; - _ + "é"|"ő"|"ű" => dLó sgnom ; - _ + "ó" => dTó sgnom ; - _ + "alom" => dFarok sgnom ; - _ + "elem" => dMajom sgnom ; +-- regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = n, a -> mkNoun n ; - -- TODO: more non-smart paradigms + more pattern matching - -- TODO: smart paradigms with >1 form. Which forms are the most descriptive? +-- regNounNomAcc n a | (last n) == shorten (last (init a)) = dAlma n a + +-- guess : (nom : Str) -> (acc : Str) = \sgnom -> case sgnom of - _ => 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") 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 } + } + } ; + +} From 84ff6b4f46682b93d6f98d104ebe8dda84de3e1b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 17:05:51 +0200 Subject: [PATCH 86/97] (Hun) Generalise Postposition to Adposition, allow it to preposition --- src/hungarian/AdverbHun.gf | 2 +- src/hungarian/CatHun.gf | 2 +- src/hungarian/ParadigmsHun.gf | 3 +++ src/hungarian/ResHun.gf | 14 +++++++++----- 4 files changed, 14 insertions(+), 7 deletions(-) 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/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 247fe301f..d58f52bdc 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -85,6 +85,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 -> diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index ff7379b71..ea3589396 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 -> { From 73fb39164f6d0bbabf9f478fcb720b272b9e2c94 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 17:06:09 +0200 Subject: [PATCH 87/97] (Hun) More constructors for mkA2 --- src/hungarian/ParadigmsHun.gf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index d58f52bdc..e2b7787c5 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -37,7 +37,8 @@ oper mkA2 : overload { mkA2 : Str -> Prep -> A2 ; - mkA2 : Str -> Case -> A2 + mkA2 : Str -> Case -> A2 ; + mkA2 : A -> Prep -> A2 ; } ; --2 Verbs @@ -149,10 +150,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 { From 0b133c7122d0b3d1ebce840a8262780abd63a0e4 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 17:06:27 +0200 Subject: [PATCH 88/97] (Hun) Fix agreement in DetCN --- src/hungarian/NounHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = ; } ; From 8ddc50897a2998a2df0b4e7ff660f3a7d3be0931 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 17:35:34 +0200 Subject: [PATCH 89/97] (Hun) Fix number in ConjNP --- src/hungarian/ConjunctionHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 5661a7ba01d57427f66f7e1f2f599d2e121e6d22 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 18:23:54 +0200 Subject: [PATCH 90/97] (Hun) Change word order in relVP --- src/hungarian/ResHun.gf | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index ea3589396..5426e0d24 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -278,6 +278,10 @@ oper "vannak" "lenni" ; + megvan : Verb = copula ** { + s = \\vf => "meg" + copula.s ! vf ; + } ; + ------------------ -- VP @@ -330,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 @@ -351,9 +360,9 @@ oper 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 -> { From 5c5a6d1f04c9119d3a06c7c8011f257b4fe8a6b1 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 18:24:13 +0200 Subject: [PATCH 91/97] (Hun) Use Indef agreement in SlashVP --- src/hungarian/SentenceHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ; From 6a77c4a5d4eba2c8a9a16e18e9e2ae1b7bef5983 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 18:26:06 +0200 Subject: [PATCH 92/97] (Hun) Fix some words --- src/hungarian/StructuralHun.gf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 "" ; From 4d11e68e07f679e3b3711749bda575a721eaff87 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 18:26:20 +0200 Subject: [PATCH 93/97] (Hun) Update word order in relative clauses in tests --- src/hungarian/unittest/relative.gftest | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/hungarian/unittest/relative.gftest b/src/hungarian/unittest/relative.gftest index 27ab27d84..5a2dce4d5 100644 --- a/src/hungarian/unittest/relative.gftest +++ b/src/hungarian/unittest/relative.gftest @@ -2,34 +2,31 @@ -- These need to be correct -- ------------------------------ ---"aki" instead of "amit" for most examples +--"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 aki 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 aki 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 aki lát egy macskát ---more natural sentence would be "... aki egy macskát lát" but I think this is still correct +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 aki látja a macskát ---more natural sentence would be "... aki a macskat látja" +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 akinek egy macskája van --- from "akinek van egy macska" to "akinek egy macskája van" +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 akinek megvan 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 @@ -41,7 +38,7 @@ LangHun: én látom a macskát ami repül és piros -- 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 aki repül és akinek egy macskája van +LangHun: én látom a férfit ami repül és aminek egy macskája van ------------------------------------------------------------- @@ -50,12 +47,12 @@ LangHun: én látom a férfit aki repül és akinek 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 akit a macska lát +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"? 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 akit a macska lát +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 From f8cbfcca96eac4b8895499d0a6d10e08dd207477 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sun, 19 Apr 2020 18:52:25 +0200 Subject: [PATCH 94/97] Changes in regNoun --- src/hungarian/NounMorphoHun.gf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 39858249a..7ed7a630e 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -91,7 +91,10 @@ 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. --- regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = n, a -> mkNoun n ; +regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = n, a -> +let lastNom = last n ; + lastAccShort = shorten (last (init a)) ; +in ifTok Noun lastNom lastAccShort (dAlma n a) (mkNoun n) ; -- regNounNomAcc n a | (last n) == shorten (last (init a)) = dAlma n a From 80327bf42f3d05339ae3f62095cbf0e3b5a2ebfc Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 21:18:30 +0200 Subject: [PATCH 95/97] (Hun) Add 2-argument smart paradigm for nouns --- src/hungarian/LexiconHun.gf | 9 ++-- src/hungarian/NounMorphoHun.gf | 82 ++++++++++++++++++++++++++++++---- src/hungarian/ParadigmsHun.gf | 9 ++-- 3 files changed, 84 insertions(+), 16 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index e02b6112a..80fa8dc9a 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -5,7 +5,7 @@ concrete LexiconHun of Lexicon = CatHun ** -- A -- lin add_V3 = mkV3 "" ; -lin airplane_N = mkN "repülőgép" ; +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" ; @@ -26,7 +26,7 @@ lin bank_N = mkN "bank" ; -- lin bark_N = mkN "" ; 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" ; @@ -235,7 +235,7 @@ lin music_N = mkN "zene" ; ---- -- N -lin name_N = mkN "név" ; +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" ; @@ -406,7 +406,8 @@ lin window_N = mkN "ablak" ; lin wine_N = mkN "bor" ; 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 "fa" ; --same as tree lin worm_N = mkN "féreg" ; --also "kukac" diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 7ed7a630e..40acfc2aa 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -75,7 +75,7 @@ oper in {s = \\n,c => case of { -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem | => nMajmo.s ! n ! c ; - => nMajm.s ! n ! c ; + => nMajmo.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "majom" as the stem. @@ -91,15 +91,71 @@ 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. -regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = n, a -> -let lastNom = last n ; - lastAccShort = shorten (last (init a)) ; -in ifTok Noun lastNom lastAccShort (dAlma n a) (mkNoun n) ; +regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> + case of { + -- alma, almát + <_ + "a", _ + "át"> + |<_ + "e" ,_ + "ét"> => dAlma n a ; --- regNounNomAcc n a | (last n) == shorten (last (init a)) = dAlma n a --- guess : (nom : Str) -> (acc : Str) = \sgnom -> case sgnom of + <_ + "á" + #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") @@ -120,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") ; @@ -137,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 diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index e2b7787c5..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 } ; @@ -122,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) ; From 15a414707ceb5d92c4f8c6199ac9e1bd6bd6cca9 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 19 Apr 2020 21:25:55 +0200 Subject: [PATCH 96/97] (Hun) Fix an error in test file --- src/hungarian/unittest/inflection.gftest | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From c1ba6d84c2028358a5edd12661862e0ccb0ccac9 Mon Sep 17 00:00:00 2001 From: Michal Mechura Date: Tue, 21 Apr 2020 23:53:53 +0200 Subject: [PATCH 97/97] some Czech APs are post-positioned --- src/czech/AdjectiveCze.gf | 10 +++++----- src/czech/CatCze.gf | 12 ++++++------ src/czech/NounCze.gf | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/czech/AdjectiveCze.gf b/src/czech/AdjectiveCze.gf index 66891f01f..38950f0bb 100644 --- a/src/czech/AdjectiveCze.gf +++ b/src/czech/AdjectiveCze.gf @@ -3,9 +3,9 @@ concrete AdjectiveCze of Adjective = CatCze ** open ResCze, Prelude in { lin PositA a = adjFormsAdjective a ** {isPost = False} ; - + AdAP ada ap = ap ** {s = \\g,n,c => ada.s ++ ap.s ! g ! n ! c} ; - + ComplA2 a np = let ap = adjFormsAdjective a in @@ -14,10 +14,10 @@ concrete AdjectiveCze of Adjective = CatCze ** open ResCze, Prelude in { isPost = True ; } ; - UseA2 a = adjFormsAdjective a ** {isPost = False} ; + UseA2 a = adjFormsAdjective a ** {isPost = True} ; - UseComparA a = adjFormsAdjective a ** {isPost = False} ; ---- TODO: this gives positive forms + UseComparA a = adjFormsAdjective a ** {isPost = False} ; ---- TODO: this gives positive forms - AdvAP ap adv = ap ** {s = \\g,n,c => ap.s ! g ! n ! c ++ adv.s} ; + AdvAP ap adv = ap ** {s = \\g,n,c => ap.s ! g ! n ! c ++ adv.s; isPost = True} ; } diff --git a/src/czech/CatCze.gf b/src/czech/CatCze.gf index 25ac6cef0..0f47261d8 100644 --- a/src/czech/CatCze.gf +++ b/src/czech/CatCze.gf @@ -7,7 +7,7 @@ concrete CatCze of Cat = Text = {s : Str} ; Phr = {s : Str} ; Utt = {s : Str} ; - + S = {s : Str} ; Cl = {subj,clit,compl : Str ; verb : VerbForms ; a : Agr} ; Comp = {s : Agr => Str} ; @@ -28,17 +28,17 @@ concrete CatCze of Cat = A = ResCze.AdjForms ; AP = ResCze.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str} A2 = ResCze.AdjForms ** {c : ComplementCase} ; - + AdA = {s : Str} ; N = ResCze.NounForms ; CN = ResCze.Noun ; -- {s : Number => Case => Str ; g : Gender} NP = {s,clit,prep : Case => Str ; a : Agr ; hasClit : Bool} ; -- clit,prep differ for pronouns - PN = {s : Case => Str ; g : Gender} ; + PN = {s : Case => Str ; g : Gender} ; Det = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; -- can contain a numeral, therefore NumSize Quant = {s : Gender => Number => Case => Str} ; -- same as AP Num = Determiner ; - Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; + Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; Pron = PronForms ; Adv = {s : Str} ; @@ -46,9 +46,9 @@ concrete CatCze of Cat = Conj = {s1,s2 : Str} ; ---- may need a number Pol = {s : Str ; p : Bool} ; - Temp = {s : Str ; t : CTense} ; + Temp = {s : Str ; t : CTense} ; Tense = {s : Str ; t : CTense} ; - Ant = {s : Str ; t : CTense} ; + Ant = {s : Str ; t : CTense} ; PConj = {s : Str} ; Voc = {s : Str} ; diff --git a/src/czech/NounCze.gf b/src/czech/NounCze.gf index ef990e0c4..90a46f54b 100644 --- a/src/czech/NounCze.gf +++ b/src/czech/NounCze.gf @@ -64,7 +64,7 @@ lin } ; AdjCN ap cn = { - s = \\n,c => ap.s ! cn.g ! n ! c ++ cn.s ! n ! c ; + s = \\n,c => preOrPost (notB ap.isPost) (ap.s ! cn.g ! n ! c) (cn.s ! n ! c) ; g = cn.g } ; @@ -77,21 +77,21 @@ lin s = \\n,c => cn.s ! n ! c ++ adv.s ; g = cn.g } ; - + AdvNP np adv = { s,clit = \\c => np.s ! c ++ adv.s ; prep = \\c => np.prep ! c ++ adv.s ; a = np.a ; hasClit = False ; } ; - + UseN n = nounFormsNoun n ; ApposCN cn np = { s = \\n,c => cn.s ! n ! c ++ np.s ! c ; ---- TODO check apposition order g = cn.g } ; - + NumCard c = c ; NumDigits ds = ds ** {s = \\_,_ => ds.s} ; NumNumeral nu = nu ;