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/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/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/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/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/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/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/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/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/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/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 ; 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 ; 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 diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index eb4afff4c..a718d87ac 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -1,59 +1,67 @@ -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 = emptyAP ** { + s = a.s ! Posit + } ; + + -- : A -> NP -> AP ; + ComparA a np = emptyAP ** { + s = a.s ! Compar ; + compar = np.s ! Ade ; + } ; + + -- : A2 -> NP -> AP ; -- married to her + 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 ** { } ; + + -- : A2 -> AP ; -- married + UseA2 = PositA ; + + -- : A -> AP ; -- warmer + UseComparA a = emptyAP ** { + s = a.s ! Compar ; + } ; + + -- : CAdv -> AP -> NP -> AP ; -- as cool as John + CAdvAP adv ap np = ap ** { + s = \\n => adv.s ++ ap.s ! n ; + compar = ap.compar ++ adv.p ++ np.s ! Nom + } ; + +-- The superlative use is covered in $Ord$. + + -- : Ord -> AP ; -- warmest + AdjOrd ord = emptyAP ** ord ; + +-- 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 ** { + s = \\af => ap.s ! af ++ adv.s ; + } ; } diff --git a/src/hungarian/AdverbHun.gf b/src/hungarian/AdverbHun.gf index 30c7864a6..ed7b74737 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 = prep.pr ++ 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/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/CatHun.gf b/src/hungarian/CatHun.gf index 5c6541564..287dc7182 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 = ResHun.RP ; + -- 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 = ResHun.RP ; + +--2 Verb phrases + +-- Constructed in VerbHun. + + VP = ResHun.VerbPhrase ; + VPSlash = ResHun.VPSlash ; + Comp = ResHun.VerbPhrase ; + + +--2 Adjectival phrases + +-- Constructed in AdjectiveHun. + + AP = ResHun.AdjPhrase ; + + +--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 : 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 ; + + +--2 Numerals + +-- Constructed in NumeralHun. + + Card = ResHun.Numeral ; + Numeral = ResHun.Numeral ; + Digits = {s : CardOrd => Str ; n : Number} ; + + + +--2 Structural words + +-- Constructed in StructuralHun. + Conj = ResHun.Conj ; + Subj = SS ; + Prep = ResHun.Adposition ; + + + +--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.Adjective2 ; + + N, + N2, + N3 = ResHun.Noun ; + PN = ResHun.NounPhrase ; } diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index 67b83578b..f7bac7224 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -1,58 +1,65 @@ -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 { + +-- Adverb and other simple {s : Str} types. +lincat + [Adv],[AdV],[IAdv],[S] = {s1,s2 : Str} ; + +lin + BaseAdv, BaseAdV, BaseIAdv, BaseS = twoSS ; + ConsAdv, ConsAdV, ConsIAdv, ConsS = consrSS comma ; + ConjAdv, ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ; + +-- Adjectival phrases +lincat + [AP] = {s1,s2 : Number => Str} ; + +lin + BaseAP x y = + -- Don't try to have discontinuous comparative forms + let xCont : AP = x ** {s = \\n => x.s ! n ++ x.compar} ; + yCont : AP = y ** {s = \\n => y.s ! n ++ y.compar} ; + in twoTable Number xCont yCont ; + 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 +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 ** {agr = }; + +-- Relative sentences +lincat + [RS] = {s1,s2 : Number => Case => Str} ; + +lin + BaseRS = twoTable2 Number Case ; + ConsRS = consrTable2 Number Case comma ; + ConjRS = conjunctDistrTable2 Number Case ; + +{- +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 ** + +-} } 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/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/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/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/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..80fa8dc9a 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -1,383 +1,419 @@ ---# -path=.:prelude +concrete LexiconHun of Lexicon = CatHun ** + open ParadigmsHun, ParamHun, Prelude in { -concrete LexiconHun of Lexicon = CatHun ** - open ParadigmsHun, Prelude in -{ ---{ --- - flags coding = utf8 ; +---- +-- A +-- lin add_V3 = mkV3 "" ; +lin airplane_N = mkN "repülőgép" "repülőgépet" ; +-- lin alas_Interj = mkInterj "" ; +-- lin already_Adv = mkA "" ; +lin animal_N = mkN "állat" ; +-- lin 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 "" ; +-- lin ask_V2Q = mkV2 "" ; + +---- +-- B + +lin baby_N = mkN "bébi" ; +-- lin back_N = mkN "" ; +lin bad_A = mkA "rossz" ; +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" "sört" ; +-- lin beg_V2V = mkV2 "" ; +lin belly_N = mkN "has" ; +lin big_A = mkA "nagy" ; +lin bike_N = mkN "bicikli" ; +lin bird_N = mkN "madár" ; +-- lin bite_V2 = mkV2 "" ; +lin black_A = mkA "fekete" ; +lin blood_N = mkN "vér" ; +-- lin blow_V = mkV "" ; +lin blue_A = mkA "kék" ; +lin boat_N = mkN "hajó" ; +-- lin bone_N = mkN "" ; +-- lin boot_N = mkN "" ; +-- lin boss_N = mkN "" ; +lin book_N = mkN "könyv" ; +lin boy_N = mkN "fiú" ; +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 "öccsém" ; (possessive form?) +lin brown_A = mkA "barna" ; +-- lin burn_V = mkV "" ; +lin butter_N = mkN "vaj" ; +-- lin buy_V2 = mkV2 "" ; + +---- +-- C + +lin camera_N = mkN "fényképezőgép" ; +-- lin cap_N = mkN "" ; +lin car_N = mkN "autó" ; +lin carpet_N = mkN "szőnyeg" ; +lin cat_N = mkN "macska" ; +lin ceiling_N = mkN "plafon" ; +lin chair_N = mkN "szék" ; +lin cheese_N = mkN "sajt" ; +lin child_N = mkN "gyerek" ; +lin church_N = mkN "templom" ; +lin city_N = mkN "város" ; +lin 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 "hideg" ; +-- lin come_V = mkV "" ; +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 "unokatestvér" ; --short "unoka" +lin cow_N = mkN "tehén" ; +-- 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 "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 "orvos" ; +lin dog_N = mkN "kutya" ; +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 "fül" ; +lin earth_N = mkN "föld" ; +-- lin eat_V2 = mkV2 "" ; +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 "gyár" ; +-- lin fall_V = mkV "" ; +-- lin far_Adv = mkA "" ; +lin fat_N = mkN "kövér" ; +lin father_N2 = mkN2 "apa" ; +-- lin fear_V2 = mkV2 "" ; +-- lin fear_VS = mkVS "" ; +lin feather_N = mkN "madártoll" ; +-- lin fight_V2 = mkV2 "" ; +-- lin find_V2 = mkV2 "" ; +lin fingernail_N = mkN "köröm" ; +lin fire_N = mkN "tűz" ; +lin fish_N = mkN "hal" ; +-- lin float_V = mkV "" ; +lin floor_N = mkN "padló" ; +-- lin flow_V = mkV "" ; +lin flower_N = mkN "vírág" ; +lin fly_V = mkV "repül" ; +lin fog_N = mkN "köd" ; +lin foot_N = mkN "láb" ; --same as leg, to specify "lábfej" +lin forest_N = mkN "erdő" ; +-- lin forget_V2 = mkV2 "" ; +-- lin freeze_V = mkV "" ; +lin fridge_N = mkN "hűtő" ; +lin friend_N = mkN "barát" ; +lin fruit_N = mkN "gyümölcs" ; +lin full_A = mkA "tele" ; +-- --lin fun_AV + +---- +-- G + +lin garden_N = mkN "kert" ; +lin girl_N = mkN "lány" ; +-- lin give_V3 = mkV3 "" ; +lin glove_N = mkN "kesztyű" ; +-- lin go_V = mkV "" ; +lin gold_N = mkN "arany" ; +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 "haj" ; +lin hand_N = mkN "kéz" ; +-- lin harbour_N = mkN "" ; +lin hat_N = mkN "kalap" ; +-- lin hate_V2 = mkV2 "" ; +lin head_N = mkN "fej" ; +-- lin hear_V2 = mkV2 "" ; +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 "forró" ; +lin house_N = mkN "ház" ; +-- lin hunt_V2 = mkV2 "" ; +lin husband_N = mkN "férj" ; + +-------- +-- I - K + +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 "király" ; +lin knee_N = mkN "térd" ; +-- lin know_V2 = mkV2 "" ; +-- lin know_VQ = mkVQ "" ; +-- lin know_VS = mkV "" ; + + +---- +-- L + +lin lake_N = mkN "tó" ; +lin lamp_N = mkN "lámpa" ; +lin language_N = mkN "nyelv" ; +-- lin laugh_V = mkV "" ; +lin leaf_N = mkN "levél" ; +-- lin learn_V2 = mkV2 "" ; +lin leather_N = mkN "bőr" ; +-- lin leave_V2 = mkV2 "" ; +lin leg_N = mkN "láb" ; +-- 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 "szerelem" ; +-- lin love_V2 = mkV2 "" ; + +---- +-- M + +lin man_N = mkN "férfi" "ak" harmA ; -- force plural allomorph and a-harmony +lin married_A2 = mkA2 "házas" Ins ; +lin meat_N = mkN "hús" ; +lin milk_N = mkN "tej" ; +lin moon_N = mkN "hold" ; +lin mother_N2 = mkN2 "anya" ; +lin mountain_N = mkN "hegy" ; +lin mouth_N = mkN "száj" ; +lin music_N = mkN "zene" ; + +---- +-- N + +lin name_N = mkN "név" "nevet" ; +lin narrow_A = mkA "keskeny" ; --also "szűk" +lin near_A = mkA "közel" ; +lin neck_N = mkN "nyak" ; +lin new_A = mkA "új" ; +lin newspaper_N = mkN "újság" ; +lin night_N = mkN "éjszak" ; --also shortened to "éj" ("este" more for evening) +lin nose_N = mkN "orr" ; +lin now_Adv = mkAdv "most" ; +lin number_N = mkN "szám" ; -- --- 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 "olaj" ; +lin old_A = mkA "öreg" ; --also "idős" +-- lin open_V2 = mkV2 "" ; +-- lin paint_V2A = mkV2A "" ; +lin paper_N = mkN "papír" ; +-- lin paris_PN = mkPN "Paris" ; +lin peace_N = mkN "béke" ; +lin pen_N = mkN "toll" ; +lin person_N = mkN "ember" ; +lin planet_N = mkN "bolygó" ; +lin plastic_N = mkN "műanyag" ; +-- lin play_V = mkV "" ; +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 "" ; -- --- 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 "kírálynő" ; +lin question_N = mkN "kérdés" ; +lin radio_N = mkN "rádió" ; +lin rain_N = mkN "eső" ; +-- lin rain_V0 = mkV "" ; +-- lin read_V2 = mkV2 "" ; +lin ready_A = mkA "kész" ; +lin reason_N = mkN "ok" ; +lin red_A = mkA "piros" ; +lin religion_N = mkN "vallás" ; +lin restaurant_N = mkN "étterem" ; +lin river_N = mkN "folyó" ; +lin road_N = mkN "út" ; +lin rock_N = mkN "szikla" ; +lin roof_N = mkN "plafon" ; +lin root_N = mkN "gyökér" ; +lin rope_N = mkN "kötél" ; +-- lin rotten_A = mkA "" ; +-- lin round_A = mkA "" ; +-- lin rub_V2 = mkV2 "" ; +lin rubber_N = mkN "gumi" ; +lin rule_N = mkN "szabály" ; +-- lin run_V = mkV "" ; + +---- +-- S + +lin salt_N = mkN "só" ; +lin sand_N = mkN "homok" ; +-- lin say_VS = mkVS "" ; +lin school_N = mkN "iskola" ; +lin science_N = mkN "tudomány" ; +-- lin scratch_V2 = mkV2 "" ; +lin sea_N = mkN "tenger" ; +lin see_V2 = mkV2 "lát" ; +lin seed_N = mkN "mag" ; +-- 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 "ing" ; --shirt like t-shirt or the more formal? +lin shoe_N = mkN "cipő" ; +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 "bőr" ; +lin sky_N = mkN "ég" ; +-- lin sleep_V = mkV "" ; +lin small_A = mkA "kicsi" ; +-- lin smell_V = mkV "" ; +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 "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 "egyenes" ; +lin student_N = mkN "diák" ; +lin stupid_A = mkA "buta" ; --also "hülye" +-- lin suck_V2 = mkV2 "" ; +lin sun_N = mkN "nap" ; --same as day +-- lin swell_V = mkV "" ; +-- lin swim_V = mkV "" ; + +---- +-- T + + +lin table_N = mkN "asztal" ; +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 "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 "nyelv" ; --same as language +lin tooth_N = mkN "fog" ; +lin train_N = mkN "vonat" ; +-- lin travel_V = mkV "" ; +lin tree_N = mkN "fa" ; +-- lin turn_V = mkV "" ; + +-------- +-- U - V + +lin ugly_A = mkA "csúf" ; +-- lin uncertain_A = mkA "" ; +-- lin understand_V2 = mkV2 "" ; +lin university_N = mkN "egyetem" ; +lin village_N = mkN "falu" ; +-- lin vomit_V = mkV2 "" ; + +-------- +-- W - Y + +-- lin wait_V2 = mkV2 "" ; +-- lin walk_V = mkV "" ; +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 "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 "szél" ; +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ő" "nőket" ; +-- lin wonder_VQ = mkVQ "" ; +lin wood_N = mkN "fa" ; --same as tree +lin worm_N = mkN "féreg" ; --also "kukac" +-- lin write_V2 = mkV2 "" ; +lin year_N = mkN "év" ; +lin yellow_A = mkA "sárga" ; +lin young_A = mkA "fiatal" ; } diff --git a/src/hungarian/MissingHun.gf b/src/hungarian/MissingHun.gf new file mode 100644 index 000000000..b060230d4 --- /dev/null +++ b/src/hungarian/MissingHun.gf @@ -0,0 +1,540 @@ +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 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" ; +} 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/NounHun.gf b/src/hungarian/NounHun.gf index be7cc5fe7..b995be70a 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -1,144 +1,228 @@ -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, Coordination in { + + flags optimize=all_subs ; + + lin + +--2 Noun phrases + +-- : Det -> CN -> NP + DetCN det cn = emptyNP ** det ** { + s = \\c => det.s ! Nom ++ 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 = \\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 ** { + -- 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 ** { + 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 ; + 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 => 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 ; + } ; + + -- : Quant -> Num -> Ord -> Det ; -- these five best + DetQuantOrd quant num ord = + let theseFive = DetQuant quant num in theseFive ** { + s = \\c => theseFive.s ! c ++ ord.s ! num.n ; + sp = \\c => theseFive.sp ! c ++ ord.s ! num.n ; + } ; + +-- 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 ** { + n = Sg -- Numerals take noun in Sg: e.g. öt város, literally 'five city' + } ; + + -- : Digits -> Card ; + NumDigits dig = dig ** { + s = \\place => dig.s ! NCard ; + numtype = IsNum ; + } ; + + -- : Numeral -> Card ; + 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 = 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 ** { } ; + + -- : Quant + DefArt = { + s, + sp = \\_,_ => pre {"a" ; "az" / v } ; + isIndefArt = False ; + objdef = Def ; + } ; + + -- : Quant + IndefArt = { + s, + sp = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; + isIndefArt = True ; + objdef = Indef ; + } ; + + -- : 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 ++ ap.compar + } ; + + -- : CN -> RS -> CN ; + RelCN cn rs = cn ** { + s = \\n,c => cn.s ! n ! c ++ rs.s ! n ! c + } ; + + -- : 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 ** { } ; + +--2 Apposition + +-- This is certainly overgenerating. + + -- : CN -> NP -> CN ; -- city Paris (, numbers x and y) + ApposCN cn np = cn ** { + s = \\n,c => cn.s ! n ! c ++ np.s ! Nom + } ; + +--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/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf new file mode 100644 index 000000000..40acfc2aa --- /dev/null +++ b/src/hungarian/NounMorphoHun.gf @@ -0,0 +1,360 @@ +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, apa, anya, fa": + dAlma : (nom : Str) -> (acc : Str) -> Noun = \alma,almát -> + let almá : Str = init almát ; + + -- Apply mkNoun to the lengthened stem "almá" or "kefé" + nAlmá : Noun = mkNoun almá ; + 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 : (nom : Str) -> (acc : Str) -> Noun = \madár,madarat -> + let madara = init madarat ; + nMadara = mkNounHarm (getHarm madara) "k" madara ; + nMadár = mkNoun madár ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc use the "madara"/"neve" stem + | => nMadara.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "madár"/"név" as the stem. + _ => nMadár.s ! n ! c + + } ; + } ; + + --Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. + --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 "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. + _ => nLó.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 : (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 ; + + -- 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 + -- 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. +regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> + case of { + -- alma, almát + <_ + "a", _ + "át"> + |<_ + "e" ,_ + "ét"> => dAlma n a ; + + + <_ + "á" + #c, -- madár, madarat + _ + "a" + #c + #v + "t"> + + |<_ + "é" + #c, -- név, nevet + _ + "e" + #c + #v + "t"> + + |<_ + "í" + #c, -- víz, vizet + _ + "i" + #c + #v + "t"> => dMadár n a ; + + + <_ + #v + #c, -- majom, majmot + _ + #c + #v + "t"> => dMajom n a ; + + + <_ + "ó", -- ló, lovat + _ + "o" + #c + #v + "t"> + + |<_ + "ő", -- kő, követ + _ + "ö" + #c + #v + "t"> + + |<_ + "é", -- lé, levet + _ + "e" + #c + #v + "t"> => dLó n a ; + + _ => mkNoun n + } ; + + regNoun : Str -> Noun = \sgnom -> case sgnom of { + _ + ("a"|"e") => dAlma sgnom (lengthen sgnom + "t") ; + #c + ("á"|"é") + #c => mkNoun sgnom ; + _ + ("á"|"é") + #c => dMadár sgnom (név2nevet sgnom) ; + _ + ("ó"|"é"|"ő"|"ű") => dLó sgnom (ló2lovat sgnom) ; + _ + #v + #c + #v + #c => dMajom sgnom (majom2majmo sgnom); + _ => mkNoun sgnom -- Fall back to the regular paradigm + } where { + név2nevet : Str -> Str = \név -> + let né_v : Str*Str = case név of {né + v@#c => } ; + né = né_v.p1 ; + v = né_v.p2 ; + ne = shorten né ; + e = case last ne of { + "i" => "e" ; + _ => last ne } ; + in ne + v + e + "t" ; + ló2lovat : Str -> Str = \ló -> + let lo = shorten ló ; + lov = lo + "v" ; + at : Str = case ló of { + _ + "ó" => "at" ; + _ => "et" } ; + in lov + at ; + majom2majmo : Str -> Str = \majom -> + let majo_m : Str*Str = case majom of {majo + m@#c => } ; + majo = majo_m.p1 ; + m = majo_m.p2 ; + mo = m + last majo ; + maj = init majo ; + in maj + mo + } ; + +--TODO: Special cases (enter these words manually to not complicate the paradigms): +--dTó: szó special case which fulfills the plural cases but not the or case ("szót" not "szavat") +--dLó: special case "lén" not "leven" +--dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting +--endCaseConsAcc: "falat, fület, várat, könnyet", +--also special in superessive case "falon, fülek, vizen" +--pattern matching in regNoun: one-syllable words that in fact belong to dMadár: "nyár, név" +-------------------------------------------------------------------------------- +-- Following code by EG in 2009 (?), comments and some additions by IL 2020 + +param + -- Harmony types + Harm = H_a | H_e | H_o ; + +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") ; + + -- 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 case: just duplicate the single letter + x + s@? => x + s + s } ; + + -- Function to test if a string ends in a vowel + vowFinal : Str -> Bool = \str -> + case str of { + _ + #v => True ; -- Matching a string against a pattern. + _ => False + } ; + + lengthen : Str -> Str = \str -> case str of { + x + "a" => x + "á" ; + x + "e" => x + "é" ; + x + "i" => x + "í" ; + x + "o" => x + "ó" ; + x + "u" => x + "ú" ; + x + "ö" => x + "ő" ; + x + "ü" => x + "ű" ; + _ => Predef.error "Lengthening not applicable to" ++ str + } ; + + shorten : Str -> Str = \str -> case str of { + x + "á" => x + "a" ; + x + "é" => x + "e" ; + x + "í" => x + "i" ; + x + "ó" => x + "o" ; + x + "ú" => x + "u" ; + x + "ő" => x + "ö" ; + x + "ű" => x + "ü" ; + _ => Predef.error "Shortening not applicable to" ++ str + } ; + + -- Function to get a harmony from a string + getHarm : Str -> Harm = \s -> case s of { + _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; + _ + ("ö" | "ő" | "ü") + _ => H_o ; + _ => H_e + } ; + + -- Used as a table of allomorphs for a give case. + HarmForms : Type = Harm => Str ; + + -- Functions for constructing a HarmForms table. + harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> table { + H_a => a ; + H_e => e ; + H_o => o + } ; + harm : Str -> Str -> HarmForms = \a,e -> harm3 a e e ; + harm1 : Str -> HarmForms = \i -> harm i i ; + + -- Variant of case forms when the noun stem ends in consonant. + endCaseCons : Case -> HarmForms = \c -> case c of { + Nom => harm1 [] ; + Acc => harm3 "ot" "et" "öt" ; + Dat => harm "nak" "nek" ; + Ill => harm "ba" "be" ; + Ine => harm "ban" "ben" ; + Ela => harm "ból" "ből" ; + All => harm3 "hoz" "hez" "höz" ; + Ade => harm "nál" "nél" ; + Abl => harm "tól" "től" ; + Sub => harm "ra" "re" ; + Sup => harm3 "on" "en" "ön" ; + Del => harm "ról" "ről" ; + Cau => harm1 "ért" ; + Ins => harm "al" "el" ; + Tra => harm "á" "é" + -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' + -- Ter => harm1 "ig" ; -- Terminative 'as far as ' + -- For => harm1 "ként" ; -- Formal 'as ' + -- Tem => harm1 "kor" -- Temporal 'at '. Only used with numerals. + } ; + + -- Variant where accusative has the allomorph -at + endCaseConsAccAt : Case -> HarmForms = \c -> case c of { + Acc => harm3 "at" "et" "öt" ; + _ => endCaseCons c + } ; + + -- Variant where accusative has the allomorph -t for consonants + -- Examples: "pénz, bor, orr, szín, lány, kés, dal" + endCaseConsAcc : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + _ => endCaseCons c + } ; + + -- Variant of case forms when the noun stem ends in vowel. + endCaseVow : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + Sup => harm1 "n" ; + Ins => harm "val" "vel" ; + Tra => harm "vá" "vé" ; + + -- Other forms are shared with endCaseCons. + _ => endCaseCons c + } ; + + -- Function to return a plural allomorph given the stem (e.g. név, almá). + pluralAllomorph : (stem : Str) -> Str = pluralAllomorphLowStem False ; + + -- Function to return a plural allomorph given lowering stem or not + -- Examples of lowering stems: ág, ágy, ár, fal, fog, gyár, hal, has, hát, ház, hold, láz, lyuk, nyak, olaj, oldal, toll, ujj, vonal + -- Examples of lowering stems: férj, fej, hely, fül, könny, könyv, mell, szög + pluralAllomorphLowStem : (low : Bool) -> (stem : Str) -> Str = \low,stem -> + case of { + <_,True> => "k" ; + => harm "ak" "ek" ! getHarm stem ; + _ => harm3 "ok" "ek" "ök" ! getHarm stem + } ; + + + -- Harmony and plural allomorph read from the singular nominative + mkNoun : Str -> Noun = \w -> + mkNounHarm (getHarm w) (pluralAllomorph w) w ; + + -- Harmony and plural allomorph given explicitly (check if the True makes it bad) + mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = mkNounHarmAcc True ; + + mkNounHarmAcc : (useAt : Bool) -> Harm -> (plural : Str) -> Str -> Noun = \useAt,h,plural,w -> + let endCaseSg : Case -> HarmForms = case of { + <_,_ + #v> => endCaseVow ; + <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j" + |"ly"|"l"|"r"|"n"|"ny"|"ssz"|"zz" + |"ss"|"ll"|"rr"|"nn"|"ns"|"nsz" + |"nz")> => endCaseConsAcc ; + => endCaseConsAccAt ; + _ => endCaseCons } ; + endCasePl : Case -> HarmForms = case of { + <"ak",_> => endCaseConsAccAt ; + <_,True> => endCaseConsAccAt ; + _ => endCaseCons } ; + -- Last consonant doubles before instrumental and translative + duplConsStem : Str = case vowFinal w of { + True => w ; + False => duplicateLast w } ; + + -- Noun is {s : Number => Case => Str}, we construct nested tables. + in {s = table { + Sg => table { + -- Double the last letter (if consonant) before Ins, Tra + c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; + c@_ => w + endCaseSg c ! h } ; + + Pl => table { + -- Double the plural k before Ins, Tra + c@(Ins|Tra) => w + plural + "k" + endCasePl c ! h ; + + -- endCaseCons, because we only use -k as plural morpheme. + -- If we add possessive forms with allomorph -i, then revise. + c@_ => w + plural + endCasePl c ! h } + } + } ; + +} diff --git a/src/hungarian/NounMorphoHunOneArgument.gf b/src/hungarian/NounMorphoHunOneArgument.gf new file mode 100644 index 000000000..979b63269 --- /dev/null +++ b/src/hungarian/NounMorphoHunOneArgument.gf @@ -0,0 +1,361 @@ +resource NounMorphoHunOneArgument = ParamHun ** open Prelude, Predef in { + +oper + Noun = {s : Number => Case => Str} ; + + -- Paradigm functions + -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf + + -- Words like "alma, kefe, apa, anya, fa": + dAlma : Str -> Noun = \alma -> + let almá : Str = lengthen alma; + + nAlmá : Noun = mkNoun almá ; + in {s = \\n,c => case of { + -- Singular nominative uses the given form, e.g. "alma" or "kefe" + => alma ; + + -- The rest of the forms are formed with the regular constructor, + -- using "almá" or "kefé" as the stem. + _ => nAlmá.s ! n ! c + } ; + } ; + +-- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural +-- No special case here +-- dMadár: "víz" has wovel shortening but "vizek" not "vizik", implement differently? +dMadár : Str -> Noun = \madár -> + let r = last madár ; + madá = init madár ; + mada = shorten madá ; -- shortens vowels + a = last mada ; + a = case a of { + "e"|"i" => "e" ; + a => a + } ; + madara = mada + r + a ; + nMadara = mkNounHarm (getHarm madara) "k" madara ; + nMadár = mkNoun madár ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc use the "madara"/"neve" stem + | => nMadara.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "madár"/"név" as the stem. + _ => nMadár.s ! n ! c + + } ; + } ; + +--Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. +-- "lovon" instead of "lón" fixed but that gives the following problems: +dLó : Str -> Noun = \ló -> + let lo = shorten ló ; + lov = lo + "v" ; + ak : Str = case ló of { + _ + ("ö" | "ő") => "ek" ; + _ + ("o" | "ó") => "ak" ; + lé => shorten (last lé) + "k"} ; + harmonyPlural : Harm = case ló of { + _ + ("ö" | "ő") => H_e ; -- All plural allomorphs have E harmony, singular ones have O. + _ + ("o" | "ó") => H_a ; + lé => getHarm (lé)} ; + nLov = mkNounHarm harmonyPlural ak lov ; + nLó = mkNoun ló ; + in {s = \\n,c => case of { + + -- All plural forms and Sg Acc, Sg Sup use the "lov" stem + | | => nLov.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "ló" as the stem. + _ => nLó.s ! n ! c + + } ; + } ; + +--Handles words like "tó, hó"" which are "tavak, havak" in plural. +--(Since I only have these examples for now I do a simplified case with ó, a) +-- "tavon" instead of "tón" case fixed, works automatically with the Sup rules +dTó : Str -> Noun = \tó -> + let t = init tó ; + tav = t + "av" ; + nTav = mkNounHarm H_a "ak" tav ; + nTó = mkNoun tó ; + in {s = \\n,c => case of { + + -- All plural forms and Sg Acc use the "tav" stem + || => nTav.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "tó" as the stem. + _ => nTó.s ! n ! c + + } ; + } ; + +--Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) +--More examples: "ajak, bokor, cukor, csokor, eper, fészek, fodor, gödör, haszon, iker, izom, kölyök, köröm, méreg, piszok, sarok, selyem, szeder, szobor, takony, terem, titok, torok, torony, tükör, vödör" -> +-- "ajkat, bokrot, cukrot, csokrot, epret, fészket, fodrot, gödröt, hasznot, ikret, izmot, kölyköt, körmet, mérget, piszkot, sarkot, selymet, szedret, szobrot, taknyot, termet, titkot, torkot, tornyot, tükröt, vödröt" +-- case handled +dMajom : Str -> Noun = \majom -> + -- Str*Str is syntactic sugar for {p1 : Str ; p2 : Str} ; + -- confusing syntax: you can't write let : Str*Str = … + -- it has to be called something else, and then you + -- can get "tako" and "ny" with p1, p2. + let tako_ny : Str*Str = case majom of { + x + dzs@#trigraph => ; + x + zs@#digraph => ; + -- ? pattern matches exactly 1 character + x + s@? => } ; + tako = tako_ny.p1 ; + ny = tako_ny.p2 ; + + nyo = ny + last tako ; + tak = init tako ; + taknyo = tak + nyo ; + nMajmo = mkNounHarm (getHarm taknyo) "k" taknyo ; + nMajom = mkNoun majom ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem + | | => nMajmo.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "majom" as the stem. + _ => nMajom.s ! n ! c + } ; + } ; + +--Handles words like "sátor, álom, alkalom, farok, halom, vászon" +-- "sátrat, álmat, alkalmat, farkat, halmat, vásznat" +-- (bátor not noun) +dFarok : Str -> Noun = \farok -> + let k = last farok ; + far = init (init farok) ; + fark = far + k ; + nFark = mkNounHarm (getHarm fark) "ak" fark ; + nFarok = mkNoun farok ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc and Sg Sup use the "fark" stem + | | => nFark.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "farok" as the stem. + _ => nFarok.s ! n ! c + } ; + } ; + +-- More words not covered by current paradigms: +-- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf +-- TODO: falu ~ falva-k (v-case) +-- TODO: teher ~ terhet (consonant-crossing) +-- TODO: do we need possessive forms? e.g. fiú ~ fia{m,d,tok} + +-- regNoun is a /smart paradigm/: it takes one or a couple of forms, +-- and decides which (non-smart) paradigm is the most likely to match. +regNoun : Str -> Noun = \sgnom -> case sgnom of { + _ + "a"|"e" => dAlma sgnom ; + (? | #digraph | #trigraph) + ("á"|"é") + (? | #digraph | #trigraph) => mkNoun sgnom ; + _ + ("á"|"é") + ? => dMadár sgnom ; + _ + "é"|"ő"|"ű" => dLó sgnom ; + _ + "ó" => dTó sgnom ; + _ + "alom" => dFarok sgnom ; + _ + "elem" => dMajom sgnom ; + + -- TODO: more non-smart paradigms + more pattern matching + -- TODO: smart paradigms with >1 form. Which forms are the most descriptive? + + _ => mkNoun sgnom -- Fall back to the regular paradigm +} ; + +--TODO: Special cases (enter these words manually to not complicate the paradigms): +--dTó: szó special case which fulfills the plural cases but not the or case ("szót" not "szavat") +--dLó: special case "lén" not "leven" +--dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting +--endCaseConsAcc: "falat, fület, várat, könnyet", +--also special in superessive case "falon, fülek, vizen" +--pattern matching in regNoun: one-syllable words that in fact belong to dMadár: "nyár, név" +--------------------------------------------------------------------------------------------- +-- Following code by EG in 2009 (?), comments and some additions by IL 2020 + +param + -- Harmony types + Harm = H_a | H_e | H_o ; + +oper + + -- Vowels as a pattern. + v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | + "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; + -- Digraphs + digraph : pattern Str = #("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") ; + + -- Trigraphs + trigraph : pattern Str = #("dzs") ; + + duplicateLast : Str -> Str = \str -> case str of { + x + "dzs" => x + "ddzs" ; + x + "ny" => x + "nny" ; -- takony : takonnyal + x + "cs" => x + "ccs" ; + x + "dz" => x + "ddz" ; + x + "gy" => x + "ggy" ; + x + "ly" => x + "lly" ; + x + "sz" => x + "ssz" ; + x + "ty" => x + "tty" ; + x + "zs" => x + "zzs" ; + + -- Base cacse: just duplicate the single letter + x + s@? => x + s + s } ; + + -- Function to test if a string ends in a vowel + vowFinal : Str -> Bool = \str -> + case str of { + _ + #v => True ; -- Matching a string against a pattern. + _ => False + } ; + + lengthen : Str -> Str = \str -> case str of { + x + "a" => x + "á" ; + x + "e" => x + "é" ; + x + "i" => x + "í" ; + x + "o" => x + "ó" ; + x + "u" => x + "ú" ; + x + "ö" => x + "ő" ; + x + "ü" => x + "ű" ; + _ => Predef.error "Lengthening not applicable to" ++ str + } ; + + shorten : Str -> Str = \str -> case str of { + x + "á" => x + "a" ; + x + "é" => x + "e" ; + x + "í" => x + "i" ; + x + "ó" => x + "o" ; + x + "ú" => x + "u" ; + x + "ő" => x + "ö" ; + x + "ű" => x + "ü" ; + _ => Predef.error "Shortening not applicable to" ++ str + } ; + + -- Function to get a harmony from a string + getHarm : Str -> Harm = \s -> case s of { + _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; + _ + ("ö" | "ő" | "ü") + _ => H_o ; + _ => H_e + } ; + + -- Used as a table of allomorphs for a give case. + HarmForms : Type = Harm => Str ; + + -- Functions for constructing a HarmForms table. + harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> table { + H_a => a ; + H_e => e ; + H_o => o + } ; + harm : Str -> Str -> HarmForms = \a,e -> harm3 a e e ; + harm1 : Str -> HarmForms = \i -> harm i i ; + + -- Variant of case forms when the noun stem ends in consonant. + endCaseCons : Case -> HarmForms = \c -> case c of { + Nom => harm1 [] ; + Acc => harm3 "ot" "et" "öt" ; + Dat => harm "nak" "nek" ; + Ill => harm "ba" "be" ; + Ine => harm "ban" "ben" ; + Ela => harm "ból" "ből" ; + All => harm3 "hoz" "hez" "höz" ; + Ade => harm "nál" "nél" ; + Abl => harm "tól" "től" ; + Sub => harm "ra" "re" ; + Sup => harm3 "on" "en" "ön" ; + Del => harm "ról" "ről" ; + Cau => harm1 "ért" ; + Ins => harm "al" "el" ; + Tra => harm "á" "é" + -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' + -- Ter => harm1 "ig" ; -- Terminative 'as far as ' + -- For => harm1 "ként" ; -- Formal 'as ' + -- Tem => harm1 "kor" -- Temporal 'at '. Only used with numerals. + } ; + + -- Variant where accusative has the allomorph -at + endCaseConsAccAt : Case -> HarmForms = \c -> case c of { + Acc => harm3 "at" "et" "öt" ; + _ => endCaseCons c + } ; + + -- Variant where accusative has the allomorph -t for consonants + -- Examples: "pénz, bor, orr, szín, lány, kés, dal" + endCaseConsAcc : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + _ => endCaseCons c + } ; + + -- Variant of case forms when the noun stem ends in vowel. + endCaseVow : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + Sup => harm1 "n" ; + Ins => harm "val" "vel" ; + Tra => harm "vá" "vé" ; + + -- Other forms are shared with endCaseCons. + _ => endCaseCons c + } ; + + -- Function to return a plural allomorph given the stem (e.g. név, almá). + pluralAllomorph : (stem : Str) -> Str = pluralAllomorphLowStem False ; + + -- Function to return a plural allomorph given lowering stem or not + -- Examples of lowering stems: ág, ágy, ár, fal, fog, gyár, hal, has, hát, ház, hold, láz, lyuk, nyak, olaj, oldal, toll, ujj, vonal + -- Examples of lowering stems: férj, fej, hely, fül, könny, könyv, mell, szög + pluralAllomorphLowStem : (low : Bool) -> (stem : Str) -> Str = \low,stem -> + case of { + <_,True> => "k" ; + => harm "ak" "ek" ! getHarm stem ; + _ => harm3 "ok" "ek" "ök" ! getHarm stem + } ; + + + -- Harmony and plural allomorph read from the singular nominative + mkNoun : Str -> Noun = \w -> + mkNounHarm (getHarm w) (pluralAllomorph w) w ; + + -- Harmony and plural allomorph given explicitly (check if the True makes it bad) + mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = mkNounHarmAcc True ; + + mkNounHarmAcc : (useAt : Bool) -> Harm -> (plural : Str) -> Str -> Noun = \useAt,h,plural,w -> + let endCaseSg : Case -> HarmForms = case of { + <_,_ + #v> => endCaseVow ; + <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j" + |"ly"|"l"|"r"|"n"|"ny"|"ssz"|"zz" + |"ss"|"ll"|"rr"|"nn"|"ns"|"nsz" + |"nz")> => endCaseConsAcc ; + => endCaseConsAccAt ; + _ => endCaseCons } ; + endCasePl : Case -> HarmForms = case of { + <"ak",_> => endCaseConsAccAt ; + <_,True> => endCaseConsAccAt ; + _ => endCaseCons } ; + -- Last consonant doubles before instrumental and translative + duplConsStem : Str = case vowFinal w of { + True => w ; + False => duplicateLast w } ; + + -- Noun is {s : Number => Case => Str}, we construct nested tables. + in {s = table { + Sg => table { + -- Double the last letter (if consonant) before Ins, Tra + c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; + c@_ => w + endCaseSg c ! h } ; + + Pl => table { + -- Double the plural k before Ins, Tra + c@(Ins|Tra) => w + plural + "k" + endCasePl c ! h ; + + -- endCaseCons, because we only use -k as plural morpheme. + -- If we add possessive forms with allomorph -i, then revise. + c@_ => w + plural + endCasePl c ! h } + } + } ; + +} diff --git a/src/hungarian/NumeralHun.gf b/src/hungarian/NumeralHun.gf index 680913493..f9c66af18 100644 --- a/src/hungarian/NumeralHun.gf +++ b/src/hungarian/NumeralHun.gf @@ -1,99 +1,129 @@ -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 = numNumber ; numtype = IsNum} ; + -- : Sub100 ; -- 11 + pot111 = {s = table {p => "tizenegy"} ; n = numNumber ; numtype = IsNum} ; + -- : Digit -> Sub100 ; -- 10 + d + pot1to19 d = + {s = table {p => "tizen" ++ d.s ! } ; + n = numNumber ; numtype = IsNum} ; + -- : Sub10 -> Sub100 ; -- coercion of 1..9 + pot0as1 n = + {s = table {p => n.s ! } ; + n = numNumber ; numtype = IsNum} ; + + -- : Digit -> Sub100 ; -- d * 10 + pot1 d = + {s = table {p => d.s ! } ; + n = numNumber ; numtype = IsNum} ; + -- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n + pot1plus d e = + {s = table {p => (d.s ! ) ++ e.s ! } ; + 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 = numNumber ; numtype = IsNum} ; + -- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n + pot2plus d e = + {s = table {p => (d.s ! ) ++ "száz" ++ e.s ! p} ; + 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 = numNumber ; numtype = IsNum} ; + -- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n + pot3plus n m = + {s = table {p => n.s ! Attrib ++ "ezer" ++ m.s ! p} ; + n = numNumber ; numtype = IsNum} ; + +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 = numNumber ; + numType = IsNum ; + } ; + + 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 + } ; } diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 5f3da0c56..da89f54f8 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -1,733 +1,194 @@ ---# -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$. + + Harmony : Type ; + harmA : Harmony ; + harmE : Harmony ; + harmO : Harmony ; + +--2 Nouns + + mkN : overload { + mkN : (sgnom : Str) -> N ; -- Predictable nouns from singular nominative. Accusative vowel is o for back harmony. No stem lowering (TODO better explanation/examples) + mkN : (sgnom : Str) -> (sggen : Str) -> N ; -- Singular nominative and accusative. Takes care of cases like … TODO example + mkN : (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 ; } ; --- ----- 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 ; --- --- --- ---} ; +--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 : overload { + mkA2 : Str -> Prep -> A2 ; + mkA2 : Str -> Case -> A2 ; + mkA2 : A -> 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. + } ; + + -- 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 + } ; + + 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 -> + -- 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. + + Harmony : Type = ResHun.Harm ; + harmA = ResHun.H_a ; + harmE = ResHun.H_e ; + harmO = ResHun.H_o ; + + mkN = overload { + mkN : Str -> N = + \s -> lin N (regNoun s) ; + + mkN : Str -> Str -> N = + \n,a-> lin N (regNounNomAcc n a) ; + + 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 (regNoun s) ; + mkN2 : N -> N2 = \n -> lin N2 n ; + } ; + + 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) ; + -- mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda -> + -- jakda ** {s = \\af => kiga ++ jakda.s ! af} ; + } ; + + mkA2 = overload { + mkA2 : A -> A2 = \a -> a ** {c2 = casePrep Nom} ; + mkA2 : 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 = casePrep c} ; + mkA2 : A -> Prep -> A2 = \a,p -> + lin A2 (a ** {c2 = p}) ; + } ; + + 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}) ; + } ; + + casePrep : Case -> Prep + = \c -> lin Prep (ResHun.mkPrep [] ** {c = c}) ; +-------------------------------------------------------------------------------- } diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf new file mode 100644 index 000000000..35d4e5ad8 --- /dev/null +++ b/src/hungarian/ParamHun.gf @@ -0,0 +1,111 @@ +resource ParamHun = ParamX ** open Prelude in { + +-------------------------------------------------------------------------------- +-- Phonology + +-------------------------------------------------------------------------------- +-- Morphophonology + + + +-------------------------------------------------------------------------------- +-- Nouns + +param + + Case = Nom | Acc | Dat + -- | PossStem -- TODO: Stem where possessive suffixes attach? + | Ill | Ine | Ela | All | Ade | Abl | Sub | Sup | Del -- Locatives + | Cau -- Causal-final 'for the purpose of, for the reason that' + | Ins -- Instrumental + | Tra -- Translative + -- | Ess | Ter | For + -- | Tem -- Temporal, e.g. hatkor ‘six o’clock’ (from hat ‘6’) + ; + + + 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 } ; + + sc2case : SubjCase -> Case = \sc -> + case sc of { + SCNom => Nom ; + SCDat => Dat + } ; + +-------------------------------------------------------------------------------- +-- 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 + + -- For object agreement in V2 + ObjDef = + Def + | Indef ; + + 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/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 --- ---} - -} diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 4f1fe8131..14fcb2cab 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, + 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 ! …} ; + + 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/README.md b/src/hungarian/README.md new file mode 100644 index 000000000..f9857d1e5 --- /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, Julia Jansson, 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/RelativeHun.gf b/src/hungarian/RelativeHun.gf index 67316dc16..84b873a19 100644 --- a/src/hungarian/RelativeHun.gf +++ b/src/hungarian/RelativeHun.gf @@ -1,56 +1,31 @@ -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 = relVP ; + + -- : RP -> ClSlash -> RCl ; -- whom John loves + RelSlash = relSlash ; + + -- : RP ; + 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 81da3b47d..5426e0d24 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -3,550 +3,376 @@ --1 Hungarian auxiliary operations. -- This module contains operations that are needed to make the --- resource syntax work. - -resource ResHun = ParamX ** open Prelude in -{ - - flags - optimize=noexpand ; - coding = utf8 ; - +-- resource syntax work. -- 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 - ; +resource ResHun = NounMorphoHun ** open Prelude, Predef in { - Harm = H_a | H_e | H_o ; +-------------------------------------------------------------------------------- +-- NP - oper - Noun = {s : Number => Case => Str} ; +-- Noun morphology is in NounMorphoHun - 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" +oper + BaseNP : Type = { + agr : Person*Number ; + objdef : ObjDef ; + empty : Str ; -- standard trick for pro-drop + } ; + + NounPhrase : Type = BaseNP ** { + s : Case => Str ; + } ; + + emptyNP : NounPhrase = { + s = \\_ => [] ; + agr = ; + objdef = Indef ; + empty = [] ; + } ; + + 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 + + Pronoun : Type = NounPhrase ** { + --poss : Str ; -- 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) + 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 + -- 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 + 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 + -- TODO add ordinal + } ; + + {- Numeral can become Num via + Noun.gf: NumNumeral : Numeral -> Card ; + Noun.gf: NumCard : Card -> Num ; + -} + Num : Type = Numeral ** { + n : Number ; -- Singular or plural + } ; + + baseNum : Num = { + s = \\_ => [] ; + n = Sg ; + numtype = NoNum + } ; + +-------------------------------------------------------------------------------- +-- Adpositions + + -- TODO: personal suffixes, e.g. felettem, általam, not *felett/által én + Adposition : Type = { + pr : Str ; -- Preposition + s : Str ; -- Postposition + c : Case ; + } ; + + mkPrep : Str -> Adposition = \str -> {s=str ; c=Nom ; pr=[]} ; + + emptyAdp : Adposition = mkPrep [] ; + +------------------ +-- Conj + + Conj : Type = { + s1 : Str ; + s2 : Str ; + n : Number ; + } ; + + mkConj : Str -> Number -> Conj = mkDConj [] ; + + mkDConj : (s1,s2 : Str) -> Number -> Conj = \s1,s2,num -> { + s1 = s1 ; + s2 = s2 ; + n = num ; + } ; +-------------------------------------------------------------------------------- +-- Adjectives + + AdjPhrase : Type = { + s : Number => Str ; + compar : Str -- Discontinuous: Én *nagyobb* vagyok *nálad*. + } ; + + emptyAP : AdjPhrase = { + s = \\_ => [] ; + compar = [] ; + } ; + + Adjective : Type = { + s : Degree => Number => Str + } ; + Adjective2 : Type = Adjective ** { + c2 : Adposition ; + } ; + + mkAdj : Str -> Adjective = \sg -> { + s = \\d,n => + let adj = case d of { + Compar => comparAdj sg ; + Superl => "leg" + comparAdj sg ; + _ => sg } ; + plural = case n of { + Sg => [] ; + Pl => pluralAdj adj } + in adj + plural + } ; + + -- 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" ; + "felső" => "felsőbb" ; + "belső" => "belsőbb" ; + _ + #v => stem + "bb" ; + _ => 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 + case last stem of { "ü" => "ek" ; + "i" => harm "ak" "ek" ! getHarm stem ; + _ => "k" } ; + + False => harm3 "ok" "ek" "ök" ! getHarm stem + } ; +-------------------------------------------------------------------------------- +-- Verbs + + 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 [] ; + => harm "unk" "ünk" ; + => harm3 "tok" "tek" "tök" ; -- TODO allomorphs -otok, -etek, -ötök + => harm "nak" "nek" -- TODO allomorphs -anak, -enek + } ; + + BaseVerb : Type = { + sc : SubjCase ; -- subject case + } ; + Verb : Type = BaseVerb ** { + s : VForm => Str ; + } ; + Verb2 : Type = BaseVerb ** { + s : ObjDef => VForm => Str ; + c2 : Case -- object case + } ; + Verb3 : Type = Verb2 ** { + -- 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) ; + + 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 endingsIndef "TODO:infinitive" ; -- TODO + + 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 = + \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 } ; - - 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 ; - harm1 : Str -> HarmForms = \i -> harm i i ; - - getHarm : Str -> Harm = \s -> case s of { - _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; - _ + ("ö" | "ő" | "ü") + _ => H_o ; - _ => H_e + sc = SCNom } ; - HarmForms : Type = Str * Str * Str ; + copula : Verb = mkVerbFull + "vagyok" + "vagy" + "van" + "vagyunk" + "vagytok" + "vannak" + "lenni" ; - useHarm : Harm -> HarmForms -> Str = \h,ss -> case h of { - H_a => ss.p1 ; - H_e => ss.p2 ; - H_o => ss.p3 + megvan : Verb = copula ** { + s = \\vf => "meg" + copula.s ! vf ; } ; - putHarmEnding : HarmForms -> Str -> Str = \hs,w -> - w + useHarm (getHarm w) hs ; +------------------ +-- VP - regNoun : Str -> Noun = \w -> { - s = \\n,c => - let h = getHarm w - in - w + useHarm h (endNumber n) + useHarm h (endCase c) - } ; + VerbPhrase : Type = Verb ** { + obj : Str ; + adv : Str ; + c2 : Case ; -- for RelSlash + } ; -- TODO more fields + + VPSlash : Type = Verb2 ** { + adv : Str ; + } ; + + useV : Verb -> VerbPhrase = \v -> v ** { + obj,adv = [] ; + c2 = Acc ; -- TODO check + } ; + + useVc : Verb2 -> VPSlash = \v2 -> v2 ** { + adv = [] ; + } ; + + insertObj : VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { + obj = np.s ! vps.c2 ; + + -- If verb's subject case is Dat and object Nom, verb agrees with obj. + s = \\vf => case of { + => vps.s ! np.objdef ! agr2vf np.agr ; + _ => vps.s ! np.objdef ! vf } ; + } ; + + insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ; + insertAdvSlash : VPSlash -> SS -> VPSlash = \vps,adv -> vps ** {adv = adv.s} ; + +-------------------------------------------------------------------------------- +-- 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 ** { + c2 : Case ; -- For RelSlash + } ; + + QClause : Type = Clause ; --- --- 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 --- } --- } ; --- --- ---} + 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 + ++ vp.s ! agr2vf np.agr + ++ vp.obj + ++ vp.adv + ++ 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 => Nom ; + SCDat => Dat } + in rp.s ! n ! subjcase + ++ vp.obj + ++ vp.adv + ++ vp.s ! VFin rp.agr.p1 n -- variable by number + } ; + + relSlash : RP -> ClSlash -> RClause = \rp,cls -> { + 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 } diff --git a/src/hungarian/SentenceHun.gf b/src/hungarian/SentenceHun.gf index 0760d91f8..82f884ca0 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 np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = []}) ; +{- + -- : 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 = \\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 "" ; + + -- 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..d95b845e3 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -1,148 +1,234 @@ -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 = "olyan" ; p = "mint"} ; +{- +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 = 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 "" ; + +----------------- +-- *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 = mkDet "kevés" Def Sg ; -- TODO check +lin many_Det = mkDet "sok" Def Sg ; -- TODO check +--lin much_Det = + +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" ; +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 "valami" Sg ; + +------- +-- 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 "által" ; +lin by8means_Prep = casePrep Ins ; +-- lin during_Prep = mkPrep ; +-- lin except_Prep = mkPrep ; +-- lin for_Prep = mkPrep "" ; +-- lin from_Prep = mkPrep "" ; +-- lin in8front_Prep = mkPrep "" ; +lin in_Prep = casePrep Ine ; +lin on_Prep = casePrep Ade ; +-- lin part_Prep = casePrep ; +-- lin possess_Prep = -- Suffix attaches to possessee, not possessor +-- lin through_Prep = mkPrep ; +lin to_Prep = casePrep All ; +lin under_Prep = mkPrep "alatt" ; +-- lin with_Prep = mkPrep "" ; +-- lin without_Prep = mkPrep "" ; + + +------- +-- Pron + +-- Pronouns are closed class, no constructor in ParadigmsHun. + -- it_Pron = + i_Pron = emptyNP ** { + s = caseTable "én" "engem" "nekem" + "belém" "bennem" "belőlem" -- inner locatives + "hozzám" "nálam" "tőlem" -- outer locatives + "rám" "rajtam" "rólam" -- outer locatives + "értem" -- Causative + "velem" -- Instrumental + nonExist ; -- Translative + agr = ; + objdef = Def ; + poss = "em" ; + } ; + youPol_Pron, + youSg_Pron = emptyNP ** { + s = caseTable "te" "teged" "neked" + "beléd" "benned" "belőled" + "hozzád" "nálad" "tőled" + "rád" "rajtad" "rólad" + "érted" -- Causative + "veled" -- Instrumental + nonExist ; -- Translative + agr = ; + objdef = Def ; + poss = "d" ; + } ; + he_Pron, + she_Pron = emptyNP ** { + s = caseTable "ő" "őt" "neki" + "belé" "benne" "belőle" + "hozzá" "nála" "tőle" + "rá" "rajta" "róla" + "érte" -- Causative + "vele" -- Instrumental + nonExist ; -- Translative + objdef = Def ; + } ; + we_Pron = emptyNP ** { + s = caseTable "mi" "minket" "nekünk" + "belénk" "bennünk" "belőlünk" + "hozzánk" "nálunk" "tőlünk" + "ránk" "rajtunk" "rólunk" + "értünk" -- Causative + "velünk" -- Instrumental + nonExist ; -- Translative + agr = ; + objdef = Def ; + } ; + + youPl_Pron = emptyNP ** { + s = caseTable "ti" "titeket" "nektek" + "belétek" "bennetek" "belőletek" + "hozzátok" "nálatok" "tőletek" + "rátok" "rajtatok" "rólatok" + "értetek" -- Causative + "veletek" -- Instrumental + nonExist ; -- Translative + agr = ; + objdef = Def ; + } ; + they_Pron = emptyNP ** { + s = caseTable "ők" "őket" "nekik" + "beléjük" "bennük" "belőlük" + "hozzájuk" "náluk" "tőlük" + "rájuk" "rajtuk" "róluk" + "értük" -- Causative + "velük" -- Instrumental + nonExist ; -- Translative + agr = ; + objdef = Def ; + } ; + +--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 = 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 "" ; +lin want_VV = mkVV "" subjunctive ; + +------ +-- Voc + +lin please_Voc = ss "" ; +-} } diff --git a/src/hungarian/SymbolHun.gf b/src/hungarian/SymbolHun.gf index 0866083a6..47f7c990a 100644 --- a/src/hungarian/SymbolHun.gf +++ b/src/hungarian/SymbolHun.gf @@ -1,48 +1,56 @@ ---# -path=.:../abstract:../common +concrete SymbolHun of Symbol = CatHun ** + open Prelude, ResHun, (NH=NounHun) in { -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 } ; --- ---} +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 ! Indep) ; + +oper + + mkPN : Str -> NounPhrase = \s -> emptyNP ** { + s = \\_ => s ; + } ; + +lin + -- : 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 = 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 = NH.MassNP (cn ** { + s = \\n,c => cn.s ! n ! c ++ i.s ! Indep}) ; + + -- : Symb -> S ; + SymbS sy = sy ; + + -- : Symb -> Card ; + SymbNum sy = baseNum ** {s = \\_ => sy.s} ; + + -- : Symb -> Ord ; + SymbOrd sy = {s = \\n => sy.s ; n=Pl} ; + +lincat + Symb, [Symb] = SS ; + +lin + MkSymb s = s ; + + BaseSymb = infixSS "és" ; + ConsSymb = infixSS "," ; } diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 215b24ed8..0202aa980 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -1,63 +1,141 @@ -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.insertObj ; +{- + -- : 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} + ++ ap.compar ; + } ; + + -- : 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 ; } diff --git a/src/hungarian/unittest/adjective.gftest b/src/hungarian/unittest/adjective.gftest new file mode 100644 index 000000000..c153d8675 --- /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 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 vagyok a legpirosabb + +-- It works! +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompNP (DetNP (DetQuantOrd DefArt NumPl (OrdSuperl red_A)))))))) NoVoc +LangHun: én a legpirosabbok vagyok diff --git a/src/hungarian/unittest/dative.gftest b/src/hungarian/unittest/dative.gftest new file mode 100644 index 000000000..990bfc0fd --- /dev/null +++ b/src/hungarian/unittest/dative.gftest @@ -0,0 +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 macskám + +-- LangEng: I have the cat +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))))) NoVoc +LangHun: nekem megvan a macska + +--In this case we don't have to use plural +-- LangEng: I have many cats +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN many_Det (UseN cat_N)))))) NoVoc +LangHun: nekem van sok macskám + +-- LangEng: I have some cats +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN somePl_Det (UseN cat_N)))))) NoVoc +LangHun: nekem van néhány macskám +-- "néhány" better translation than "némely" diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest new file mode 100644 index 000000000..0ceffde72 --- /dev/null +++ b/src/hungarian/unittest/inflection.gftest @@ -0,0 +1,364 @@ +--------------------- +-- Noun inflection -- +--------------------- + +-- Beer +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) +LangEng: under the beer +LangHun: a sör alatt + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) +LangEng: in the beer +LangHun: a sörben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) +LangEng: on the beer +LangHun: a sörnél + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) +# LangEng: of the beer +# LangHun: a söré + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) +LangEng: to the beer +LangHun: a sörhöz + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) +LangHun: a sörökben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) +LangHun: a söröknél + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) +# LangHun: a söröké + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) +LangHun: a sörökhöz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN beer_N)) +LangHun: a sörök alatt + +--látom not látok +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN beer_N)))))) NoVoc +LangEng: I see the beer +LangHun: én látom a sört + +--söröket not sörököt +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN beer_N)))))) NoVoc +LangEng: I see the beers +LangHun: én látom a söröket + + +-- Woman +-- nő-nőt, not *nő-növet +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) +LangEng: under the woman +LangHun: a nő alatt + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) +LangEng: in the woman +LangHun: a nőben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) +LangEng: on the woman +LangHun: a nőnél + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) +# LangEng: of the woman +# LangHun: a nőé + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN woman_N)) +LangEng: to the woman +LangHun: a nőhöz + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) +LangHun: a nőkben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) +LangHun: a nőknél + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) +# LangHun: a nőké + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) +LangHun: a nőkhöz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN woman_N)) +LangHun: a nők alatt + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN woman_N)))))) NoVoc +LangEng: I see the woman +LangHun: én látom a nőt + +--nőket not nőköt +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN woman_N)))))) NoVoc +LangEng: I see the women +LangHun: én látom a nőket + +-- Apple +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: under the apple +LangHun: az alma alatt + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: in the apple +LangHun: az almában + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: on the apple +LangHun: az almánál + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +# LangEng: of the apple +# LangHun: az almáé + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN apple_N)) +LangEng: to the apple +LangHun: az almához + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almákban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almáknál + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +# LangHun: az almáké + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almákhoz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN apple_N)) +LangHun: az almák alatt + + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN apple_N)))))) NoVoc +LangEng: I see the apple +LangHun: én látom az almát + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN apple_N)))))) NoVoc +LangEng: I see the apples +LangHun: én látom az almákat + +-- Bird +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) +LangEng: under the bird +LangHun: a madár alatt + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) +LangEng: in the bird +LangHun: a madárban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) +LangEng: on the bird +LangHun: a madárnál + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) +# LangEng: of the bird +# LangHun: a madáré + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN bird_N)) +LangEng: to the bird +LangHun: a madárhoz + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +LangHun: a madarakban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +LangHun: a madaraknál + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +# LangHun: a madaraké + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +LangHun: a madarakhoz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN bird_N)) +LangHun: a madarak alatt + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN bird_N)))))) NoVoc +LangEng: I see the bird +LangHun: én látom a madarat + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN bird_N)))))) NoVoc +LangEng: I see the birds +LangHun: én látom a madarakat + +-- Name +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) +LangEng: under the name +LangHun: a név alatt + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) +LangEng: in the name +LangHun: a névben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) +LangEng: on the name +LangHun: a névnél + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) +# LangEng: of the name +# LangHun: a névé + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN name_N)) +LangEng: to the name +LangHun: a névhez + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +LangHun: a nevekben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +LangHun: a neveknél + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +# LangHun: a neveké + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +LangHun: a nevekhez + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN name_N)) +LangHun: a nevek alatt + + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN name_N)))))) NoVoc +LangEng: I see the name +LangHun: én látom a nevet + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN name_N)))))) NoVoc +LangEng: I see the names +LangHun: én látom a neveket + +-- Man +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) +LangEng: under the man +LangHun: a férfi alatt + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) +LangEng: in the man +LangHun: a férfiban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) +LangEng: on the man +LangHun: a férfinál + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) +# LangEng: of the man +# LangHun: a férfié + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN man_N)) +LangEng: to the man +LangHun: a férfihoz + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfiakban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfiaknál + +# Lang: PrepNP possess_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +# LangHun: a férfiaké + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfiakhoz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN man_N)) +LangHun: a férfiak alatt + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN man_N)))))) NoVoc +LangEng: I see the man +LangHun: én látom a férfit + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN man_N)))))) NoVoc +LangEng: I see the men +LangHun: én látom a férfiakat + + +-- Horse +Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) +LangEng: by the horse +LangHun: a lóval + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) +LangEng: in the horse +LangHun: a lóban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) +LangEng: on the horse +LangHun: a lónál + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) +LangEng: to the horse +LangHun: a lóhoz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN horse_N)) +LangEng: under the horse +LangHun: a ló alatt + +Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) +LangEng: by the horses +LangHun: a lovakkal + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) +LangEng: in the horses +LangHun: a lovakban + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) +LangEng: on the horses +LangHun: a lovaknál + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) +LangEng: to the horses +LangHun: a lovakhoz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN horse_N)) +LangEng: under the horses +LangHun: a lovak alatt + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN horse_N)))))) NoVoc +LangEng: I see the horse +LangHun: én látom a lovat + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN horse_N)))))) NoVoc +LangEng: I see the horses +LangHun: én látom a lovakat + + +-- Stone +Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) +LangHun: a kővel + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) +LangHun: a kőben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) +LangHun: a kőnél + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) +LangHun: a kőhöz + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN stone_N)) +LangHun: a kő alatt + +Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) +LangHun: a kövekkel + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) +LangHun: a kövekben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) +LangHun: a köveknél + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) +LangHun: a kövekhez + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN stone_N)) +LangHun: a kövek alatt + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN stone_N)))))) NoVoc +LangEng: I see the stone +LangHun: én látom a követ + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN stone_N)))))) NoVoc +LangEng: I see the stones +LangHun: én látom a köveket diff --git a/src/hungarian/unittest/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 diff --git a/src/hungarian/unittest/relative.gftest b/src/hungarian/unittest/relative.gftest new file mode 100644 index 000000000..5a2dce4d5 --- /dev/null +++ b/src/hungarian/unittest/relative.gftest @@ -0,0 +1,72 @@ +------------------------------ +-- These need to be correct -- +------------------------------ + +--"ami" instead of "amit" for most examples + +-- LangEng: I see a man that flies +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))))))))) NoVoc +LangHun: én látok egy férfit ami repül + +-- LangEng: I see the man that flies +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))))))))) NoVoc +LangHun: én látom a férfit ami repül + +-- LangEng: I see the man that sees a cat +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))) NoVoc +LangHun: én látom a férfit ami egy macskát lát + +-- LangEng: I see the man that sees the cat +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))))))) NoVoc +LangHun: én látom a férfit ami a macskát látja + +-- LangEng: I see the man that has a cat +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))) NoVoc +LangHun: én látom a férfit aminek egy macskája van + +-- LangEng: I see the man that has the cat +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))))))) NoVoc +LangHun: én látom a férfit aminek megvan a macska +-- vet inte riktigt hur jag ska tänka med "the cat", tyckte det kändes mer rätt med "meg-" konstruktionen + +-- LangEng: I see the cat that flies and that is red +-- Do we need copula in "is red" or is it still fine without? +-- This constructor repeats amit, we have other constructors that don't. I think we don't need it +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseComp (CompAP (PositA red_A))))))))))))) NoVoc +LangHun: én látom a macskát ami repül és piros +--skulle dock byta plats på "piros" och "repül" + +-- LangEng: I see the man that flies and that has a cat +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))))) NoVoc +LangHun: én látom a férfit ami repül és aminek egy macskája van + + +------------------------------------------------------------- +-- 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át + +-- LangEng: I see a man that the cat sees +-- Should this be "amit a macska lát"? Yes +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (SlashV2a see_V2)))))))))) NoVoc +LangHun: én látok egy férfit amit a macska lát + +--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 + +-- 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 diff --git a/src/korean/ConjunctionKor.gf b/src/korean/ConjunctionKor.gf index 42952fd8c..01f407db2 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} ; @@ -115,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/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 } diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index 24832b20a..575db8b5c 100644 Binary files a/src/korean/ParamKor.gf and b/src/korean/ParamKor.gf differ 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 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 + } ; + +}