From 252ecd0bb39d2ed9a676eb2a0b41b72b06daad69 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 20 Apr 2020 10:37:12 +0200 Subject: [PATCH 01/84] (Hun) Fix bug with indef. article and digits --- src/hungarian/NounHun.gf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index b995be70a..2c72f78e9 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -68,7 +68,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { => [] ; -- 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 + sp = \\c => case of { + => [] ; + _ => quant.sp ! num.n ! c } ++ num.s ! Indep ; } ; @@ -97,7 +99,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : Digits -> Card ; NumDigits dig = dig ** { s = \\place => dig.s ! NCard ; - numtype = IsNum ; + numtype = IsDig ; } ; -- : Numeral -> Card ; From 5814f788bcf1ddc2092fda1b39fb831cc8ff184b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 20 Apr 2020 10:38:53 +0200 Subject: [PATCH 02/84] (Hun) Add parameter in Det,Quant whether it agrees in case as attribute --- src/hungarian/NounHun.gf | 9 +++++++-- src/hungarian/ResHun.gf | 23 ++++++++++++++++++----- src/hungarian/StructuralHun.gf | 16 ++++++++++------ 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 2c72f78e9..d69e43d54 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -8,7 +8,10 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : Det -> CN -> NP DetCN det cn = emptyNP ** det ** { - s = \\c => det.s ! Nom ++ cn.s ! det.n ! c ; + s = \\c => case det.caseagr of { + True => det.s ! c ; + False => det.s ! Nom + } ++ cn.s ! det.n ! c ; agr = ; } ; @@ -46,7 +49,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- Determiners can form noun phrases directly. -- : Det -> NP ; - DetNP det = emptyNP ** { + DetNP det = emptyNP ** det ** { s = det.sp ; agr = ; } ; @@ -134,6 +137,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { sp = \\_,_ => pre {"a" ; "az" / v } ; isIndefArt = False ; objdef = Def ; + caseagr = True ; } ; -- : Quant @@ -142,6 +146,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { sp = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; isIndefArt = True ; objdef = Indef ; + caseagr = True ; } ; -- : Pron -> Quant diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 5426e0d24..6e54696b1 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -47,13 +47,17 @@ oper -------------------------------------------------------------------------------- -- Det, Quant, Card, Ord + BaseQuant : Type = { + objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object + caseagr : Bool ; -- If it agrees in case: "azoknak a nőknek" vs. "sok nőknek" + } ; + -- Quant has variable number: -- e.g. this_Quant has both "this" and "these" - Quant : Type = { + Quant : Type = BaseQuant ** { s, -- form that comes before noun: "{this} car" sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP) isIndefArt : Bool ; -- standard trick to prevent "a one car" - objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object } ; mkQuant : (s,sp : Str) -> Quant = \s,sp -> { @@ -61,26 +65,35 @@ oper sp = (mkNoun sp).s ; isIndefArt = False ; objdef = Def ; + caseagr = True ; } ; -- Det is formed in DetQuant : Quant -> Num -> Det -- so it has an inherent number. - Determiner : Type = { + Determiner : Type = BaseQuant ** { s, sp : Case => Str ; n : Number ; numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl - objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object } ; - mkDet : (s : Str) -> ObjDef -> Number -> Determiner = \s,d,n -> { + mkDet : (s : Str) -> ObjDef -> Number -> Bool -> Determiner = \s,d,n,ca -> { s, sp = (mkNoun s).s ! n ; n = n ; numtype = NoNum ; objdef = d ; + caseagr = ca ; } ; + mkDet2 : (n,a : Str) -> ObjDef -> Number -> Bool -> Determiner = \no,ac,d,n,ca -> + let reg : Determiner = mkDet no d n ca + in reg ** { + s,sp = (regNounNomAcc no ac).s ! n ; + } ; + + + Numeral : Type = { s : Place => Str ; -- Independent or attribute numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index d95b845e3..1630121b3 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -61,16 +61,20 @@ lin most_Predet = {s = ""} ; -} --lin every_Det = -lin few_Det = mkDet "kevés" Def Sg ; -- TODO check -lin many_Det = mkDet "sok" Def Sg ; -- TODO check +lin few_Det = mkDet "kevés" Def Sg False ; -- TODO check +lin many_Det = mkDet "sok" Def Sg False ; -- TODO check --lin much_Det = -lin somePl_Det = mkDet "néhány" Indef Sg ; -lin someSg_Det = mkDet "néhány" Indef Sg ; +lin someSg_Det, + somePl_Det = mkDet2 "néhány" "néhányat" Indef Sg False ; --lin no_Quant = -lin that_Quant = mkQuant "az" "az" ; -lin this_Quant = mkQuant "ez" "ez" ; +lin that_Quant = + let az : Quant = mkQuant "az" "az" ; + in az ** {s = \\n,c => az.s ! n ! c ++ pre {"a" ; "az" / v }} ; +lin this_Quant = + let ez : Quant = mkQuant "ez" "ez" ; + in ez ** {s = \\n,c => ez.s ! n ! c ++ pre {"a" ; "az" / v }} ; {-lin which_IQuant = From 23f09e5661247c2dbf7864a9094f0ae4e4412ff8 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 20 Apr 2020 10:39:04 +0200 Subject: [PATCH 03/84] (Hun) New tests --- src/hungarian/unittest/determiners.gftest | 39 +++++++++++++++++++++++ src/hungarian/unittest/relative.gftest | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/hungarian/unittest/determiners.gftest diff --git a/src/hungarian/unittest/determiners.gftest b/src/hungarian/unittest/determiners.gftest new file mode 100644 index 000000000..910a21448 --- /dev/null +++ b/src/hungarian/unittest/determiners.gftest @@ -0,0 +1,39 @@ +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant this_Quant NumSg) (UseN apple_N)))))) NoVoc +LangEng: I see this apple +LangHun: én látom ezt az almát + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant this_Quant NumPl) (UseN apple_N)))))) NoVoc +LangEng: I see these apples +LangHun: én látom ezeket az almákat + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant that_Quant NumPl) (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc +LangEng: I see those red apples +LangHun: én látom azokat a piros almákat + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetNP (DetQuant this_Quant NumSg)))))) NoVoc +LangEng: I see this +LangHun: én látom ezt + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetNP (DetQuant this_Quant NumPl)))))) NoVoc +LangEng: I see these +LangHun: én látom ezeket + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN somePl_Det (UseN apple_N)))))) NoVoc +LangEng: I see some apples +LangHun: én látok néhány almát + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN somePl_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc +LangEng: I see some red apples +LangHun: én látok néhány piros almát + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetNP somePl_Det))))) NoVoc +LangEng: I see some +LangHun: én látok néhányat + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN few_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc +LangEng: I see few red apples +LangHun: én látom kevés piros almát + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN many_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc +LangEng: I see many red apples +LangHun: én látom sok piros almát diff --git a/src/hungarian/unittest/relative.gftest b/src/hungarian/unittest/relative.gftest index 5a2dce4d5..a65477065 100644 --- a/src/hungarian/unittest/relative.gftest +++ b/src/hungarian/unittest/relative.gftest @@ -69,4 +69,4 @@ 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 +LangHun: én pirosabb vagyok a macskáknál amik azoknak a nőknek vannak From 5db5964e831d33ad29f73632ed5abc32bf28bffc Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 20 Apr 2020 14:07:14 +0200 Subject: [PATCH 04/84] (Hun) A couple of new paradigms --- src/hungarian/LexiconHun.gf | 10 ++--- src/hungarian/NounMorphoHun.gf | 69 +++++++++++++++++++++++++++++++--- src/hungarian/ParadigmsHun.gf | 8 +++- 3 files changed, 76 insertions(+), 11 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 80fa8dc9a..d69e454b8 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -41,7 +41,7 @@ lin boat_N = mkN "hajó" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; -lin book_N = mkN "könyv" ; +lin book_N = mkN "könyv" harmE ; lin boy_N = mkN "fiú" ; lin bread_N = mkN "kenyér" ; lin break_V2 = mkV2 "szünet" ; @@ -257,7 +257,7 @@ lin old_A = mkA "öreg" ; --also "idős" lin paper_N = mkN "papír" ; -- lin paris_PN = mkPN "Paris" ; lin peace_N = mkN "béke" ; -lin pen_N = mkN "toll" ; +lin pen_N = mkN "toll" "tollat" ; lin person_N = mkN "ember" ; lin planet_N = mkN "bolygó" ; lin plastic_N = mkN "műanyag" ; @@ -383,7 +383,7 @@ 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 village_N = mkN "falu" "falut" "falvak"; -- lin vomit_V = mkV2 "" ; -------- @@ -407,11 +407,11 @@ 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 woman_N = mkN "nő" "nőt" ; -- lin wonder_VQ = mkVQ "" ; lin wood_N = mkN "fa" ; --same as tree lin worm_N = mkN "féreg" ; --also "kukac" --- lin write_V2 = mkV2 "" ; +lin write_V2 = mkV2 (mkV "írok" "írsz" "ír" "írunk" "írtok" "írnak" "írni") ; lin year_N = mkN "év" ; lin yellow_A = mkA "sárga" ; lin young_A = mkA "fiatal" ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 40acfc2aa..f1a37b9bf 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -61,6 +61,24 @@ oper } ; } ; + -- NB. arguments are Sg Nom, Pl Nom + dFalu : (nomsg : Str) -> (nompl : Str) -> Noun = \falu,falvak -> + let falva = init falvak ; + nFalva = mkNoun falva ; + nFalu = mkNoun falu ; + in {s = \\n,c => case of { + + -- All plural forms and Sg Acc, Sg Sup use the "lova" stem + => nFalva.s ! n ! c ; + -- The rest of the forms are formed with the regular constructor, + -- using "ló" as the stem. + _ => nFalu.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" @@ -83,14 +101,40 @@ oper } ; } ; + -- Generic constructor for cases with different stem in Sg Nom and Sg Gen. + -- Assumes that Sg Gen and all plurals have genitive stem, others Nom stem. + dToll : (nom : Str) -> (acc : Str) -> Noun = \toll,tollat -> + let tolla = init tollat ; + nTolla = mkNoun tolla ; + nToll = mkNoun toll ; + in {s = \\n,c => case of { + -- All plural forms and Sg Acc use the "tolla" stem + | => nTolla.s ! n ! c ; + + -- The rest of the forms are formed with the regular constructor, + -- using "majom" as the stem. + _ => nToll.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, + -- All regNoun* are /smart paradigms/: they take one or a couple of forms, -- and decides which (non-smart) paradigm is the most likely to match. +regNounNomAccPl : (nomsg, accsg, nompl : Str) -> Noun = \nsg,asg,npl -> + case of { + <_ + ("u"|"ú"|"ü"|"ű"), -- falu, falvak ; odú, odvak + _ + ("u"|"ú"|"ü"|"ű") + "t", + _ + "v" + #v + "k"> => dFalu nsg npl ; + + -- Fall back to 2-argument smart paradigm + _ => regNounNomAcc nsg asg + } ; + regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> case of { -- alma, almát @@ -121,7 +165,10 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> |<_ + "é", -- lé, levet _ + "e" + #c + #v + "t"> => dLó n a ; - _ => mkNoun n + <_ + #dupl, -- toll, tollat + _ + #dupl + #v + "t"> => dToll n a ; + + _ => dToll n a -- Generic 2-argument constructor } ; regNoun : Str -> Noun = \sgnom -> case sgnom of { @@ -177,11 +224,22 @@ oper v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; + back : pattern Str = #("a" | "á" | "o" | "ó" | "u" | "ú") ; + + front_rounded : pattern Str = #("ö" | "ő" | "ü" | "ű") ; + + -- front and back rounded + -- rounded : pattern Str = #("ö" | "ő" | "ü" | "ű" | "o" | "ó" | "u" | "ú") + c : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"| "n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"z"| "cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs"| "dzs") ; + dupl : pattern Str = #("bb"|"cc"|"dd"|"ff"|"gg"|"hh"|"jj"|"kk"|"ll"|"mm"| + "nn"|"pp"|"qq"|"rr"|"ss"|"tt"|"vv"|"ww"|"xx"|"zz"| + "ddzs"|"ccs"|"ddz"|"ggy"|"lly"|"nny"|"ssz"|"tty"|"zzs") ; + -- Only single consonants unigraph : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"| "n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"z") ; @@ -194,14 +252,15 @@ oper duplicateLast : Str -> Str = \str -> case str of { x + "dzs" => x + "ddzs" ; - x + "ny" => x + "nny" ; -- takony : takonnyal x + "cs" => x + "ccs" ; x + "dz" => x + "ddz" ; x + "gy" => x + "ggy" ; x + "ly" => x + "lly" ; + x + "ny" => x + "nny" ; x + "sz" => x + "ssz" ; x + "ty" => x + "tty" ; x + "zs" => x + "zzs" ; + x + #dupl => str ; -- Don't duplicate already long consonant -- Base case: just duplicate the single letter x + s@? => x + s + s } ; @@ -237,8 +296,8 @@ oper -- Function to get a harmony from a string getHarm : Str -> Harm = \s -> case s of { - _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; - _ + ("ö" | "ő" | "ü") + _ => H_o ; + _ + #back + _ => H_a ; + _ + #front_rounded + _ => H_o ; _ => H_e } ; diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index da89f54f8..ddf4499d0 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -19,7 +19,8 @@ oper mkN : overload { mkN : (sgnom : Str) -> N ; -- Predictable nouns from singular nominative. Accusative vowel is o for back harmony. No stem lowering (TODO better explanation/examples) - mkN : (sgnom : Str) -> (sggen : Str) -> N ; -- Singular nominative and accusative. Takes care of cases like … TODO example + mkN : (sgnom, sggen : Str) -> N ; -- Singular nominative and accusative. Takes care of cases like … TODO example + mkN : (sgnom, sggen, plnom : Str) -> N ; -- Singular nominative, singular accusative, plural nominative, e.g. `mkN "falu" "falut" "falvak"` mkN : (férfi : Str) -> (harm : Harmony) -> (ak : Str) -> N ; -- Noun with unpredictable vowel harmony and plural allomorph } ; @@ -125,6 +126,9 @@ oper mkN : Str -> Str -> N = \n,a-> lin N (regNounNomAcc n a) ; + mkN : Str -> Str -> Str -> N = + \n,a,pln-> lin N (regNounNomAccPl n a pln) ; + mkN : Str -> Harmony -> N = \s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ; @@ -164,6 +168,8 @@ oper mkV : (sg3 : Str) -> V = \v -> lin V (mkVerb v) ; -- mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** { -- s = \\vf => nore + hada.s ! vf} ; + mkV : (x1,_,_,_,_,_,x7 : Str) -> V = \sg1,sg2,sg3,pl1,pl2,pl3,inf -> + lin V (mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf) ; } ; copula = ResHun.copula ; From a73f3b12d3b29b1e5af268d91dfff8aa42bc7165 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 20 Apr 2020 14:07:50 +0200 Subject: [PATCH 05/84] (Hun) New tests --- src/hungarian/unittest/inflection.gftest | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest index 0ceffde72..dbc22f28a 100644 --- a/src/hungarian/unittest/inflection.gftest +++ b/src/hungarian/unittest/inflection.gftest @@ -2,6 +2,8 @@ -- Noun inflection -- --------------------- +-- TODO: Sg Nom, Sg Acc, Pl Nom, Pl Acc, Sg Sup, Sg Com, possessed forms + -- Beer Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN beer_N)) LangEng: under the beer @@ -362,3 +364,42 @@ 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 + + +-- love_N + +Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) +LangHun: a szerelemmel + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) +LangHun: a szerelemben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) +LangHun: a szerelemnél + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) +LangHun: a szerelemhez + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) +LangHun: a szerelem alatt + +Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) +LangHun: a szerelmekkel + +Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) +LangHun: a szerelmekben + +Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) +LangHun: a szerelmeknél + +Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) +LangHun: a szerelmekhez + +Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) +LangHun: a szerelmek alatt + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN love_N)))))) NoVoc +LangHun: én látom a szerelmet + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN love_N)))))) NoVoc +LangHun: én látom a szerelmeket From 7b03a6dc3b01d987b537c28a93ebdebd9f963c8c Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 21 Apr 2020 10:21:13 +0200 Subject: [PATCH 06/84] (Hun) Add non-empty string to IndefArt.sp Otherwise it's added to any possible tree, massive ambiguity problem. --- src/hungarian/NounHun.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index d69e43d54..8bdb64241 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -142,8 +142,8 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : Quant IndefArt = { - s, - sp = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; + s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; + sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ; isIndefArt = True ; objdef = Indef ; caseagr = True ; From 53bc773db6fa5237dd8cad1a505990ade98a11da Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 21 Apr 2020 10:21:23 +0200 Subject: [PATCH 07/84] (Hun) New prepositions --- src/hungarian/StructuralHun.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 1630121b3..20d11a6ea 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -103,11 +103,11 @@ lin by8agent_Prep = mkPrep "által" ; lin by8means_Prep = casePrep Ins ; -- lin during_Prep = mkPrep ; -- lin except_Prep = mkPrep ; --- lin for_Prep = mkPrep "" ; +lin for_Prep = casePrep Dat ; -- lin from_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ; lin in_Prep = casePrep Ine ; -lin on_Prep = casePrep Ade ; +lin on_Prep = casePrep Sup ; -- lin part_Prep = casePrep ; -- lin possess_Prep = -- Suffix attaches to possessee, not possessor -- lin through_Prep = mkPrep ; From 1dcb4720d11716bac2fff492af9fbc615d2318ea Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 21 Apr 2020 10:44:32 +0200 Subject: [PATCH 08/84] (Hun) Add negation in verbs + change some parameter names --- src/hungarian/ParamHun.gf | 11 +++++++++-- src/hungarian/ResHun.gf | 18 ++++++++++-------- src/hungarian/VerbHun.gf | 10 +++++----- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 35d4e5ad8..44905e0f3 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -1,5 +1,12 @@ resource ParamHun = ParamX ** open Prelude in { +-------------------------------------------------------------------------------- +-- Generic + +oper + if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f -> + case p of {Pos => t ; Neg => f } ; + -------------------------------------------------------------------------------- -- Phonology @@ -88,13 +95,13 @@ param VForm = VInf - | VFin Person Number ; + | VPres Person Number ; oper agr2vf : Person*Number -> VForm = \pn -> case of { - => VFin p n + => VPres p n } ; -------------------------------------------------------------------------------- diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 6e54696b1..7f122f100 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -249,7 +249,7 @@ oper vtov2 : Verb -> Verb2 = \v -> v ** { s = table { - Def => let vDef : Verb = mkVerbReg endingsDef (v.s ! VInf) (v.s ! VFin P3 Sg) + Def => let vDef : Verb = mkVerbReg endingsDef (v.s ! VInf) (v.s ! VPres P3 Sg) in vDef.s ; Indef => v.s } ; c2 = Acc @@ -272,12 +272,12 @@ oper \sg1,sg2,sg3,pl1,pl2,pl3,inf -> { s = table { VInf => inf ; - VFin P1 Sg => sg1 ; - VFin P2 Sg => sg2 ; - VFin P3 Sg => sg3 ; - VFin P1 Pl => pl1 ; - VFin P2 Pl => pl2 ; - VFin P3 Pl => pl3 + VPres P1 Sg => sg1 ; + VPres P2 Sg => sg2 ; + VPres P3 Sg => sg3 ; + VPres P1 Pl => pl1 ; + VPres P2 Pl => pl2 ; + VPres P3 Pl => pl3 } ; sc = SCNom } ; @@ -351,6 +351,7 @@ oper SCNom => Nom ; SCDat => Dat } in np.s ! subjcase + ++ if_then_Pol p [] "nem" ++ vp.s ! agr2vf np.agr ++ vp.obj ++ vp.adv @@ -373,9 +374,10 @@ oper SCNom => Nom ; SCDat => Dat } in rp.s ! n ! subjcase + ++ if_then_Pol p [] "nem" ++ vp.obj ++ vp.adv - ++ vp.s ! VFin rp.agr.p1 n -- variable by number + ++ vp.s ! VPres rp.agr.p1 n -- variable by number } ; relSlash : RP -> ClSlash -> RClause = \rp,cls -> { diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 0202aa980..f89e74431 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -109,8 +109,8 @@ lin -- : AP -> Comp ; CompAP ap = UseCopula ** { s = \\vf => case vf of { - VFin P3 n => ap.s ! n ; - VFin _ n => ap.s ! n ++ copula.s ! vf ; + VPres P3 n => ap.s ! n ; + VPres _ n => ap.s ! n ++ copula.s ! vf ; _ => ap.s ! Sg ++ copula.s ! vf} ++ ap.compar ; } ; @@ -118,15 +118,15 @@ lin -- : 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 ; + VPres P3 n => cn.s ! n ! Nom ; + VPres _ 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 ; + VPres P3 _ => np.s ! Nom ; _ => np.s ! Nom ++ copula.s ! vf } ; } ; From 821b11b4e886c7014c99dab50a0cb3367ee39a26 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 21 Apr 2020 14:44:34 +0200 Subject: [PATCH 09/84] (Hun) Restructure inflectional tests, add more + script to generate --- src/hungarian/unittest/inflection.gftest | 405 ------------------ src/hungarian/unittest/inflection/alma.gftest | 23 + src/hungarian/unittest/inflection/falu.gftest | 25 ++ .../unittest/inflection/férfi.gftest | 23 + src/hungarian/unittest/inflection/fű.gftest | 23 + .../inflection/inflection_placeholder.gfs | 9 + src/hungarian/unittest/inflection/kő.gftest | 26 ++ src/hungarian/unittest/inflection/ló.gftest | 23 + .../unittest/inflection/madár.gftest | 23 + .../unittest/inflection/mkInflection.sh | 5 + src/hungarian/unittest/inflection/név.gftest | 23 + src/hungarian/unittest/inflection/nő.gftest | 23 + .../unittest/inflection/szerelem.gftest | 23 + src/hungarian/unittest/inflection/sör.gftest | 23 + src/hungarian/unittest/inflection/tó.gftest | 23 + src/hungarian/unittest/inflection/víz.gftest | 23 + src/hungarian/unittest/inflection/év.gftest | 23 + 17 files changed, 341 insertions(+), 405 deletions(-) delete mode 100644 src/hungarian/unittest/inflection.gftest create mode 100644 src/hungarian/unittest/inflection/alma.gftest create mode 100644 src/hungarian/unittest/inflection/falu.gftest create mode 100644 src/hungarian/unittest/inflection/férfi.gftest create mode 100644 src/hungarian/unittest/inflection/fű.gftest create mode 100644 src/hungarian/unittest/inflection/inflection_placeholder.gfs create mode 100644 src/hungarian/unittest/inflection/kő.gftest create mode 100644 src/hungarian/unittest/inflection/ló.gftest create mode 100644 src/hungarian/unittest/inflection/madár.gftest create mode 100755 src/hungarian/unittest/inflection/mkInflection.sh create mode 100644 src/hungarian/unittest/inflection/név.gftest create mode 100644 src/hungarian/unittest/inflection/nő.gftest create mode 100644 src/hungarian/unittest/inflection/szerelem.gftest create mode 100644 src/hungarian/unittest/inflection/sör.gftest create mode 100644 src/hungarian/unittest/inflection/tó.gftest create mode 100644 src/hungarian/unittest/inflection/víz.gftest create mode 100644 src/hungarian/unittest/inflection/év.gftest diff --git a/src/hungarian/unittest/inflection.gftest b/src/hungarian/unittest/inflection.gftest deleted file mode 100644 index dbc22f28a..000000000 --- a/src/hungarian/unittest/inflection.gftest +++ /dev/null @@ -1,405 +0,0 @@ ---------------------- --- Noun inflection -- ---------------------- - --- TODO: Sg Nom, Sg Acc, Pl Nom, Pl Acc, Sg Sup, Sg Com, possessed forms - --- 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 - - --- love_N - -Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) -LangHun: a szerelemmel - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) -LangHun: a szerelemben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) -LangHun: a szerelemnél - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) -LangHun: a szerelemhez - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN love_N)) -LangHun: a szerelem alatt - -Lang: PrepNP by8means_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) -LangHun: a szerelmekkel - -Lang: PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) -LangHun: a szerelmekben - -Lang: PrepNP on_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) -LangHun: a szerelmeknél - -Lang: PrepNP to_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) -LangHun: a szerelmekhez - -Lang: PrepNP under_Prep (DetCN (DetQuant DefArt NumPl) (UseN love_N)) -LangHun: a szerelmek alatt - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN love_N)))))) NoVoc -LangHun: én látom a szerelmet - -Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN love_N)))))) NoVoc -LangHun: én látom a szerelmeket diff --git a/src/hungarian/unittest/inflection/alma.gftest b/src/hungarian/unittest/inflection/alma.gftest new file mode 100644 index 000000000..a8600c754 --- /dev/null +++ b/src/hungarian/unittest/inflection/alma.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN apple_N) +LangHun: alma + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN apple_N))) +LangHun: én látok egy almát + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN apple_N)) +LangHun: egy almán + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN apple_N) +LangHun: almák + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN apple_N))) +LangHun: én látok almákat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN apple_N)) +LangHun: egy almához + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN apple_N)) +LangHun: almákhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN apple_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/falu.gftest b/src/hungarian/unittest/inflection/falu.gftest new file mode 100644 index 000000000..d992ac5b9 --- /dev/null +++ b/src/hungarian/unittest/inflection/falu.gftest @@ -0,0 +1,25 @@ +--This constructor also takes care of szó or case ("szót" not "szavat") + +Lang: MassNP (UseN village_N) +LangHun: falu + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN village_N))) +LangHun: én látok egy falut + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN village_N)) +LangHun: egy falun + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN village_N) +LangHun: falvak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN village_N))) +LangHun: én látok falvakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN village_N)) +LangHun: egy faluhoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN village_N)) +LangHun: falvakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN village_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/férfi.gftest b/src/hungarian/unittest/inflection/férfi.gftest new file mode 100644 index 000000000..47de6fb33 --- /dev/null +++ b/src/hungarian/unittest/inflection/férfi.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN man_N) +LangHun: férfi + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN man_N))) +LangHun: én látok egy férfit + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN man_N)) +LangHun: egy férfin + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN man_N) +LangHun: férfiak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN man_N))) +LangHun: én látok férfiakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN man_N)) +LangHun: egy férfihoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN man_N)) +LangHun: férfiakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN man_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/fű.gftest b/src/hungarian/unittest/inflection/fű.gftest new file mode 100644 index 000000000..1b1ec932e --- /dev/null +++ b/src/hungarian/unittest/inflection/fű.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN grass_N) +LangHun: fű + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN grass_N))) +LangHun: én látok egy füvet + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN grass_N)) +LangHun: egy füvön + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN grass_N) +LangHun: füvek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN grass_N))) +LangHun: én látok füveket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN grass_N)) +LangHun: egy fűhöz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN grass_N)) +LangHun: füvekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN grass_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/inflection_placeholder.gfs b/src/hungarian/unittest/inflection/inflection_placeholder.gfs new file mode 100644 index 000000000..a40ddfc6e --- /dev/null +++ b/src/hungarian/unittest/inflection/inflection_placeholder.gfs @@ -0,0 +1,9 @@ +i ../../LangHun.gf +l -treebank MassNP (UseN PLACEHOLDER) +l -treebank PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN PLACEHOLDER))) +l -treebank PrepNP on_Prep (MassNP (UseN PLACEHOLDER)) +l -treebank DetCN (DetQuant IndefArt NumPl) (UseN PLACEHOLDER) +l -treebank PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN PLACEHOLDER))) +l -treebank PrepNP to_Prep (MassNP (UseN PLACEHOLDER)) +l -treebank PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN PLACEHOLDER)) +l -treebank DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN PLACEHOLDER) diff --git a/src/hungarian/unittest/inflection/kő.gftest b/src/hungarian/unittest/inflection/kő.gftest new file mode 100644 index 000000000..c9d681a67 --- /dev/null +++ b/src/hungarian/unittest/inflection/kő.gftest @@ -0,0 +1,26 @@ +-- Julia's comments: +-- dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting + +Lang: MassNP (UseN stone_N) +LangHun: kő + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN stone_N))) +LangHun: én látok egy követ + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN stone_N)) +LangHun: egy kövön + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN stone_N) +LangHun: kövek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN stone_N))) +LangHun: én látok köveket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN stone_N)) +LangHun: egy kőhöz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN stone_N)) +LangHun: kövekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN stone_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/ló.gftest b/src/hungarian/unittest/inflection/ló.gftest new file mode 100644 index 000000000..0827fc0aa --- /dev/null +++ b/src/hungarian/unittest/inflection/ló.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN horse_N) +LangHun: ló + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN horse_N))) +LangHun: én látok egy lovat + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN horse_N)) +LangHun: egy lovon + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN horse_N) +LangHun: lovak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN horse_N))) +LangHun: én látok lovakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN horse_N)) +LangHun: egy lóhoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN horse_N)) +LangHun: lovakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN horse_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/madár.gftest b/src/hungarian/unittest/inflection/madár.gftest new file mode 100644 index 000000000..2eea2d3bb --- /dev/null +++ b/src/hungarian/unittest/inflection/madár.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN bird_N) +LangHun: madár + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN bird_N))) +LangHun: én látok egy madarat + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN bird_N)) +LangHun: egy madáron + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN bird_N) +LangHun: madarak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN bird_N))) +LangHun: én látok madarakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN bird_N)) +LangHun: egy madárhoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN bird_N)) +LangHun: madarakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN bird_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/mkInflection.sh b/src/hungarian/unittest/inflection/mkInflection.sh new file mode 100755 index 000000000..0968f89e3 --- /dev/null +++ b/src/hungarian/unittest/inflection/mkInflection.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +sed "s/PLACEHOLDER/$1_N/g" < inflection_placeholder.gfs > inflection_concrete.gfs +gf --run < inflection_concrete.gfs > $2-new.gftest # don't override the existing ones +rm inflection_concrete.gfs diff --git a/src/hungarian/unittest/inflection/név.gftest b/src/hungarian/unittest/inflection/név.gftest new file mode 100644 index 000000000..ddd71a6a5 --- /dev/null +++ b/src/hungarian/unittest/inflection/név.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN name_N) +LangHun: név + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN name_N))) +LangHun: én látok egy nevet + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN name_N)) +LangHun: egy néven + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN name_N) +LangHun: nevek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN name_N))) +LangHun: én látok neveket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN name_N)) +LangHun: egy névhez + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN name_N)) +LangHun: nevekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN name_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/nő.gftest b/src/hungarian/unittest/inflection/nő.gftest new file mode 100644 index 000000000..e38b23152 --- /dev/null +++ b/src/hungarian/unittest/inflection/nő.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN woman_N) +LangHun: nő + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN woman_N))) +LangHun: én látok egy nőt + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN woman_N)) +LangHun: egy nőn + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN woman_N) +LangHun: nők + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN woman_N))) +LangHun: én látok nőket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN woman_N)) +LangHun: egy nőhöz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN woman_N)) +LangHun: nőkhöz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN woman_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/szerelem.gftest b/src/hungarian/unittest/inflection/szerelem.gftest new file mode 100644 index 000000000..5a9c4dd8e --- /dev/null +++ b/src/hungarian/unittest/inflection/szerelem.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN love_N) +LangHun: szerelem + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN love_N))) +LangHun: én látok egy szerelmet + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN love_N)) +LangHun: egy szerelmen + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN love_N) +LangHun: szerelmek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN love_N))) +LangHun: én látok szerelmeket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN love_N)) +LangHun: egy szerelemhez + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN love_N)) +LangHun: szerelmekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN love_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/sör.gftest b/src/hungarian/unittest/inflection/sör.gftest new file mode 100644 index 000000000..bfe61563b --- /dev/null +++ b/src/hungarian/unittest/inflection/sör.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN beer_N) +LangHun: sör + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN beer_N))) +LangHun: én látok egy sört + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN beer_N)) +LangHun: egy sörön + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN beer_N) +LangHun: sörök + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN beer_N))) +LangHun: én látok söröket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN beer_N)) +LangHun: egy sörhöz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN beer_N)) +LangHun: sörökhöz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN beer_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/tó.gftest b/src/hungarian/unittest/inflection/tó.gftest new file mode 100644 index 000000000..f75158520 --- /dev/null +++ b/src/hungarian/unittest/inflection/tó.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN lake_N) +LangHun: tó + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN lake_N))) +LangHun: én látok egy tovat + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN lake_N)) +LangHun: egy tovon + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN lake_N) +LangHun: tovak + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN lake_N))) +LangHun: én látok tovakat + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN lake_N)) +LangHun: egy tóhoz + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN lake_N)) +LangHun: tovakhoz + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN lake_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/víz.gftest b/src/hungarian/unittest/inflection/víz.gftest new file mode 100644 index 000000000..dd39c4896 --- /dev/null +++ b/src/hungarian/unittest/inflection/víz.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN water_N) +LangHun: víz + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN water_N))) +LangHun: én látok egy vízt + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN water_N)) +LangHun: egy vízen + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN water_N) +LangHun: vízek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN water_N))) +LangHun: én látok vízeket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN water_N)) +LangHun: egy vízhez + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN water_N)) +LangHun: vízekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN water_N) +LangHun: TODO diff --git a/src/hungarian/unittest/inflection/év.gftest b/src/hungarian/unittest/inflection/év.gftest new file mode 100644 index 000000000..34205bf75 --- /dev/null +++ b/src/hungarian/unittest/inflection/év.gftest @@ -0,0 +1,23 @@ +Lang: MassNP (UseN year_N) +LangHun: év + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN year_N))) +LangHun: én látok egy évet + +Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN year_N)) +LangHun: egy éven + +Lang: DetCN (DetQuant IndefArt NumPl) (UseN year_N) +LangHun: évek + +Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN year_N))) +LangHun: én látok éveket + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN year_N)) +LangHun: egy évhez + +Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN year_N)) +LangHun: évekhez + +Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN year_N) +LangHun: TODO From 9a4789283587c583a8b580733f81cab3aa3bffa4 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 21 Apr 2020 14:45:18 +0200 Subject: [PATCH 10/84] (Hun) Clean up noun morphology --- src/hungarian/LexiconHun.gf | 1 - src/hungarian/NounMorphoHun.gf | 70 ++++++++++++---------------------- 2 files changed, 25 insertions(+), 46 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index d69e454b8..a0562652d 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -406,7 +406,6 @@ 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őt" ; -- lin wonder_VQ = mkVQ "" ; lin wood_N = mkN "fa" ; --same as tree diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index f1a37b9bf..ad3f2fe4f 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -22,23 +22,6 @@ oper } ; } ; - -- 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 @@ -102,7 +85,8 @@ oper } ; -- Generic constructor for cases with different stem in Sg Nom and Sg Gen. - -- Assumes that Sg Gen and all plurals have genitive stem, others Nom stem. + -- Assumes that Sg Gen and all plurals have genitive stem, others Sg Nom stem. + -- Handles also words like "madár, nyár, név, bogár" with shortened stem vowel in plural. dToll : (nom : Str) -> (acc : Str) -> Noun = \toll,tollat -> let tolla = init tollat ; nTolla = mkNoun tolla ; @@ -112,14 +96,13 @@ oper | => nTolla.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, - -- using "majom" as the stem. + -- using "toll" as the stem. _ => nToll.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} @@ -127,8 +110,8 @@ oper -- and decides which (non-smart) paradigm is the most likely to match. regNounNomAccPl : (nomsg, accsg, nompl : Str) -> Noun = \nsg,asg,npl -> case of { - <_ + ("u"|"ú"|"ü"|"ű"), -- falu, falvak ; odú, odvak - _ + ("u"|"ú"|"ü"|"ű") + "t", + <_ + ("u"|"ú"|"ü"|"ű"|"ó"), -- falu, falut, falvak ; szó, szót, szavak + _ + ("u"|"ú"|"ü"|"ű"|"ó") + "t", _ + "v" + #v + "k"> => dFalu nsg npl ; -- Fall back to 2-argument smart paradigm @@ -137,25 +120,21 @@ regNounNomAccPl : (nomsg, accsg, nompl : Str) -> Noun = \nsg,asg,npl -> regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> case of { + + -- Stem 1: Sg Nom + -- Stem 2: Everything else -- alma, almát <_ + "a", _ + "át"> |<_ + "e" ,_ + "ét"> => dAlma n a ; + -- Stem 1: Sg Nom + -- Stem 2: Sg Gen, Sg Sup, Pl * + <_ + #shortv + #c, -- majom, majmot + _ + #c + #shortv + "t"> => dMajom n a ; - <_ + "á" + #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 ; - - + -- Stem 1: Sg Nom + -- Stem 2: Sg Sup + -- Stem 3: Sg Gen, Pl * <_ + "ó", -- ló, lovat _ + "o" + #c + #v + "t"> @@ -165,16 +144,18 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> |<_ + "é", -- lé, levet _ + "e" + #c + #v + "t"> => dLó n a ; - <_ + #dupl, -- toll, tollat - _ + #dupl + #v + "t"> => dToll n a ; - + -- Stem 1: Sg Nom, Sg * - [Gen] + -- Stem 2: Sg Gen, Pl * _ => dToll n a -- Generic 2-argument constructor } ; + -- 1-argument smart paradigm + -- Here we guess the genitive form and give it to appropriate 2-arg paradigm regNoun : Str -> Noun = \sgnom -> case sgnom of { _ + ("a"|"e") => dAlma sgnom (lengthen sgnom + "t") ; - #c + ("á"|"é") + #c => mkNoun sgnom ; - _ + ("á"|"é") + #c => dMadár sgnom (név2nevet sgnom) ; + ("nyár"|"név") => dToll sgnom (név2nevet sgnom) ; + (#c|"")+("á"|"é")+ #c => mkNoun sgnom ; + _ + ("á"|"é") + #c => dToll sgnom (név2nevet sgnom) ; _ + ("ó"|"é"|"ő"|"ű") => dLó sgnom (ló2lovat sgnom) ; _ + #v + #c + #v + #c => dMajom sgnom (majom2majmo sgnom); _ => mkNoun sgnom -- Fall back to the regular paradigm @@ -205,12 +186,10 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> } ; --TODO: Special cases (enter these words manually to not complicate the paradigms): ---dTó: szó special case which fulfills the plural cases but not the or case ("szót" not "szavat") --dLó: special case "lén" not "leven" ---dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting + --endCaseConsAcc: "falat, fület, várat, könnyet", --also special in superessive case "falon, fülek, vizen" ---pattern matching in regNoun: one-syllable words that in fact belong to dMadár: "nyár, név" -------------------------------------------------------------------------------- -- Following code by EG in 2009 (?), comments and some additions by IL 2020 @@ -223,6 +202,7 @@ oper -- Vowels as a pattern. v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; + shortv : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü") ; back : pattern Str = #("a" | "á" | "o" | "ó" | "u" | "ú") ; @@ -297,7 +277,7 @@ oper -- Function to get a harmony from a string getHarm : Str -> Harm = \s -> case s of { _ + #back + _ => H_a ; - _ + #front_rounded + _ => H_o ; + _ + #front_rounded + (#c|"") + (#c|"") => H_o ; _ => H_e } ; From 2049d0379b47c0f65d04563d3c7aca65cdb21674 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Tue, 21 Apr 2020 20:17:07 +0200 Subject: [PATCH 11/84] test cases --- src/hungarian/unittest/determiners.gftest | 4 ++-- src/hungarian/unittest/inflection/tó.gftest | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hungarian/unittest/determiners.gftest b/src/hungarian/unittest/determiners.gftest index 910a21448..8bb2c331f 100644 --- a/src/hungarian/unittest/determiners.gftest +++ b/src/hungarian/unittest/determiners.gftest @@ -32,8 +32,8 @@ LangHun: én látok néhányat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN few_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc LangEng: I see few red apples -LangHun: én látom kevés piros almát +LangHun: én látok kevés piros almát Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN many_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc LangEng: I see many red apples -LangHun: én látom sok piros almát +LangHun: én látok sok piros almát diff --git a/src/hungarian/unittest/inflection/tó.gftest b/src/hungarian/unittest/inflection/tó.gftest index f75158520..9ac095071 100644 --- a/src/hungarian/unittest/inflection/tó.gftest +++ b/src/hungarian/unittest/inflection/tó.gftest @@ -2,22 +2,22 @@ Lang: MassNP (UseN lake_N) LangHun: tó Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN lake_N))) -LangHun: én látok egy tovat +LangHun: én látok egy tavat Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN lake_N)) -LangHun: egy tovon +LangHun: egy tavon Lang: DetCN (DetQuant IndefArt NumPl) (UseN lake_N) -LangHun: tovak +LangHun: tavak Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (UseN lake_N))) -LangHun: én látok tovakat +LangHun: én látok tavakat Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumSg) (UseN lake_N)) LangHun: egy tóhoz Lang: PrepNP to_Prep (DetCN (DetQuant IndefArt NumPl) (UseN lake_N)) -LangHun: tovakhoz +LangHun: tavakhoz Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN lake_N) LangHun: TODO From 53516a689fba20ac0617909002b5cfc5a74412a8 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Tue, 21 Apr 2020 20:51:41 +0200 Subject: [PATCH 12/84] =?UTF-8?q?dL=C3=B3=20cases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/NounMorphoHun.gf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index ad3f2fe4f..5b57c0b78 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -45,6 +45,7 @@ oper } ; -- NB. arguments are Sg Nom, Pl Nom + -- handles words like: falu, daru, tetű -> falvak, darvak, tetvek dFalu : (nomsg : Str) -> (nompl : Str) -> Noun = \falu,falvak -> let falva = init falvak ; nFalva = mkNoun falva ; @@ -138,9 +139,15 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> <_ + "ó", -- ló, lovat _ + "o" + #c + #v + "t"> + |<_ + "ó", -- tó, tavat + _ + "a" + #c + #v + "t"> + |<_ + "ő", -- kő, követ _ + "ö" + #c + #v + "t"> + |<_ + "ű", -- fű, füvet + _ + "ü" + #c + #v + "t"> + |<_ + "é", -- lé, levet _ + "e" + #c + #v + "t"> => dLó n a ; From 9c980f5fdf5f0f4ff45b179505d1943ac9a69e3f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 21 Apr 2020 20:51:48 +0200 Subject: [PATCH 13/84] (Hun) Use 2-argument smart paradigm in LexiconHun --- src/hungarian/LexiconHun.gf | 174 ++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index a0562652d..3c6b86e4a 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -8,11 +8,11 @@ concrete LexiconHun of Lexicon = CatHun ** lin airplane_N = mkN "repülőgép" "repülőgépet" ; -- lin alas_Interj = mkInterj "" ; -- lin already_Adv = mkA "" ; -lin animal_N = mkN "állat" ; +lin animal_N = mkN "állat" "állatot" ; -- lin answer_V2S = mkV2S "válasz" ; -lin apartment_N = mkN "lakás" ; +lin apartment_N = mkN "lakás" "lakást" ; lin apple_N = mkN "alma" ; -lin art_N = mkN "müvészet" ; +lin art_N = mkN "művészet" "művészetet" ; -- lin ashes_N = mkN "" ; -- lin ask_V2Q = mkV2 "" ; @@ -22,13 +22,13 @@ lin art_N = mkN "müvészet" ; lin baby_N = mkN "bébi" ; -- lin back_N = mkN "" ; lin bad_A = mkA "rossz" ; -lin bank_N = mkN "bank" ; +lin bank_N = mkN "bank" "bankot" ; -- lin bark_N = mkN "" ; lin beautiful_A = mkA "szép" ; -- lin become_VA = mkVA "" ; lin beer_N = mkN "sör" "sört" ; -- lin beg_V2V = mkV2 "" ; -lin belly_N = mkN "has" ; +lin belly_N = mkN "has" "hasat" ; lin big_A = mkA "nagy" ; lin bike_N = mkN "bicikli" ; lin bird_N = mkN "madár" ; @@ -41,17 +41,17 @@ lin boat_N = mkN "hajó" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; -lin book_N = mkN "könyv" harmE ; +lin book_N = mkN "könyv" harmE ; -- TODO Sg Sup könyvön, Sg All könyvhöz, all others in HarmE lin boy_N = mkN "fiú" ; lin bread_N = mkN "kenyér" ; lin break_V2 = mkV2 "szünet" ; -lin breast_N = mkN "mell" ; +lin breast_N = mkN "mell" "mellet" ; -- lin breathe_V = mkV "" ; -- lin broad_A = mkA "" ; -- lin brother_N2 = mkN "öccsém" ; (possessive form?) lin brown_A = mkA "barna" ; -- lin burn_V = mkV "" ; -lin butter_N = mkN "vaj" ; +lin butter_N = mkN "vaj" "vajat" ; -- lin buy_V2 = mkV2 "" ; ---- @@ -59,26 +59,26 @@ lin butter_N = mkN "vaj" ; 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 car_N = mkN "autó" "autót" ; +lin carpet_N = mkN "szőnyeg" "szőnyeget" ; lin cat_N = mkN "macska" ; -lin ceiling_N = mkN "plafon" ; +lin ceiling_N = roof_N ; 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 cheese_N = mkN "sajt" "sajtot" ; +lin child_N = mkN "gyerek" "gyereket" ; +lin church_N = mkN "templom" "templomot" ; +lin city_N = mkN "város" "várost" ; lin clean_A = mkA "tiszta" ; lin clever_A = mkA "okos" ; lin close_V2 = mkV2 "közel" ; -lin cloud_N = mkN "felhö" ; -lin coat_N = mkN "kabát" ; +lin cloud_N = mkN "felhő" "felhőt" ; +lin coat_N = mkN "kabát" "kabátot" ; lin cold_A = mkA "hideg" ; -- lin come_V = mkV "" ; -lin computer_N = mkN "számítógép" ; +lin computer_N = mkN "számítógép" "számítógépet" ; lin correct_A = mkA "igaz" ; -- lin count_V2 = mkV2 "" ; -lin country_N = mkN "ország" ; +lin country_N = mkN "ország" "országot" ; lin cousin_N = mkN "unokatestvér" ; --short "unoka" lin cow_N = mkN "tehén" ; -- lin cut_V2 = mkV2 "" ; @@ -86,7 +86,7 @@ lin cow_N = mkN "tehén" ; -- ---- -- -- D -- -lin day_N = mkN "nap" ; +lin day_N = mkN "nap" "napot" ; -- lin die_V = mkV "" ; -- lin dig_V = mkV "" ; -- lin dirty_A = mkA "" ; @@ -94,7 +94,7 @@ lin day_N = mkN "nap" ; -- lin do_V2 = mkV2 do_V ; lin doctor_N = mkN "orvos" ; lin dog_N = mkN "kutya" ; -lin door_N = mkN "ajtó" ; +lin door_N = mkN "ajtó" "ajtót" ; -- lin drink_V2 = mkV2 "" ; -- lin dry_A = mkA "" ; -- lin dull_A = mkA "" ; @@ -106,15 +106,15 @@ lin door_N = mkN "ajtó" ; lin ear_N = mkN "fül" ; lin earth_N = mkN "föld" ; -- lin eat_V2 = mkV2 "" ; -lin egg_N = mkN "tojás" ; +lin egg_N = mkN "tojás" "tojást" ; lin empty_A = mkA "üres" ; -lin enemy_N = mkN "ellenség" ; +lin enemy_N = mkN "ellenség" "ellenséget" ; lin eye_N = mkN "szem" ; ---- -- F -lin factory_N = mkN "gyár" ; +lin factory_N = mkN "gyár" "gyárat" ; -- lin fall_V = mkV "" ; -- lin far_Adv = mkA "" ; lin fat_N = mkN "kövér" ; @@ -125,20 +125,20 @@ 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 fire_N = mkN "tűz" "tüzet" ; +lin fish_N = mkN "hal" "halat" ; -- lin float_V = mkV "" ; -lin floor_N = mkN "padló" ; +lin floor_N = mkN "padló" "padlót" ; -- lin flow_V = mkV "" ; -lin flower_N = mkN "vírág" ; +lin flower_N = mkN "virág" "virágot" ; lin fly_V = mkV "repül" ; -lin fog_N = mkN "köd" ; +lin fog_N = mkN "köd" ; -- TODO ködöket lin foot_N = mkN "láb" ; --same as leg, to specify "lábfej" -lin forest_N = mkN "erdő" ; +lin forest_N = mkN "erdő" "erdőt" ; -- lin forget_V2 = mkV2 "" ; -- lin freeze_V = mkV "" ; -lin fridge_N = mkN "hűtő" ; -lin friend_N = mkN "barát" ; +lin fridge_N = mkN "hűtő" "hűtőt" ; +lin friend_N = mkN "barát" "barátot" ; lin fruit_N = mkN "gyümölcs" ; lin full_A = mkA "tele" ; -- --lin fun_AV @@ -149,9 +149,9 @@ lin full_A = mkA "tele" ; lin garden_N = mkN "kert" ; lin girl_N = mkN "lány" ; -- lin give_V3 = mkV3 "" ; -lin glove_N = mkN "kesztyű" ; +lin glove_N = mkN "kesztyű" "kesztyűt" ; -- lin go_V = mkV "" ; -lin gold_N = mkN "arany" ; +lin gold_N = mkN "arany" "aranyat" ; lin good_A = mkA "jó" ; lin grammar_N = mkN "nyelvtan" ; lin grass_N = mkN "fű" ; @@ -160,10 +160,10 @@ lin green_A = mkA "zöld" ; ---- -- H -lin hair_N = mkN "haj" ; -lin hand_N = mkN "kéz" ; +lin hair_N = mkN "haj" "hajat" ; +lin hand_N = mkN "kéz" "kezet" ; -- lin harbour_N = mkN "" ; -lin hat_N = mkN "kalap" ; +lin hat_N = mkN "kalap" "kalapot" ; -- lin hate_V2 = mkV2 "" ; lin head_N = mkN "fej" ; -- lin hear_V2 = mkV2 "" ; @@ -176,20 +176,20 @@ lin heavy_A = mkA "nehéz" ; -- lin horn_N = mkN "" ; lin horse_N = mkN "ló" ; lin hot_A = mkA "forró" ; -lin house_N = mkN "ház" ; +lin house_N = mkN "ház" "házat" ; -- lin hunt_V2 = mkV2 "" ; lin husband_N = mkN "férj" ; -------- -- I - K -lin ice_N = mkN "jég" ; -lin industry_N = mkN "ipar" ; -lin iron_N = mkN "vas" ; +lin ice_N = mkN "jég" "jeget" ; +lin industry_N = mkN "ipar" "ipart" ; +lin iron_N = mkN "vas" "vasat" ; -- lin john_PN = mkPN "" ; -- lin jump_V = mkV "" ; -- lin kill_V2 = mkV2 "" ; -lin king_N = mkN "király" ; +lin king_N = mkN "király" "királyt" ; lin knee_N = mkN "térd" ; -- lin know_V2 = mkV2 "" ; -- lin know_VQ = mkVQ "" ; @@ -199,7 +199,7 @@ lin knee_N = mkN "térd" ; ---- -- L -lin lake_N = mkN "tó" ; +lin lake_N = mkN "tó" "tavat" ; lin lamp_N = mkN "lámpa" ; lin language_N = mkN "nyelv" ; -- lin laugh_V = mkV "" ; @@ -225,11 +225,11 @@ lin love_N = mkN "szerelem" ; lin man_N = mkN "férfi" "ak" harmA ; -- force plural allomorph and a-harmony lin married_A2 = mkA2 "házas" Ins ; lin meat_N = mkN "hús" ; -lin milk_N = mkN "tej" ; -lin moon_N = mkN "hold" ; +lin milk_N = mkN "tej" "tejet" ; +lin moon_N = mkN "hold" "holdat" ; lin mother_N2 = mkN2 "anya" ; lin mountain_N = mkN "hegy" ; -lin mouth_N = mkN "száj" ; +lin mouth_N = mkN "száj" "szájat" ; lin music_N = mkN "zene" ; ---- @@ -240,17 +240,17 @@ 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 newspaper_N = mkN "újság" "újságot" ; +lin night_N = mkN "éjszaka" ; --also shortened to "éj" ("este" more for evening) +lin nose_N = mkN "orr" "orrot" ; lin now_Adv = mkAdv "most" ; -lin number_N = mkN "szám" ; +lin number_N = mkN "szám" "számot" ; -- -- -------- -- -- O - P -- -- -lin oil_N = mkN "olaj" ; +lin oil_N = mkN "olaj" "olajat" ; -- TODO olajok or olajak? lin old_A = mkA "öreg" ; --also "idős" -- lin open_V2 = mkV2 "" ; -- lin paint_V2A = mkV2A "" ; @@ -259,11 +259,11 @@ lin paper_N = mkN "papír" ; lin peace_N = mkN "béke" ; lin pen_N = mkN "toll" "tollat" ; lin person_N = mkN "ember" ; -lin planet_N = mkN "bolygó" ; -lin plastic_N = mkN "műanyag" ; +lin planet_N = mkN "bolygó" "bolygót" ; +lin plastic_N = mkN "műanyag" "műanyagot" ; -- lin play_V = mkV "" ; lin policeman_N = mkN "rendőr" ; --the police "rendőrség" -lin priest_N = mkN "pap" ; +lin priest_N = mkN "pap" "papot" ; -- lin pull_V2 = mkV2 "" ; -- lin push_V2 = mkV2 "" ; -- lin put_V2 = mkV2 "" ; @@ -271,42 +271,42 @@ lin priest_N = mkN "pap" ; -- -------- -- -- Q - R -- -lin queen_N = mkN "kírálynő" ; -lin question_N = mkN "kérdés" ; -lin radio_N = mkN "rádió" ; -lin rain_N = mkN "eső" ; +lin queen_N = mkN "kírálynő" "kírálynőt" ; +lin question_N = mkN "kérdés" "kérdést" ; +lin radio_N = mkN "rádió" "rádiót" ; +lin rain_N = mkN "eső" "esőt" ; -- lin rain_V0 = mkV "" ; -- lin read_V2 = mkV2 "" ; lin ready_A = mkA "kész" ; -lin reason_N = mkN "ok" ; +lin reason_N = mkN "ok" "okot" ; lin red_A = mkA "piros" ; lin religion_N = mkN "vallás" ; lin restaurant_N = mkN "étterem" ; -lin river_N = mkN "folyó" ; -lin road_N = mkN "út" ; +lin river_N = mkN "folyó" "folyót" ; +lin road_N = mkN "út" "utat" ; lin rock_N = mkN "szikla" ; -lin roof_N = mkN "plafon" ; +lin roof_N = mkN "plafon" "plafont" ; 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 rule_N = mkN "szabály" "szabályt" ; -- lin run_V = mkV "" ; ---- -- S -lin salt_N = mkN "só" ; -lin sand_N = mkN "homok" ; +lin salt_N = mkN "só" "sót" ; +lin sand_N = mkN "homok" "homokot" ; -- lin say_VS = mkVS "" ; lin school_N = mkN "iskola" ; -lin science_N = mkN "tudomány" ; +lin science_N = mkN "tudomány" "tudományt" ; -- lin scratch_V2 = mkV2 "" ; lin sea_N = mkN "tenger" ; lin see_V2 = mkV2 "lát" ; -lin seed_N = mkN "mag" ; +lin seed_N = mkN "mag" "magot" ; -- lin seek_V2 = mkV2 "" ; -- lin sell_V3 = mkV3 "" ; -- lin send_V3 = mkV3 "" ; @@ -315,38 +315,38 @@ lin seed_N = mkN "mag" ; -- 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 shoe_N = mkN "cipő" "cipőt" ; 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 silver_N = mkN "ezüst" ; -- TODO fix: ezüstöket -- lin sing_V = mkV "" ; -- lin sister_N = mkN "" ; -- lin sit_V = mkV "" ; lin skin_N = mkN "bőr" ; -lin sky_N = mkN "ég" ; +lin sky_N = mkN "ég" "eget" ; -- 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 snake_N = mkN "kígyó" "kígyót" ; +lin snow_N = mkN "hó" "havat" ; lin sock_N = mkN "zokni" ; -lin song_N = mkN "dal" ; +lin song_N = mkN "dal" ; -- TODO fix: dalokat -- lin speak_V2 = mkV2 "" ; -- lin spit_V = mkV "" ; -- lin split_V2 = mkV2 "" ; -- lin squeeze_V2 = mkV2 "" ; -- lin stab_V2 = mkV2 "" ; -- lin stand_V = mkV "" ; -lin star_N = mkN "csillag" ; -lin steel_N = mkN "acél" ; -lin stick_N = mkN "rúd" ; -lin stone_N = mkN "kő"; +lin star_N = mkN "csillag" "csillagot" ; +lin steel_N = mkN "acél" "ok" harmA ; +lin stick_N = mkN "rúd" "rudat" ; +lin stone_N = mkN "kő" "követ" ; -- lin stop_V = mkV "" ; -- lin stove_N = mkN "" ; lin straight_A = mkA "egyenes" ; -lin student_N = mkN "diák" ; +lin student_N = mkN "diák" "diákot" ; lin stupid_A = mkA "buta" ; --also "hülye" -- lin suck_V2 = mkV2 "" ; lin sun_N = mkN "nap" ; --same as day @@ -361,8 +361,8 @@ 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 teacher_N = mkN "tanár" "tanárt" ; +lin television_N = mkN "tévé" "tévét" ; --also "televízió" but not used lin thick_A = mkA "vastag" ; lin thin_A = mkA "vekony" ; -- lin think_V = mkV "" ; @@ -370,8 +370,8 @@ lin thin_A = mkA "vekony" ; -- 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 tooth_N = mkN "fog" "fogat" ; +lin train_N = mkN "vonat" "vonatot" ; -- lin travel_V = mkV "" ; lin tree_N = mkN "fa" ; -- lin turn_V = mkV "" ; @@ -391,18 +391,18 @@ lin village_N = mkN "falu" "falut" "falvak"; -- lin wait_V2 = mkV2 "" ; -- lin walk_V = mkV "" ; -lin war_N = mkN "háború" ; +lin war_N = mkN "háború" "háborút" ; lin warm_A = mkA "meleg" ; -- lin wash_V2 = mkV2 "" ; -- lin watch_V2 = mkV2 "" ; -lin water_N = mkN "víz" ; +lin water_N = mkN "víz" "vizet" ; lin wet_A = mkA "nedves" ; lin white_A = mkA "fehér" ; lin wide_A = mkA "széles" ; -lin wife_N = mkN "feleség" ; +lin wife_N = mkN "feleség" "feleséget" ; -- lin win_V2 = mkV2 "" ; -lin wind_N = mkN "szél" ; -lin window_N = mkN "ablak" ; +lin wind_N = mkN "szél" "szelet" ; +lin window_N = mkN "ablak" "ablakot" ; lin wine_N = mkN "bor" ; lin wing_N = mkN "szárny" ; -- lin wipe_V2 = mkV2 "" ; From 307866166588b1c0c1d00c5335310cabdf785921 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Tue, 21 Apr 2020 21:12:36 +0200 Subject: [PATCH 14/84] Added acc cases for nouns --- src/hungarian/LexiconHun.gf | 152 ++++++++++++++++++------------------ 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 3c6b86e4a..d445b1dcd 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -19,7 +19,7 @@ lin art_N = mkN "művészet" "művészetet" ; ---- -- B -lin baby_N = mkN "bébi" ; +lin baby_N = mkN "bébi" "bébit" ; -- lin back_N = mkN "" ; lin bad_A = mkA "rossz" ; lin bank_N = mkN "bank" "bankot" ; @@ -30,20 +30,20 @@ lin beer_N = mkN "sör" "sört" ; -- lin beg_V2V = mkV2 "" ; lin belly_N = mkN "has" "hasat" ; lin big_A = mkA "nagy" ; -lin bike_N = mkN "bicikli" ; -lin bird_N = mkN "madár" ; +lin bike_N = mkN "bicikli" "biciklit"; +lin bird_N = mkN "madár" "madarat"; -- lin bite_V2 = mkV2 "" ; lin black_A = mkA "fekete" ; -lin blood_N = mkN "vér" ; +lin blood_N = mkN "vér" "vért"; -- lin blow_V = mkV "" ; lin blue_A = mkA "kék" ; -lin boat_N = mkN "hajó" ; +lin boat_N = mkN "hajó" "hajót" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; lin book_N = mkN "könyv" harmE ; -- TODO Sg Sup könyvön, Sg All könyvhöz, all others in HarmE lin boy_N = mkN "fiú" ; -lin bread_N = mkN "kenyér" ; +lin bread_N = mkN "kenyér" "kenyeret"; lin break_V2 = mkV2 "szünet" ; lin breast_N = mkN "mell" "mellet" ; -- lin breathe_V = mkV "" ; @@ -57,13 +57,13 @@ lin butter_N = mkN "vaj" "vajat" ; ---- -- C -lin camera_N = mkN "fényképezőgép" ; +lin camera_N = mkN "fényképezőgép" "fényképezőgépet"; -- lin cap_N = mkN "" ; lin car_N = mkN "autó" "autót" ; lin carpet_N = mkN "szőnyeg" "szőnyeget" ; -lin cat_N = mkN "macska" ; +lin cat_N = mkN "macska" "macskát"; lin ceiling_N = roof_N ; -lin chair_N = mkN "szék" ; +lin chair_N = mkN "szék" "széket"; lin cheese_N = mkN "sajt" "sajtot" ; lin child_N = mkN "gyerek" "gyereket" ; lin church_N = mkN "templom" "templomot" ; @@ -79,7 +79,7 @@ lin computer_N = mkN "számítógép" "számítógépet" ; lin correct_A = mkA "igaz" ; -- lin count_V2 = mkV2 "" ; lin country_N = mkN "ország" "országot" ; -lin cousin_N = mkN "unokatestvér" ; --short "unoka" +lin cousin_N = mkN "unokatestvér" "unokatestvért"; --short "unoka" lin cow_N = mkN "tehén" ; -- lin cut_V2 = mkV2 "" ; -- @@ -92,8 +92,8 @@ lin day_N = mkN "nap" "napot" ; -- 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 doctor_N = mkN "orvos" "orvost"; +lin dog_N = mkN "kutya" "kutyát"; lin door_N = mkN "ajtó" "ajtót" ; -- lin drink_V2 = mkV2 "" ; -- lin dry_A = mkA "" ; @@ -103,13 +103,13 @@ lin door_N = mkN "ajtó" "ajtót" ; ---- -- E -lin ear_N = mkN "fül" ; -lin earth_N = mkN "föld" ; +lin ear_N = mkN "fül" "fület"; +lin earth_N = mkN "föld" "földet"; -- lin eat_V2 = mkV2 "" ; lin egg_N = mkN "tojás" "tojást" ; lin empty_A = mkA "üres" ; lin enemy_N = mkN "ellenség" "ellenséget" ; -lin eye_N = mkN "szem" ; +lin eye_N = mkN "szem" "szemet"; ---- -- F @@ -117,14 +117,14 @@ lin eye_N = mkN "szem" ; lin factory_N = mkN "gyár" "gyárat" ; -- lin fall_V = mkV "" ; -- lin far_Adv = mkA "" ; -lin fat_N = mkN "kövér" ; -lin father_N2 = mkN2 "apa" ; +lin fat_N = mkN "kövér" "kövéret"; +lin father_N2 = mkN2 "apa" "apát"; -- lin fear_V2 = mkV2 "" ; -- lin fear_VS = mkVS "" ; -lin feather_N = mkN "madártoll" ; +lin feather_N = mkN "madártoll" "madártollat"; -- lin fight_V2 = mkV2 "" ; -- lin find_V2 = mkV2 "" ; -lin fingernail_N = mkN "köröm" ; +lin fingernail_N = mkN "köröm" "körmöt"; lin fire_N = mkN "tűz" "tüzet" ; lin fish_N = mkN "hal" "halat" ; -- lin float_V = mkV "" ; @@ -132,29 +132,29 @@ lin floor_N = mkN "padló" "padlót" ; -- lin flow_V = mkV "" ; lin flower_N = mkN "virág" "virágot" ; lin fly_V = mkV "repül" ; -lin fog_N = mkN "köd" ; -- TODO ködöket -lin foot_N = mkN "láb" ; --same as leg, to specify "lábfej" +lin fog_N = mkN "köd" "ködöt"; -- TODO ködöket +lin foot_N = mkN "láb" "lábot"; --same as leg, to specify "lábfej" lin forest_N = mkN "erdő" "erdőt" ; -- lin forget_V2 = mkV2 "" ; -- lin freeze_V = mkV "" ; lin fridge_N = mkN "hűtő" "hűtőt" ; lin friend_N = mkN "barát" "barátot" ; -lin fruit_N = mkN "gyümölcs" ; +lin fruit_N = mkN "gyümölcs" "gyümölcsöt"; lin full_A = mkA "tele" ; -- --lin fun_AV ---- -- G -lin garden_N = mkN "kert" ; -lin girl_N = mkN "lány" ; +lin garden_N = mkN "kert" "kertet" ; +lin girl_N = mkN "lány" "lányt"; -- lin give_V3 = mkV3 "" ; lin glove_N = mkN "kesztyű" "kesztyűt" ; -- lin go_V = mkV "" ; lin gold_N = mkN "arany" "aranyat" ; lin good_A = mkA "jó" ; -lin grammar_N = mkN "nyelvtan" ; -lin grass_N = mkN "fű" ; +lin grammar_N = mkN "nyelvtan" "nyelvtant"; +lin grass_N = mkN "fű" "füvet"; lin green_A = mkA "zöld" ; ---- @@ -165,20 +165,20 @@ lin hand_N = mkN "kéz" "kezet" ; -- lin harbour_N = mkN "" ; lin hat_N = mkN "kalap" "kalapot" ; -- lin hate_V2 = mkV2 "" ; -lin head_N = mkN "fej" ; +lin head_N = mkN "fej" "fejet"; -- lin hear_V2 = mkV2 "" ; -lin heart_N = mkN "szív" ; +lin heart_N = mkN "szív" "szívet"; lin heavy_A = mkA "nehéz" ; -- lin hill_N = mkN "" ; -- lin hit_V2 = mkV2 "" ; -- lin hold_V2 = mkV2 "" ; -- lin hope_VS = mkV "" ; -- lin horn_N = mkN "" ; -lin horse_N = mkN "ló" ; +lin horse_N = mkN "ló" "lovat"; lin hot_A = mkA "forró" ; lin house_N = mkN "ház" "házat" ; -- lin hunt_V2 = mkV2 "" ; -lin husband_N = mkN "férj" ; +lin husband_N = mkN "férj" "férjet"; -------- -- I - K @@ -190,7 +190,7 @@ lin iron_N = mkN "vas" "vasat" ; -- lin jump_V = mkV "" ; -- lin kill_V2 = mkV2 "" ; lin king_N = mkN "király" "királyt" ; -lin knee_N = mkN "térd" ; +lin knee_N = mkN "térd" "térdet"; -- lin know_V2 = mkV2 "" ; -- lin know_VQ = mkVQ "" ; -- lin know_VS = mkV "" ; @@ -200,14 +200,14 @@ lin knee_N = mkN "térd" ; -- L lin lake_N = mkN "tó" "tavat" ; -lin lamp_N = mkN "lámpa" ; -lin language_N = mkN "nyelv" ; +lin lamp_N = mkN "lámpa" "lámpát"; +lin language_N = mkN "nyelv" "nyelvet"; -- lin laugh_V = mkV "" ; -lin leaf_N = mkN "levél" ; +lin leaf_N = mkN "levél" "levelet"; -- lin learn_V2 = mkV2 "" ; -lin leather_N = mkN "bőr" ; +lin leather_N = mkN "bőr" "bőrt"; -- lin leave_V2 = mkV2 "" ; -lin leg_N = mkN "láb" ; +lin leg_N = mkN "láb" "lábot"; -- lin lie_V = mkV "" ; -- lin like_V2 = mkV2 "" ; -- lin listen_V2 = mkV2 "" ; @@ -216,7 +216,7 @@ lin leg_N = mkN "láb" ; -- lin long_A = mkA "" ; -- lin lose_V2 = mkV2 "" ; -- lin louse_N = mkN "" ; -lin love_N = mkN "szerelem" ; +lin love_N = mkN "szerelem" "szerelmet"; -- lin love_V2 = mkV2 "" ; ---- @@ -224,24 +224,24 @@ lin love_N = mkN "szerelem" ; lin man_N = mkN "férfi" "ak" harmA ; -- force plural allomorph and a-harmony lin married_A2 = mkA2 "házas" Ins ; -lin meat_N = mkN "hús" ; +lin meat_N = mkN "hús" "húst"; lin milk_N = mkN "tej" "tejet" ; lin moon_N = mkN "hold" "holdat" ; -lin mother_N2 = mkN2 "anya" ; -lin mountain_N = mkN "hegy" ; +lin mother_N2 = mkN2 "anya" "anyát"; +lin mountain_N = mkN "hegy" "hegyet"; lin mouth_N = mkN "száj" "szájat" ; -lin music_N = mkN "zene" ; +lin music_N = mkN "zene" "zenét"; ---- -- N lin name_N = mkN "név" "nevet" ; -lin narrow_A = mkA "keskeny" ; --also "szűk" +lin narrow_A = mkA "keskeny" "keskenyet"; --also "szűk" lin near_A = mkA "közel" ; -lin neck_N = mkN "nyak" ; +lin neck_N = mkN "nyak" "nyakat"; lin new_A = mkA "új" ; lin newspaper_N = mkN "újság" "újságot" ; -lin night_N = mkN "éjszaka" ; --also shortened to "éj" ("este" more for evening) +lin night_N = mkN "éjszaka" "éjszakát"; --also shortened to "éj" ("este" more for evening) lin nose_N = mkN "orr" "orrot" ; lin now_Adv = mkAdv "most" ; lin number_N = mkN "szám" "számot" ; @@ -254,15 +254,15 @@ lin oil_N = mkN "olaj" "olajat" ; -- TODO olajok or olajak? lin old_A = mkA "öreg" ; --also "idős" -- lin open_V2 = mkV2 "" ; -- lin paint_V2A = mkV2A "" ; -lin paper_N = mkN "papír" ; +lin paper_N = mkN "papír" "papírt"; -- lin paris_PN = mkPN "Paris" ; -lin peace_N = mkN "béke" ; +lin peace_N = mkN "béke" "békét"; lin pen_N = mkN "toll" "tollat" ; -lin person_N = mkN "ember" ; +lin person_N = mkN "ember" "embert"; lin planet_N = mkN "bolygó" "bolygót" ; lin plastic_N = mkN "műanyag" "műanyagot" ; -- lin play_V = mkV "" ; -lin policeman_N = mkN "rendőr" ; --the police "rendőrség" +lin policeman_N = mkN "rendőr" "rendőrt"; --the police "rendőrség" lin priest_N = mkN "pap" "papot" ; -- lin pull_V2 = mkV2 "" ; -- lin push_V2 = mkV2 "" ; @@ -280,18 +280,18 @@ lin rain_N = mkN "eső" "esőt" ; lin ready_A = mkA "kész" ; lin reason_N = mkN "ok" "okot" ; lin red_A = mkA "piros" ; -lin religion_N = mkN "vallás" ; -lin restaurant_N = mkN "étterem" ; +lin religion_N = mkN "vallás" "vallásot"; +lin restaurant_N = mkN "étterem" "éttermet"; lin river_N = mkN "folyó" "folyót" ; lin road_N = mkN "út" "utat" ; -lin rock_N = mkN "szikla" ; +lin rock_N = mkN "szikla" "sziklát"; lin roof_N = mkN "plafon" "plafont" ; -lin root_N = mkN "gyökér" ; -lin rope_N = mkN "kötél" ; +lin root_N = mkN "gyökér" "gyökeret"; +lin rope_N = mkN "kötél" "kötelet"; -- lin rotten_A = mkA "" ; -- lin round_A = mkA "" ; -- lin rub_V2 = mkV2 "" ; -lin rubber_N = mkN "gumi" ; +lin rubber_N = mkN "gumi" "gumit"; lin rule_N = mkN "szabály" "szabályt" ; -- lin run_V = mkV "" ; @@ -301,10 +301,10 @@ lin rule_N = mkN "szabály" "szabályt" ; lin salt_N = mkN "só" "sót" ; lin sand_N = mkN "homok" "homokot" ; -- lin say_VS = mkVS "" ; -lin school_N = mkN "iskola" ; +lin school_N = mkN "iskola" "iskolát"; lin science_N = mkN "tudomány" "tudományt" ; -- lin scratch_V2 = mkV2 "" ; -lin sea_N = mkN "tenger" ; +lin sea_N = mkN "tenger" "tengert"; lin see_V2 = mkV2 "lát" ; lin seed_N = mkN "mag" "magot" ; -- lin seek_V2 = mkV2 "" ; @@ -314,25 +314,25 @@ lin seed_N = mkN "mag" "magot" ; -- 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 shirt_N = mkN "ing" "inget"; --shirt like t-shirt or the more formal? lin shoe_N = mkN "cipő" "cipőt" ; -lin shop_N = mkN "üzlet" ; +lin shop_N = mkN "üzlet" "üzletet"; lin short_A = mkA "rövid" ; --in short text, if human length then "alacsony" -lin silver_N = mkN "ezüst" ; -- TODO fix: ezüstöket +lin silver_N = mkN "ezüst" "ezüstet"; -- TODO fix: ezüstöket -- lin sing_V = mkV "" ; -- lin sister_N = mkN "" ; -- lin sit_V = mkV "" ; -lin skin_N = mkN "bőr" ; +lin skin_N = mkN "bőr" "bőrt"; lin sky_N = mkN "ég" "eget" ; -- lin sleep_V = mkV "" ; -lin small_A = mkA "kicsi" ; +lin small_A = mkA "kicsi" "kicsit"; -- lin smell_V = mkV "" ; -lin smoke_N = mkN "füst" ; +lin smoke_N = mkN "füst" "füstet"; lin smooth_A = mkA "sima" ; lin snake_N = mkN "kígyó" "kígyót" ; lin snow_N = mkN "hó" "havat" ; -lin sock_N = mkN "zokni" ; -lin song_N = mkN "dal" ; -- TODO fix: dalokat +lin sock_N = mkN "zokni" "zoknit"; +lin song_N = mkN "dal" "dalat"; -- TODO fix: dalokat -- lin speak_V2 = mkV2 "" ; -- lin spit_V = mkV "" ; -- lin split_V2 = mkV2 "" ; @@ -345,11 +345,11 @@ lin stick_N = mkN "rúd" "rudat" ; lin stone_N = mkN "kő" "követ" ; -- lin stop_V = mkV "" ; -- lin stove_N = mkN "" ; -lin straight_A = mkA "egyenes" ; +lin straight_A = mkA "egyenes"; lin student_N = mkN "diák" "diákot" ; lin stupid_A = mkA "buta" ; --also "hülye" -- lin suck_V2 = mkV2 "" ; -lin sun_N = mkN "nap" ; --same as day +lin sun_N = mkN "nap" "napot"; --same as day -- lin swell_V = mkV "" ; -- lin swim_V = mkV "" ; @@ -357,8 +357,8 @@ lin sun_N = mkN "nap" ; --same as day -- T -lin table_N = mkN "asztal" ; -lin tail_N = mkN "farok" ; +lin table_N = mkN "asztal" "asztalt"; +lin tail_N = mkN "farok" "farkot"; lin talk_V3 = mkV3 "beszél" ; -- lin teach_V2 = mkV2 "" ; lin teacher_N = mkN "tanár" "tanárt" ; @@ -369,11 +369,11 @@ lin thin_A = mkA "vekony" ; -- lin throw_V2 = mkV2 "" ; -- lin tie_V2 = mkV2 "" ; lin today_Adv = mkAdv "ma" ; -lin tongue_N = mkN "nyelv" ; --same as language +lin tongue_N = mkN "nyelv" "nyelvet"; --same as language lin tooth_N = mkN "fog" "fogat" ; lin train_N = mkN "vonat" "vonatot" ; -- lin travel_V = mkV "" ; -lin tree_N = mkN "fa" ; +lin tree_N = mkN "fa" "fát"; -- lin turn_V = mkV "" ; -------- @@ -382,7 +382,7 @@ lin tree_N = mkN "fa" ; lin ugly_A = mkA "csúf" ; -- lin uncertain_A = mkA "" ; -- lin understand_V2 = mkV2 "" ; -lin university_N = mkN "egyetem" ; +lin university_N = mkN "egyetem" "egyetemet"; lin village_N = mkN "falu" "falut" "falvak"; -- lin vomit_V = mkV2 "" ; @@ -403,15 +403,15 @@ lin wife_N = mkN "feleség" "feleséget" ; -- lin win_V2 = mkV2 "" ; lin wind_N = mkN "szél" "szelet" ; lin window_N = mkN "ablak" "ablakot" ; -lin wine_N = mkN "bor" ; -lin wing_N = mkN "szárny" ; +lin wine_N = mkN "bor" "bort"; +lin wing_N = mkN "szárny" "szárnyat"; -- lin wipe_V2 = mkV2 "" ; lin woman_N = mkN "nő" "nőt" ; -- lin wonder_VQ = mkVQ "" ; -lin wood_N = mkN "fa" ; --same as tree -lin worm_N = mkN "féreg" ; --also "kukac" +lin wood_N = mkN "fa" "fát"; --same as tree +lin worm_N = mkN "féreg" "férget"; --also "kukac" lin write_V2 = mkV2 (mkV "írok" "írsz" "ír" "írunk" "írtok" "írnak" "írni") ; -lin year_N = mkN "év" ; +lin year_N = mkN "év" "évet"; lin yellow_A = mkA "sárga" ; lin young_A = mkA "fiatal" ; From 04bdbfbcd66ec8f028ec031bdb948d15a47e6325 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 22 Apr 2020 19:48:30 +0200 Subject: [PATCH 15/84] (Hun) Add more paradigms for A --- src/hungarian/ParadigmsHun.gf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index ddf4499d0..fafbc4a56 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -33,7 +33,8 @@ oper --2 Adjectives mkA : overload { - mkA : (adj : Str) -> A ; -- Regular adjective, given in ??? form + mkA : (sgnom : Str) -> A ; -- Regular adjective, given in singular nominative + mkA : (sgnom, sgacc : Str) -> A ; -- Singular nominative and accusative -- mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A. } ; @@ -149,7 +150,8 @@ oper } ; mkA = overload { - mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ; + mkA : (sgnom : Str) -> A = \s -> lin A (mkAdj s) ; + mkA : (sgnom,sgacc : Str) -> A = \s,_ -> lin A (mkAdj s) ; -- TODO -- mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda -> -- jakda ** {s = \\af => kiga ++ jakda.s ! af} ; } ; From e54fa4d4ad28641cd34ebc30a61f7913d1ca9e3f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 22 Apr 2020 19:48:56 +0200 Subject: [PATCH 16/84] (Hun) Use different constructor for father,mother --- src/hungarian/LexiconHun.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index d445b1dcd..211e321b8 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -118,7 +118,7 @@ lin factory_N = mkN "gyár" "gyárat" ; -- lin fall_V = mkV "" ; -- lin far_Adv = mkA "" ; lin fat_N = mkN "kövér" "kövéret"; -lin father_N2 = mkN2 "apa" "apát"; +lin father_N2 = mkN2 (mkN "apa" "apát") ; -- lin fear_V2 = mkV2 "" ; -- lin fear_VS = mkVS "" ; lin feather_N = mkN "madártoll" "madártollat"; @@ -227,7 +227,7 @@ lin married_A2 = mkA2 "házas" Ins ; lin meat_N = mkN "hús" "húst"; lin milk_N = mkN "tej" "tejet" ; lin moon_N = mkN "hold" "holdat" ; -lin mother_N2 = mkN2 "anya" "anyát"; +lin mother_N2 = mkN2 (mkN "anya" "anyát") ; lin mountain_N = mkN "hegy" "hegyet"; lin mouth_N = mkN "száj" "szájat" ; lin music_N = mkN "zene" "zenét"; From 3705c9229dbb2777ff8c75317a1400bf00b8d00c Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 22 Apr 2020 19:55:11 +0200 Subject: [PATCH 17/84] (Hun) Restructure adpositions --- src/hungarian/AdjectiveHun.gf | 5 +++-- src/hungarian/AdverbHun.gf | 2 +- src/hungarian/ParadigmsHun.gf | 8 ++++---- src/hungarian/ResHun.gf | 28 +++++++++++++++++++++++++--- src/hungarian/StructuralHun.gf | 16 ++++++++-------- 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index a718d87ac..1a4c84495 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -12,13 +12,14 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : A -> NP -> AP ; ComparA a np = emptyAP ** { s = a.s ! Compar ; - compar = np.s ! Ade ; + compar = applyAdp (caseAdp "nál" "nél") np ; -- Adessive + -- compar = applyAdp (prepos Nom "mint") np ; } ; -- : A2 -> NP -> AP ; -- married to her ComplA2 a2 np = emptyAP ** { s = a2.s ! Posit ; - compar = np.s ! a2.c2.c ++ a2.c2.s + compar = applyAdp a2.c2 np ; } ; -- : A2 -> AP ; -- married to itself diff --git a/src/hungarian/AdverbHun.gf b/src/hungarian/AdverbHun.gf index ed7b74737..c7cbde60a 100644 --- a/src/hungarian/AdverbHun.gf +++ b/src/hungarian/AdverbHun.gf @@ -12,7 +12,7 @@ lin -- : Prep -> NP -> Adv ; PrepNP prep np = { - s = prep.pr ++ np.s ! prep.c ++ prep.s ; + s = applyAdp prep np } ; -- Adverbs can be modified by 'adadjectives', just like adjectives. diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index fafbc4a56..6a6ccd161 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -90,7 +90,7 @@ oper } ; prePrep : Str -> Case -> Prep -- Preposition - = \s,c -> lin Prep {pr=s ; s=[] ; c=c} ; + = \s,c -> lin Prep (ResHun.prepos c s) ; casePrep : Case -> Prep ; -- No postposition, only case @@ -190,13 +190,13 @@ oper mkPrep = overload { mkPrep : (e : Str) -> Prep - = \str -> lin Prep (ResHun.mkPrep str) ; + = \str -> lin Prep (ResHun.nomAdp str) ; mkPrep : Str -> Case -> Prep - = \str,c -> lin Prep (ResHun.mkPrep str ** {c = c}) ; + = \str,c -> lin Prep (ResHun.caseAdp c str) ; } ; casePrep : Case -> Prep - = \c -> lin Prep (ResHun.mkPrep [] ** {c = c}) ; + = \c -> lin Prep (ResHun.caseAdp c) ; -------------------------------------------------------------------------------- } diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 7f122f100..a26fd5a75 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -120,13 +120,35 @@ oper -- TODO: personal suffixes, e.g. felettem, általam, not *felett/által én Adposition : Type = { pr : Str ; -- Preposition - s : Str ; -- Postposition + s : HarmForms ; -- Postposition c : Case ; } ; - mkPrep : Str -> Adposition = \str -> {s=str ; c=Nom ; pr=[]} ; + nomAdp : Str -> Adposition = \s -> postpos Nom (harm1 s) ; - emptyAdp : Adposition = mkPrep [] ; + caseAdp = overload { + caseAdp : Case -> Adposition = \c -> postpos c (harm1 []) ; + caseAdp : Case -> Str -> Adposition = \c,s -> postpos c (harm1 s) ; + caseAdp : Str -> Adposition = \ért -> + postpos OblStem (harm1 ért) ; + caseAdp : (x,y : Str) -> Adposition = \nál,nél -> + postpos OblStem (harm nál nél) ; + caseAdp : (x,y,z : Str) -> Adposition = \hoz,hez,höz -> + postpos OblStem (harm3 hoz hez höz) + } ; + postpos : Case -> HarmForms -> Adposition = \c,h-> {s=h ; c=c ; pr=[]} ; + prepos : Case -> Str -> Adposition = \c,s -> {s=harm1 [] ; c=c ; pr=s} ; + + emptyAdp : Adposition = nomAdp [] ; + + applyAdp : Adposition -> NounPhrase -> Str = \adp,np -> + adp.pr ++ glueIf adp.c (np.s ! adp.c) (adp.s ! np.h) ; + + glueIf : Case -> (_,_ : Str) -> Str = \cas,a,b -> + case cas of { + OblStem => glue a b ; + _ => a ++ b + } ; ------------------ -- Conj diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 20d11a6ea..7b5af2dae 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -94,25 +94,25 @@ lin something_NP = defNP "valami" Sg ; -- List of postpositions requiring case: -- https://en.wiktionary.org/wiki/Appendix:Hungarian_postpositions#Postpositions_Requiring_Case -lin above_Prep = mkPrep "fölött" ; +lin above_Prep = nomAdp "fölött" ; -- lin after_Prep = mkPrep "" -- lin before_Prep = mkPrep "" ; -- lin behind_Prep = mkPrep "" ; -- lin between_Prep = = mkPrep "" ; -lin by8agent_Prep = mkPrep "által" ; -lin by8means_Prep = casePrep Ins ; +lin by8agent_Prep = nomAdp "által" ; +lin by8means_Prep = caseAdp Ins ; -- lin during_Prep = mkPrep ; -- lin except_Prep = mkPrep ; -lin for_Prep = casePrep Dat ; +lin for_Prep = caseAdp Dat ; -- lin from_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ; -lin in_Prep = casePrep Ine ; -lin on_Prep = casePrep Sup ; +lin in_Prep = caseAdp "ban" "ben" ; +lin on_Prep = caseAdp Sup ; -- lin part_Prep = casePrep ; -- lin possess_Prep = -- Suffix attaches to possessee, not possessor -- lin through_Prep = mkPrep ; -lin to_Prep = casePrep All ; -lin under_Prep = mkPrep "alatt" ; +lin to_Prep = caseAdp "hoz" "hez" "höz" ; +lin under_Prep = nomAdp "alatt" ; -- lin with_Prep = mkPrep "" ; -- lin without_Prep = mkPrep "" ; From 15040355e6d845a499283483b26ea3aefc11f758 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 22 Apr 2020 19:55:56 +0200 Subject: [PATCH 18/84] (Hun) WIP: first attempt at stem-based nominal morphology --- src/hungarian/CatHun.gf | 5 +- src/hungarian/NounHun.gf | 9 ++-- src/hungarian/NounMorphoHun.gf | 97 +++++++++++++++++----------------- src/hungarian/ParamHun.gf | 34 +++++++----- src/hungarian/ResHun.gf | 8 +++ 5 files changed, 88 insertions(+), 65 deletions(-) diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 287dc7182..f900b586d 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -58,7 +58,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { -- ``` Predet (QuantSg | QuantPl Num) Ord -- as defined in NounHun. - CN = ResHun.Noun ; + CN = ResHun.CNoun ; NP = ResHun.NounPhrase ; Pron = ResHun.Pronoun ; --Pronouns need enough info to turn it into NP or Quant. Det = ResHun.Determiner ; @@ -118,4 +118,7 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { N3 = ResHun.Noun ; PN = ResHun.NounPhrase ; +linref + CN = linCN ; + } diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 8bdb64241..8a10346af 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -11,7 +11,8 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { s = \\c => case det.caseagr of { True => det.s ! c ; False => det.s ! Nom - } ++ cn.s ! det.n ! c ; + } ++ cn.s ! det.n ! case2stem c + ++ cn.rs ! det.n ! c ; agr = ; } ; @@ -159,7 +160,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : N -> CN -- : N2 -> CN ; - UseN,UseN2 = \n -> n ; + UseN,UseN2 = \n -> n ** { + rs = \\_,_ => [] ; + } ; -- : N2 -> NP -> CN ; -- ComplN2 n2 np = @@ -181,7 +184,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : CN -> RS -> CN ; RelCN cn rs = cn ** { - s = \\n,c => cn.s ! n ! c ++ rs.s ! n ! c + rs = \\n,c => rs.s ! n ! c } ; -- : CN -> Adv -> CN ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 5b57c0b78..9d41ce556 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -1,7 +1,7 @@ resource NounMorphoHun = ParamHun ** open Prelude, Predef in { oper - Noun = {s : Number => Case => Str} ; + Noun = {s : Number => Case => Str ; h : Harm} ; -- Paradigm functions -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf @@ -12,15 +12,15 @@ oper -- Apply mkNoun to the lengthened stem "almá" or "kefé" nAlmá : Noun = mkNoun almá ; - in {s = \\n,c => case of { + in nAlmá ** { + 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 - } ; - } ; + _ => nAlmá.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! @@ -31,7 +31,8 @@ oper nLov = mkNoun lov ; nLova = mkNoun lova ; nLó = mkNoun ló ; - in {s = \\n,c => case of { + in nLova ** { + s = \\n,c => case of { -- All plural forms and Sg Acc, Sg Sup use the "lova" stem | => nLova.s ! n ! c ; @@ -39,10 +40,8 @@ oper -- The rest of the forms are formed with the regular constructor, -- using "ló" as the stem. - _ => nLó.s ! n ! c - - } ; - } ; + _ => nLó.s ! n ! c } + } ; -- NB. arguments are Sg Nom, Pl Nom -- handles words like: falu, daru, tetű -> falvak, darvak, tetvek @@ -50,17 +49,15 @@ oper let falva = init falvak ; nFalva = mkNoun falva ; nFalu = mkNoun falu ; - in {s = \\n,c => case of { + in nFalu ** { + s = \\n,c => case of { -- All plural forms and Sg Acc, Sg Sup use the "lova" stem => nFalva.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "ló" as the stem. - _ => nFalu.s ! n ! c - - } ; - } ; - + _ => nFalu.s ! n ! c } + } ; --Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) @@ -74,16 +71,17 @@ oper majm = init majmo ; nMajmo = mkNoun majmo ; nMajom = mkNoun majom ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - | => nMajmo.s ! n ! c ; - => nMajmo.s ! n ! c ; + in nMajmo ** { + s = \\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 - } ; - } ; + -- The rest of the forms are formed with the regular constructor, + -- using "majom" as the stem. + _ => nMajom.s ! n ! c + } + } ; -- Generic constructor for cases with different stem in Sg Nom and Sg Gen. -- Assumes that Sg Gen and all plurals have genitive stem, others Sg Nom stem. @@ -92,15 +90,16 @@ oper let tolla = init tollat ; nTolla = mkNoun tolla ; nToll = mkNoun toll ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc use the "tolla" stem - | => nTolla.s ! n ! c ; + in nTolla ** { + s = \\n,c => case of { + -- All plural forms and Sg Acc use the "tolla" stem + | => nTolla.s ! n ! c ; - -- The rest of the forms are formed with the regular constructor, - -- using "toll" as the stem. - _ => nToll.s ! n ! c - } - } ; + -- The rest of the forms are formed with the regular constructor, + -- using "toll" as the stem. + _ => nToll.s ! n ! c + } + } ; -- More words not covered by current paradigms: -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf @@ -160,7 +159,7 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> -- Here we guess the genitive form and give it to appropriate 2-arg paradigm regNoun : Str -> Noun = \sgnom -> case sgnom of { _ + ("a"|"e") => dAlma sgnom (lengthen sgnom + "t") ; - ("nyár"|"név") => dToll sgnom (név2nevet sgnom) ; + -- Words like nyár, név need to use 2-arg smart paradigm (#c|"")+("á"|"é")+ #c => mkNoun sgnom ; _ + ("á"|"é") + #c => dToll sgnom (név2nevet sgnom) ; _ + ("ó"|"é"|"ő"|"ű") => dLó sgnom (ló2lovat sgnom) ; @@ -302,21 +301,21 @@ oper -- Variant of case forms when the noun stem ends in consonant. endCaseCons : Case -> HarmForms = \c -> case c of { - Nom => harm1 [] ; Acc => harm3 "ot" "et" "öt" ; - 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 "á" "é" + Tra => harm "á" "é" ; + Dat => harm "nak" "nek" ; + _Nom => harm1 [] + -- All => harm3 "hoz" "hez" "höz" ; + -- Ade => harm "nál" "nél" ; + -- Abl => harm "tól" "től" ; + -- Sub => harm "ra" "re" ; + -- Ill => harm "ba" "be" ; + -- Ine => harm "ban" "ben" ; + -- Ela => harm "ból" "ből" ; + -- Del => harm "ról" "ről" ; + -- Cau => harm1 "ért" ; -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' -- Ter => harm1 "ig" ; -- Terminative 'as far as ' -- For => harm1 "ként" ; -- Formal 'as ' @@ -387,7 +386,8 @@ oper False => duplicateLast w } ; -- Noun is {s : Number => Case => Str}, we construct nested tables. - in {s = table { + in {h = h ; + s = table { Sg => table { -- Double the last letter (if consonant) before Ins, Tra c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; @@ -401,6 +401,7 @@ oper -- If we add possessive forms with allomorph -i, then revise. c@_ => w + plural + endCasePl c ! h } } - } ; + + } ; } diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 44905e0f3..5291c5d47 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -20,38 +20,46 @@ oper 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 + Case = + Nom | Acc -- Practical to have core cases as full strings + | Dat -- Would be nice but is very regular, so skip it + | Sup -- Depends on the word which stem it uses + -- | All -- Can have irregularities in suffix (k) + | Ins | Tra -- Different for vowels and consonants + | OblStem ; -- The rest of the cases are regular and attach to this stem + -- | Ill | Ine | Ela | 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 + Possessor = NoPoss | Poss Number Person ; + oper + case2stem : Case -> Case = id Case ; -- TODO add stems and cases as separate types 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 ; + Ins => ins ; + Tra => tra ; + OblStem => init a ; + Sup => sup ; + Sub => sub ; + Del => del ; Ill => il ; Ine => ine ; Ela => el ; All => al ; Ade => ad ; Abl => ab ; - Sub => sub ; - Sup => sup ; - Del => del ; - Cau => ca ; - Ins => ins ; - Tra => tra } ; + Cau => ca } ; sc2case : SubjCase -> Case = \sc -> case sc of { diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index a26fd5a75..878f950f7 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -13,10 +13,15 @@ resource ResHun = NounMorphoHun ** open Prelude, Predef in { -- Noun morphology is in NounMorphoHun oper + CNoun : Type = Noun ** { + rs : Number => Case => Str ; + } ; + BaseNP : Type = { agr : Person*Number ; objdef : ObjDef ; empty : Str ; -- standard trick for pro-drop + h : Harm ; } ; NounPhrase : Type = BaseNP ** { @@ -28,6 +33,7 @@ oper agr = ; objdef = Indef ; empty = [] ; + h = H_e ; } ; indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ; @@ -37,6 +43,8 @@ oper n = n ; objdef = Def ; } ; + + linCN : CNoun -> Str = \cn -> cn.s ! Sg ! Nom ++ cn.rs ! Sg ! Nom ; -------------------------------------------------------------------------------- -- Pronouns From d7d5f4aa59613876317af50e0cf53a32afbd8977 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 13:36:57 +0200 Subject: [PATCH 19/84] (Hun) Stems in N+CN, full infl table in NP. --- src/hungarian/AdjectiveHun.gf | 2 +- src/hungarian/NounHun.gf | 18 +++++---- src/hungarian/NounMorphoHun.gf | 72 ++++++++++++++++++---------------- src/hungarian/ParamHun.gf | 24 ++++++------ src/hungarian/PhraseHun.gf | 2 +- src/hungarian/ResHun.gf | 60 ++++++++++++++++------------ src/hungarian/StructuralHun.gf | 4 +- src/hungarian/VerbHun.gf | 11 ++++-- 8 files changed, 105 insertions(+), 88 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 1a4c84495..b525638b0 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -12,7 +12,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : A -> NP -> AP ; ComparA a np = emptyAP ** { s = a.s ! Compar ; - compar = applyAdp (caseAdp "nál" "nél") np ; -- Adessive + compar = np.s ! Ade ; -- compar = applyAdp (prepos Nom "mint") np ; } ; diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 8a10346af..2927c9071 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -11,8 +11,8 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { s = \\c => case det.caseagr of { True => det.s ! c ; False => det.s ! Nom - } ++ cn.s ! det.n ! case2stem c - ++ cn.rs ! det.n ! c ; + } ++ caseFromStem True c cn det.n + ++ cn.compl ! det.n ! c ; agr = ; } ; @@ -57,7 +57,8 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : CN -> NP ; MassNP cn = emptyNP ** { - s = \\c => cn.s ! Sg ! c ; + s = \\c => caseFromStem True c cn Sg ++ + cn.compl ! Sg ! c ; agr = ; } ; @@ -161,7 +162,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : N -> CN -- : N2 -> CN ; UseN,UseN2 = \n -> n ** { - rs = \\_,_ => [] ; + compl = \\_,_ => [] ; } ; -- : N2 -> NP -> CN ; @@ -179,17 +180,18 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : AP -> CN -> CN AdjCN ap cn = cn ** { - s = \\n,c => ap.s ! Sg ++ cn.s ! n ! c ++ ap.compar + s = \\n,c => ap.s ! Sg ++ cn.s ! n ! c ; + compl = \\n,c => ap.compar ++ cn.compl ! n ! c ; } ; -- : CN -> RS -> CN ; RelCN cn rs = cn ** { - rs = \\n,c => rs.s ! n ! c + compl = \\n,c => cn.compl ! n ! c ++ rs.s ! n ! c } ; -- : CN -> Adv -> CN ; AdvCN cn adv = cn ** { - s = \\n,c => cn.s ! n ! c ++ adv.s + compl = \\n,c => cn.compl ! n ! c ++ adv.s } ; -- Nouns can also be modified by embedded sentences and questions. @@ -205,7 +207,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : CN -> NP -> CN ; -- city Paris (, numbers x and y) ApposCN cn np = cn ** { - s = \\n,c => cn.s ! n ! c ++ np.s ! Nom + compl = \\n,c => cn.compl ! n ! c ++ np.s ! Nom } ; --2 Possessive and partitive constructs diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 9d41ce556..c21178e74 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -1,7 +1,7 @@ resource NounMorphoHun = ParamHun ** open Prelude, Predef in { oper - Noun = {s : Number => Case => Str ; h : Harm} ; + Noun = {s : Number => CaseStem => Str ; h : Harm} ; -- Paradigm functions -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf @@ -15,7 +15,7 @@ oper in nAlmá ** { s = \\n,c => case of { -- Singular nominative uses the given form, e.g. "alma" or "kefe" - => alma ; + => alma ; -- The rest of the forms are formed with the regular constructor, -- using "almá" or "kefé" as the stem. @@ -35,8 +35,8 @@ oper 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 ; + | => nLova.s ! n ! c ; + => nLov.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "ló" as the stem. @@ -74,8 +74,8 @@ oper in nMajmo ** { s = \\n,c => case of { -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - | => nMajmo.s ! n ! c ; - => nMajmo.s ! n ! c ; + | => nMajmo.s ! n ! c ; + => nMajmo.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "majom" as the stem. @@ -93,7 +93,7 @@ oper in nTolla ** { s = \\n,c => case of { -- All plural forms and Sg Acc use the "tolla" stem - | => nTolla.s ! n ! c ; + | => nTolla.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "toll" as the stem. @@ -300,22 +300,28 @@ oper harm1 : Str -> HarmForms = \i -> harm i i ; -- Variant of case forms when the noun stem ends in consonant. - endCaseCons : Case -> HarmForms = \c -> case c of { + endCaseCons : CaseStem -> HarmForms = \c -> case c of { + AccFull => harm3 "ot" "et" "öt" ; + SupFull => harm3 "on" "en" "ön" ; + _ => harm1 [] + } ; + + endCase : Case -> HarmForms = \c -> case c of { + Nom => harm1 [] ; Acc => harm3 "ot" "et" "öt" ; - Sup => harm3 "on" "en" "ön" ; + Dat => harm "nak" "nek" ; Ins => harm "al" "el" ; Tra => harm "á" "é" ; - Dat => harm "nak" "nek" ; - _Nom => harm1 [] - -- All => harm3 "hoz" "hez" "höz" ; - -- Ade => harm "nál" "nél" ; - -- Abl => harm "tól" "től" ; - -- Sub => harm "ra" "re" ; - -- Ill => harm "ba" "be" ; - -- Ine => harm "ban" "ben" ; - -- Ela => harm "ból" "ből" ; - -- Del => harm "ról" "ről" ; - -- Cau => harm1 "ért" ; + 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" -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' -- Ter => harm1 "ig" ; -- Terminative 'as far as ' -- For => harm1 "ként" ; -- Formal 'as ' @@ -323,25 +329,23 @@ oper } ; -- Variant where accusative has the allomorph -at - endCaseConsAccAt : Case -> HarmForms = \c -> case c of { - Acc => harm3 "at" "et" "öt" ; + endCaseConsAccAt : CaseStem -> HarmForms = \c -> case c of { + AccFull => 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" ; + endCaseConsAcc : CaseStem -> HarmForms = \c -> case c of { + AccFull => 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é" ; - + endCaseVow : CaseStem -> HarmForms = \c -> case c of { + AccFull => harm1 "t" ; + SupFull => harm1 "n" ; + InsTraStem => harm1 "v" ; -- Other forms are shared with endCaseCons. _ => endCaseCons c } ; @@ -368,7 +372,7 @@ oper mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = mkNounHarmAcc True ; mkNounHarmAcc : (useAt : Bool) -> Harm -> (plural : Str) -> Str -> Noun = \useAt,h,plural,w -> - let endCaseSg : Case -> HarmForms = case of { + let endCaseSg : CaseStem -> HarmForms = case of { <_,_ + #v> => endCaseVow ; <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j" |"ly"|"l"|"r"|"n"|"ny"|"ssz"|"zz" @@ -376,7 +380,7 @@ oper |"nz")> => endCaseConsAcc ; => endCaseConsAccAt ; _ => endCaseCons } ; - endCasePl : Case -> HarmForms = case of { + endCasePl : CaseStem -> HarmForms = case of { <"ak",_> => endCaseConsAccAt ; <_,True> => endCaseConsAccAt ; _ => endCaseCons } ; @@ -390,12 +394,12 @@ oper s = table { Sg => table { -- Double the last letter (if consonant) before Ins, Tra - c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; + c@(InsTraStem) => 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 ; + c@(InsTraStem) => 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. diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 5291c5d47..d4db0679f 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -20,27 +20,26 @@ oper param - Case = - Nom | Acc -- Practical to have core cases as full strings - | Dat -- Would be nice but is very regular, so skip it - | Sup -- Depends on the word which stem it uses - -- | All -- Can have irregularities in suffix (k) - | Ins | Tra -- Different for vowels and consonants + CaseStem = + NomFull | AccFull | SupFull -- These may use 2-3 different stems + | InsTraStem -- Instrumental and translative: -v after vowels | OblStem ; -- The rest of the cases are regular and attach to this stem - -- | Ill | Ine | Ela | Ade | Abl | Sub | Sup | Del -- Locatives - -- | Cau -- Causal-final 'for the purpose of, for the reason that' - -- | Ins -- Instrumental - -- | Tra -- Translative + + Case = + Nom | Acc | Dat + | 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 Possessor = NoPoss | Poss Number Person ; oper - case2stem : Case -> Case = id Case ; -- TODO add stems and cases as separate types caseTable : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Case=>Str = \n,a,d,il,ine,el,al,ad,ab,sub,sup,del,ca,ins,tra -> table { @@ -49,7 +48,6 @@ oper Dat => d ; Ins => ins ; Tra => tra ; - OblStem => init a ; Sup => sup ; Sub => sub ; Del => del ; diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 14fcb2cab..46ed5ad22 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -15,7 +15,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { 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} ; + UttCN cn = {s = linCN cn} ; UttCard n = {s = n.s ! Indep} ; UttAP ap = {s = ap.s ! Sg ++ ap.compar} ; UttInterj i = i ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 878f950f7..cb0e63af8 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -14,14 +14,28 @@ resource ResHun = NounMorphoHun ** open Prelude, Predef in { oper CNoun : Type = Noun ** { - rs : Number => Case => Str ; + compl : Number => Case => Str ; } ; + mkCaseNoun : Str -> Number => Case => Str = \s -> + \\n,c => caseFromStem False c (mkNoun s) n ; + mkCaseNoun2 : (n,a : Str) -> Number => Case => Str = \no,ac -> + \\n,c => caseFromStem False c (regNounNomAcc no ac) n ; + + caseFromStem : Bool -> Case -> Noun -> Number -> Str = \usebind,cas,cn,n -> + case cas of { + Nom => cn.s ! n ! NomFull ; + Acc => cn.s ! n ! AccFull ; + Sup => cn.s ! n ! SupFull ; + Ins => glueIf usebind (cn.s ! n ! InsTraStem) (endCase Ins ! cn.h) ; + Tra => glueIf usebind (cn.s ! n ! InsTraStem) (endCase Tra ! cn.h) ; + _ => applyOblCase usebind (endCase cas) n cn + } ; + BaseNP : Type = { agr : Person*Number ; objdef : ObjDef ; empty : Str ; -- standard trick for pro-drop - h : Harm ; } ; NounPhrase : Type = BaseNP ** { @@ -39,12 +53,12 @@ oper indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ; defNP : Str -> Number -> NounPhrase = \s,n -> emptyNP ** { - s = (mkNoun s).s ! n ; + s = mkCaseNoun s ! n ; n = n ; objdef = Def ; } ; - linCN : CNoun -> Str = \cn -> cn.s ! Sg ! Nom ++ cn.rs ! Sg ! Nom ; + linCN : CNoun -> Str = \cn -> cn.s ! Sg ! NomFull ++ cn.compl ! Sg ! Nom ; -------------------------------------------------------------------------------- -- Pronouns @@ -69,8 +83,8 @@ oper } ; mkQuant : (s,sp : Str) -> Quant = \s,sp -> { - s = (mkNoun s).s ; - sp = (mkNoun sp).s ; + s = mkCaseNoun s ; + sp = mkCaseNoun sp ; isIndefArt = False ; objdef = Def ; caseagr = True ; @@ -87,7 +101,7 @@ oper mkDet : (s : Str) -> ObjDef -> Number -> Bool -> Determiner = \s,d,n,ca -> { s, - sp = (mkNoun s).s ! n ; + sp = mkCaseNoun s ! n ; n = n ; numtype = NoNum ; objdef = d ; @@ -97,7 +111,7 @@ oper mkDet2 : (n,a : Str) -> ObjDef -> Number -> Bool -> Determiner = \no,ac,d,n,ca -> let reg : Determiner = mkDet no d n ca in reg ** { - s,sp = (regNounNomAcc no ac).s ! n ; + s,sp = mkCaseNoun2 no ac ! n ; } ; @@ -128,35 +142,29 @@ oper -- TODO: personal suffixes, e.g. felettem, általam, not *felett/által én Adposition : Type = { pr : Str ; -- Preposition - s : HarmForms ; -- Postposition + s : Str ; -- Postposition c : Case ; } ; - nomAdp : Str -> Adposition = \s -> postpos Nom (harm1 s) ; + nomAdp : Str -> Adposition = \s -> postpos Nom s ; caseAdp = overload { - caseAdp : Case -> Adposition = \c -> postpos c (harm1 []) ; - caseAdp : Case -> Str -> Adposition = \c,s -> postpos c (harm1 s) ; - caseAdp : Str -> Adposition = \ért -> - postpos OblStem (harm1 ért) ; - caseAdp : (x,y : Str) -> Adposition = \nál,nél -> - postpos OblStem (harm nál nél) ; - caseAdp : (x,y,z : Str) -> Adposition = \hoz,hez,höz -> - postpos OblStem (harm3 hoz hez höz) + caseAdp : Case -> Adposition = \c -> postpos c [] ; + caseAdp : Case -> Str -> Adposition = \c,s -> postpos c s ; } ; - postpos : Case -> HarmForms -> Adposition = \c,h-> {s=h ; c=c ; pr=[]} ; - prepos : Case -> Str -> Adposition = \c,s -> {s=harm1 [] ; c=c ; pr=s} ; + postpos : Case -> Str -> Adposition = \c,s-> {s=s ; c=c ; pr=[]} ; + prepos : Case -> Str -> Adposition = \c,s -> {s=[] ; c=c ; pr=s} ; emptyAdp : Adposition = nomAdp [] ; applyAdp : Adposition -> NounPhrase -> Str = \adp,np -> - adp.pr ++ glueIf adp.c (np.s ! adp.c) (adp.s ! np.h) ; + adp.pr ++ np.s ! adp.c ++ adp.s ; - glueIf : Case -> (_,_ : Str) -> Str = \cas,a,b -> - case cas of { - OblStem => glue a b ; - _ => a ++ b - } ; + applyOblCase : Bool -> HarmForms -> Number -> Noun -> Str = \usebind,adp,n,np -> + glueIf usebind (np.s ! n ! OblStem) (adp ! np.h) ; + + glueIf : Bool -> (_,_ : Str) -> Str = \f,a,b -> + if_then_Str f (glue a b) (a + b) ; ------------------ -- Conj diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 7b5af2dae..a4f6aa08d 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -106,12 +106,12 @@ lin by8means_Prep = caseAdp Ins ; lin for_Prep = caseAdp Dat ; -- lin from_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ; -lin in_Prep = caseAdp "ban" "ben" ; +lin in_Prep = caseAdp Ine ; lin on_Prep = caseAdp Sup ; -- lin part_Prep = casePrep ; -- lin possess_Prep = -- Suffix attaches to possessee, not possessor -- lin through_Prep = mkPrep ; -lin to_Prep = caseAdp "hoz" "hez" "höz" ; +lin to_Prep = caseAdp All ; lin under_Prep = nomAdp "alatt" ; -- lin with_Prep = mkPrep "" ; -- lin without_Prep = mkPrep "" ; diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index f89e74431..ec6b2ad94 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -118,9 +118,14 @@ lin -- : CN -> Comp ; CompCN cn = UseCopula ** { s = \\vf => case vf of { - VPres P3 n => cn.s ! n ! Nom ; - VPres _ n => cn.s ! n ! Nom ++ copula.s ! vf ; - _ => cn.s ! Sg ! Nom ++ copula.s ! vf} ; + VPres P3 n => cn.s ! n ! NomFull + ++ cn.compl ! n ! Nom ; + VPres _ n => cn.s ! n ! NomFull + ++ cn.compl ! n ! Nom + ++ copula.s ! vf ; + _ => cn.s ! Sg ! NomFull + ++ cn.compl ! Sg ! Nom + ++ copula.s ! vf} ; } ; -- : NP -> Comp ; From 3d25f3b48d717a8ac93b027c4a601873a4d8d7ec Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 13:42:42 +0200 Subject: [PATCH 20/84] (Hun) Fix bugs in Cons,ConjNP --- src/hungarian/ConjunctionHun.gf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index f7bac7224..f233d22c7 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -31,8 +31,12 @@ lincat lin BaseNP x y = twoTable Case x y ** y ; - ConsNP x xs = consrTable Case comma x xs ** xs ; - ConjNP co xs = conjunctDistrTable Case co xs ** xs ** {agr = }; + ConsNP x xs = xs ** consrTable Case comma x xs ; + ConjNP co xs = conjunctDistrTable Case co xs ** xs ** { + agr = Pl ; + _ => co.n }> + } ; -- Relative sentences lincat From a52300205d23ea4915c955bfad647f3eeb04769b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 16:14:31 +0200 Subject: [PATCH 21/84] (Hun) Squeeze further down to 7 stems --- src/hungarian/NounHun.gf | 2 +- src/hungarian/NounMorphoHun.gf | 153 +++++++++++++++++---------------- src/hungarian/ParamHun.gf | 15 ++-- src/hungarian/ResHun.gf | 23 +++-- src/hungarian/VerbHun.gf | 8 +- 5 files changed, 107 insertions(+), 94 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 2927c9071..cb702c1c6 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -180,7 +180,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : AP -> CN -> CN AdjCN ap cn = cn ** { - s = \\n,c => ap.s ! Sg ++ cn.s ! n ! c ; + s = \\nc => ap.s ! Sg ++ cn.s ! nc ; compl = \\n,c => ap.compar ++ cn.compl ! n ! c ; } ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index c21178e74..6e3ee80a3 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -1,7 +1,7 @@ resource NounMorphoHun = ParamHun ** open Prelude, Predef in { oper - Noun = {s : Number => CaseStem => Str ; h : Harm} ; + Noun = {s : NumCaseStem => Str ; h : Harm} ; -- Paradigm functions -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf @@ -13,13 +13,13 @@ oper -- Apply mkNoun to the lengthened stem "almá" or "kefé" nAlmá : Noun = mkNoun almá ; in nAlmá ** { - s = \\n,c => case of { + s = \\nc => case nc of { -- Singular nominative uses the given form, e.g. "alma" or "kefe" - => alma ; + SgNom => alma ; -- The rest of the forms are formed with the regular constructor, -- using "almá" or "kefé" as the stem. - _ => nAlmá.s ! n ! c } + _ => nAlmá.s ! nc } } ; --Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. @@ -32,15 +32,15 @@ oper nLova = mkNoun lova ; nLó = mkNoun ló ; in nLova ** { - s = \\n,c => case of { + s = \\nc => case nc of { -- All plural forms and Sg Acc, Sg Sup use the "lova" stem - | => nLova.s ! n ! c ; - => nLov.s ! n ! c ; + PlStem | PlAcc | SgAcc => nLova.s ! nc ; + SgSup => nLov.s ! nc ; -- The rest of the forms are formed with the regular constructor, -- using "ló" as the stem. - _ => nLó.s ! n ! c } + _ => nLó.s ! nc } } ; -- NB. arguments are Sg Nom, Pl Nom @@ -50,13 +50,14 @@ oper nFalva = mkNoun falva ; nFalu = mkNoun falu ; in nFalu ** { - s = \\n,c => case of { + s = \\nc => case nc of { + + -- All plural forms and Sg Acc, Sg Sup use the "falu" stem + PlStem | PlAcc => nFalva.s ! nc ; - -- All plural forms and Sg Acc, Sg Sup use the "lova" stem - => nFalva.s ! n ! c ; -- The rest of the forms are formed with the regular constructor, -- using "ló" as the stem. - _ => nFalu.s ! n ! c } + _ => nFalu.s ! nc } } ; @@ -72,14 +73,14 @@ oper nMajmo = mkNoun majmo ; nMajom = mkNoun majom ; in nMajmo ** { - s = \\n,c => case of { + s = \\nc => case nc of { -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - | => nMajmo.s ! n ! c ; - => nMajmo.s ! n ! c ; + PlStem | PlAcc | SgAcc => nMajmo.s ! nc ; + SgSup => nMajmo.s ! nc ; -- The rest of the forms are formed with the regular constructor, -- using "majom" as the stem. - _ => nMajom.s ! n ! c + _ => nMajom.s ! nc } } ; @@ -91,13 +92,13 @@ oper nTolla = mkNoun tolla ; nToll = mkNoun toll ; in nTolla ** { - s = \\n,c => case of { + s = \\nc => case nc of { -- All plural forms and Sg Acc use the "tolla" stem - | => nTolla.s ! n ! c ; + PlStem | PlAcc | SgAcc => nTolla.s ! nc ; -- The rest of the forms are formed with the regular constructor, -- using "toll" as the stem. - _ => nToll.s ! n ! c + _ => nToll.s ! nc } } ; @@ -300,52 +301,31 @@ oper harm1 : Str -> HarmForms = \i -> harm i i ; -- Variant of case forms when the noun stem ends in consonant. - endCaseCons : CaseStem -> HarmForms = \c -> case c of { - AccFull => harm3 "ot" "et" "öt" ; - SupFull => harm3 "on" "en" "ön" ; + endCaseCons : NumCaseStem -> HarmForms = \c -> case c of { + SgSup => harm3 "on" "en" "ön" ; + SgAcc|PlAcc => harm3 "ot" "et" "öt" ; _ => harm1 [] } ; - endCase : Case -> HarmForms = \c -> case c of { - Nom => harm1 [] ; - Acc => harm3 "ot" "et" "öt" ; - Dat => harm "nak" "nek" ; - Ins => harm "al" "el" ; - Tra => harm "á" "é" ; - 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" - -- 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 : CaseStem -> HarmForms = \c -> case c of { - AccFull => harm3 "at" "et" "öt" ; + endCaseConsAccAt : NumCaseStem -> HarmForms = \c -> case c of { + SgAcc|PlAcc => 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 : CaseStem -> HarmForms = \c -> case c of { - AccFull => harm1 "t" ; + endCaseConsAcc : NumCaseStem -> HarmForms = \c -> case c of { + SgAcc => harm1 "t" ; _ => endCaseCons c } ; -- Variant of case forms when the noun stem ends in vowel. - endCaseVow : CaseStem -> HarmForms = \c -> case c of { - AccFull => harm1 "t" ; - SupFull => harm1 "n" ; - InsTraStem => harm1 "v" ; + endCaseVow : NumCaseStem -> HarmForms = \c -> case c of { + SgAcc => harm1 "t" ; + SgSup => harm1 "n" ; + SgInsStem => harm1 "v" ; -- Other forms are shared with endCaseCons. _ => endCaseCons c } ; @@ -372,40 +352,63 @@ oper mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = mkNounHarmAcc True ; mkNounHarmAcc : (useAt : Bool) -> Harm -> (plural : Str) -> Str -> Noun = \useAt,h,plural,w -> - let endCaseSg : CaseStem -> 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 : CaseStem -> HarmForms = case of { - <"ak",_> => endCaseConsAccAt ; - <_,True> => endCaseConsAccAt ; - _ => endCaseCons } ; + let endCaseSg : NumCaseStem -> HarmForms = + case of { + <_,_ + #v> => endCaseVow ; + <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny"|"ssz" + |"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz")> => endCaseConsAcc ; + => endCaseConsAccAt ; + _ => endCaseCons } ; + endCasePl : NumCaseStem -> 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. + -- Noun is {s : NumCaseStem => Str} in {h = h ; s = table { - Sg => table { - -- Double the last letter (if consonant) before Ins, Tra - c@(InsTraStem) => duplConsStem + endCaseSg c ! h ; - c@_ => w + endCaseSg c ! h } ; + -- Before Sg Ins, Tra: + -- * Double the last letter if consonant + -- * Add v if vowel (comes from endCaseSg) + SgInsStem => duplConsStem + endCaseSg SgInsStem ! h ; - Pl => table { - -- Double the plural k before Ins, Tra - c@(InsTraStem) => 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@(PlStem|PlAcc) => w + plural + 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 } - } + -- All other singular forms and stems + c => w + endCaseSg c ! h } ; } ; + +-- This is used in ResHun.caseFromStem, not here. + + endCase : Case -> HarmForms = \c -> case c of { + Nom => harm1 [] ; + Acc => harm3 "ot" "et" "öt" ; + Dat => harm "nak" "nek" ; + Ins => harm "al" "el" ; + Tra => harm "á" "é" ; + 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" + -- 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. + } ; + } diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index d4db0679f..0d287629a 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -20,10 +20,13 @@ oper param - CaseStem = - NomFull | AccFull | SupFull -- These may use 2-3 different stems - | InsTraStem -- Instrumental and translative: -v after vowels - | OblStem ; -- The rest of the cases are regular and attach to this stem + NumCaseStem = + SgNom | SgAcc | SgSup -- These may use 2-3 different stems + | PlAcc -- May have irregular vowel in suffix + | SgInsStem -- Instrumental and translative: -v after vowels + | SgStem -- Rest of the cases in Sg + | PlStem -- Rest of the cases in Pl + ; Case = Nom | Acc | Dat @@ -31,8 +34,8 @@ param | 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’) + -- | Ess | Ter | For + -- | Tem -- Temporal, e.g. hatkor ‘six o’clock’ (from hat ‘6’) ; SubjCase = SCNom | SCDat ; -- Limited set of subject cases diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index cb0e63af8..56b4b02e1 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -23,12 +23,14 @@ oper \\n,c => caseFromStem False c (regNounNomAcc no ac) n ; caseFromStem : Bool -> Case -> Noun -> Number -> Str = \usebind,cas,cn,n -> - case cas of { - Nom => cn.s ! n ! NomFull ; - Acc => cn.s ! n ! AccFull ; - Sup => cn.s ! n ! SupFull ; - Ins => glueIf usebind (cn.s ! n ! InsTraStem) (endCase Ins ! cn.h) ; - Tra => glueIf usebind (cn.s ! n ! InsTraStem) (endCase Tra ! cn.h) ; + case of { + => cn.s ! SgNom ; + => cn.s ! SgAcc ; + => cn.s ! SgSup ; + => cn.s ! PlAcc ; + => cn.s ! PlStem ; + => glueIf usebind (cn.s ! SgInsStem) (endCase cas ! cn.h) ; + => glueIf usebind (glue (cn.s ! PlStem) "k") (endCase cas ! cn.h) ; _ => applyOblCase usebind (endCase cas) n cn } ; @@ -58,7 +60,7 @@ oper objdef = Def ; } ; - linCN : CNoun -> Str = \cn -> cn.s ! Sg ! NomFull ++ cn.compl ! Sg ! Nom ; + linCN : CNoun -> Str = \cn -> cn.s ! SgNom ++ cn.compl ! Sg ! Nom ; -------------------------------------------------------------------------------- -- Pronouns @@ -160,8 +162,11 @@ oper applyAdp : Adposition -> NounPhrase -> Str = \adp,np -> adp.pr ++ np.s ! adp.c ++ adp.s ; - applyOblCase : Bool -> HarmForms -> Number -> Noun -> Str = \usebind,adp,n,np -> - glueIf usebind (np.s ! n ! OblStem) (adp ! np.h) ; + applyOblCase : Bool -> HarmForms -> Number -> Noun -> Str = + \usebind,adp,n,np -> + let stem : NumCaseStem = case n of { + Sg => SgStem ; Pl => PlStem } ; + in glueIf usebind (np.s ! stem) (adp ! np.h) ; glueIf : Bool -> (_,_ : Str) -> Str = \f,a,b -> if_then_Str f (glue a b) (a + b) ; diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index ec6b2ad94..705805e2a 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -118,12 +118,14 @@ lin -- : CN -> Comp ; CompCN cn = UseCopula ** { s = \\vf => case vf of { - VPres P3 n => cn.s ! n ! NomFull + VPres P3 n => cn.s ! SgNom -- TODO ++ cn.compl ! n ! Nom ; - VPres _ n => cn.s ! n ! NomFull + + VPres _ n => cn.s ! SgNom -- TODO ++ cn.compl ! n ! Nom ++ copula.s ! vf ; - _ => cn.s ! Sg ! NomFull + + _ => cn.s ! SgNom ++ cn.compl ! Sg ! Nom ++ copula.s ! vf} ; } ; From bff100b75b63361d55b1e96595c4a1c1b5acd452 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 18:05:44 +0200 Subject: [PATCH 22/84] (Hun) Replace SgAcc with SgAccStem; will be reused with poss. suffixes --- src/hungarian/NounHun.gf | 4 ++-- src/hungarian/NounMorphoHun.gf | 16 +++++++++------- src/hungarian/ParamHun.gf | 2 +- src/hungarian/ResHun.gf | 23 ++++++++++------------- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index cb702c1c6..e2e160169 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -11,7 +11,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { s = \\c => case det.caseagr of { True => det.s ! c ; False => det.s ! Nom - } ++ caseFromStem True c cn det.n + } ++ caseFromStem glue cn c det.n ++ cn.compl ! det.n ! c ; agr = ; } ; @@ -57,7 +57,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : CN -> NP ; MassNP cn = emptyNP ** { - s = \\c => caseFromStem True c cn Sg ++ + s = \\c => caseFromStem glue cn c Sg ++ cn.compl ! Sg ! c ; agr = ; } ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 6e3ee80a3..c93cfabde 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -35,7 +35,7 @@ oper s = \\nc => case nc of { -- All plural forms and Sg Acc, Sg Sup use the "lova" stem - PlStem | PlAcc | SgAcc => nLova.s ! nc ; + PlStem | PlAcc | SgAccStem => nLova.s ! nc ; SgSup => nLov.s ! nc ; -- The rest of the forms are formed with the regular constructor, @@ -75,7 +75,7 @@ oper in nMajmo ** { s = \\nc => case nc of { -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - PlStem | PlAcc | SgAcc => nMajmo.s ! nc ; + PlStem | PlAcc | SgAccStem => nMajmo.s ! nc ; SgSup => nMajmo.s ! nc ; -- The rest of the forms are formed with the regular constructor, @@ -94,7 +94,7 @@ oper in nTolla ** { s = \\nc => case nc of { -- All plural forms and Sg Acc use the "tolla" stem - PlStem | PlAcc | SgAcc => nTolla.s ! nc ; + PlStem | PlAcc | SgAccStem => nTolla.s ! nc ; -- The rest of the forms are formed with the regular constructor, -- using "toll" as the stem. @@ -303,27 +303,29 @@ oper -- Variant of case forms when the noun stem ends in consonant. endCaseCons : NumCaseStem -> HarmForms = \c -> case c of { SgSup => harm3 "on" "en" "ön" ; - SgAcc|PlAcc => harm3 "ot" "et" "öt" ; + PlAcc => harm3 "ot" "et" "öt" ; + SgAccStem => harm3 "o" "e" "ö" ; _ => harm1 [] } ; -- Variant where accusative has the allomorph -at endCaseConsAccAt : NumCaseStem -> HarmForms = \c -> case c of { - SgAcc|PlAcc => harm3 "at" "et" "öt" ; + SgAccStem => harm3 "a" "e" "ö" ; + PlAcc => 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 : NumCaseStem -> HarmForms = \c -> case c of { - SgAcc => harm1 "t" ; + SgAccStem => harm1 "" ; _ => endCaseCons c } ; -- Variant of case forms when the noun stem ends in vowel. endCaseVow : NumCaseStem -> HarmForms = \c -> case c of { - SgAcc => harm1 "t" ; + SgAccStem => harm1 "" ; SgSup => harm1 "n" ; SgInsStem => harm1 "v" ; -- Other forms are shared with endCaseCons. diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 0d287629a..6b0693b5e 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -21,7 +21,7 @@ oper param NumCaseStem = - SgNom | SgAcc | SgSup -- These may use 2-3 different stems + SgNom | SgAccStem | SgSup -- These may use 2-3 different stems | PlAcc -- May have irregular vowel in suffix | SgInsStem -- Instrumental and translative: -v after vowels | SgStem -- Rest of the cases in Sg diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 56b4b02e1..ffb147e42 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -18,20 +18,20 @@ oper } ; mkCaseNoun : Str -> Number => Case => Str = \s -> - \\n,c => caseFromStem False c (mkNoun s) n ; + \\n,c => caseFromStem (\a,b -> a+b) (mkNoun s) c n ; mkCaseNoun2 : (n,a : Str) -> Number => Case => Str = \no,ac -> - \\n,c => caseFromStem False c (regNounNomAcc no ac) n ; + \\n,c => caseFromStem (\a,b -> a+b) (regNounNomAcc no ac) c n ; - caseFromStem : Bool -> Case -> Noun -> Number -> Str = \usebind,cas,cn,n -> + caseFromStem : (Str->Str->Str) -> Noun -> Case -> Number -> Str = \bind,cn,cas,n -> case of { => cn.s ! SgNom ; - => cn.s ! SgAcc ; + => bind (cn.s ! SgAccStem) "t" ; => cn.s ! SgSup ; => cn.s ! PlAcc ; => cn.s ! PlStem ; - => glueIf usebind (cn.s ! SgInsStem) (endCase cas ! cn.h) ; - => glueIf usebind (glue (cn.s ! PlStem) "k") (endCase cas ! cn.h) ; - _ => applyOblCase usebind (endCase cas) n cn + => bind (cn.s ! SgInsStem) (endCase cas ! cn.h) ; + => bind (bind (cn.s ! PlStem) "k") (endCase cas ! cn.h) ; + _ => applyOblCase bind (endCase cas) n cn } ; BaseNP : Type = { @@ -162,14 +162,11 @@ oper applyAdp : Adposition -> NounPhrase -> Str = \adp,np -> adp.pr ++ np.s ! adp.c ++ adp.s ; - applyOblCase : Bool -> HarmForms -> Number -> Noun -> Str = - \usebind,adp,n,np -> + applyOblCase : (Str->Str->Str) -> HarmForms -> Number -> Noun -> Str = + \bind,adp,n,np -> let stem : NumCaseStem = case n of { Sg => SgStem ; Pl => PlStem } ; - in glueIf usebind (np.s ! stem) (adp ! np.h) ; - - glueIf : Bool -> (_,_ : Str) -> Str = \f,a,b -> - if_then_Str f (glue a b) (a + b) ; + in bind (np.s ! stem) (adp ! np.h) ; ------------------ -- Conj From 3b18fadfdfd73d66a916ba3622e64311a6e5abf7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 19:10:42 +0200 Subject: [PATCH 23/84] (Hun) Add possessive stems --- src/hungarian/NounMorphoHun.gf | 60 ++++++++++++++++++++++++++++------ src/hungarian/ParamHun.gf | 6 +++- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index c93cfabde..7a566e718 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -17,6 +17,8 @@ oper -- Singular nominative uses the given form, e.g. "alma" or "kefe" SgNom => alma ; + PossdSg_PossrP3 => almá + "j" ; + -- The rest of the forms are formed with the regular constructor, -- using "almá" or "kefé" as the stem. _ => nAlmá.s ! nc } @@ -34,13 +36,22 @@ oper in nLova ** { s = \\nc => case nc of { - -- All plural forms and Sg Acc, Sg Sup use the "lova" stem - PlStem | PlAcc | SgAccStem => nLova.s ! nc ; - SgSup => nLov.s ! nc ; + -- All plural forms and Sg Acc use the "lova" stem + PlStem | PlAcc | SgAccStem + => nLova.s ! nc ; - -- The rest of the forms are formed with the regular constructor, - -- using "ló" as the stem. - _ => nLó.s ! nc } + SgSup | -- Sg Sup has vowel o/ö, not a/e + PossdSg_PossrP3 -- Consonant stem before P3 suffixes + => nLov.s ! nc ; + + PossdSg_PossrPl1 -- Round vowel, part of Pl1 suffix + => lov + harm "u" "ü" ! nLov.h ; + + PossdPl => lova + "i" ; + + -- The rest of the forms are formed with the regular constructor, + -- using "ló" as the stem. + _ => nLó.s ! nc } } ; -- NB. arguments are Sg Nom, Pl Nom @@ -55,8 +66,15 @@ oper -- All plural forms and Sg Acc, Sg Sup use the "falu" stem PlStem | PlAcc => nFalva.s ! nc ; + -- The plural morpheme before possessive suffixes is i + PossdPl => nFalu.s ! nc + "i" ; + + -- The form before P3 possessive suffixes: faluj|a, faluj|uk + -- Forms before other possessive suffixes follow SgAccStem. + PossdSg_PossrP3 => nFalu.s ! nc + "j" ; + -- The rest of the forms are formed with the regular constructor, - -- using "ló" as the stem. + -- using "falu" as the stem. _ => nFalu.s ! nc } } ; @@ -74,9 +92,18 @@ oper nMajom = mkNoun majom ; in nMajmo ** { s = \\nc => case nc of { - -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - PlStem | PlAcc | SgAccStem => nMajmo.s ! nc ; - SgSup => nMajmo.s ! nc ; + + SgSup -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem + | PlAcc + | PlStem + | SgAccStem => nMajmo.s ! nc ; + + -- The plural morpheme before possessive suffixes: majmai + PossdPl => majm + harm "a" "e" ! nMajmo.h + "i" ; + + -- The form before P3 possessive suffixes: majm|a, majm|uk + -- Forms before other possessive suffixes follow SgAccStem. + PossdSg_PossrP3 => majm ; -- The rest of the forms are formed with the regular constructor, -- using "majom" as the stem. @@ -91,11 +118,23 @@ oper let tolla = init tollat ; nTolla = mkNoun tolla ; nToll = mkNoun toll ; + diákj : Str = case tolla of { + x + #v => x ; + x + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny"|"ssz" + |"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") => tolla ; + _ => tolla + "j" } ; in nTolla ** { s = \\nc => case nc of { -- All plural forms and Sg Acc use the "tolla" stem PlStem | PlAcc | SgAccStem => nTolla.s ! nc ; + PossdSg_PossrPl1 => diákj + harm "u" "ü" ! nToll.h ; + + PossdSg_PossrP3 => diákj ; + + -- The plural morpheme before possessive suffixes: madarai + PossdPl => diákj + harm "a" "e" ! nToll.h + "i" ; + -- The rest of the forms are formed with the regular constructor, -- using "toll" as the stem. _ => nToll.s ! nc @@ -305,6 +344,7 @@ oper SgSup => harm3 "on" "en" "ön" ; PlAcc => harm3 "ot" "et" "öt" ; SgAccStem => harm3 "o" "e" "ö" ; + PossdPl => harm1 "i" ; -- TODO figure out allomorphs _ => harm1 [] } ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 6b0693b5e..34c9c7838 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -26,7 +26,11 @@ param | SgInsStem -- Instrumental and translative: -v after vowels | SgStem -- Rest of the cases in Sg | PlStem -- Rest of the cases in Pl - ; + | PossdSg_PossrP3 -- Possessed item is Sg, possessor is Sg or Pl P3 + | PossdSg_PossrPl1 -- Possessed item is Sg, possessor is Pl P1 + | PossdPl -- Possessed item in plural, any possessor. + ; -- Rest of poss forms use SgAccStem + Case = Nom | Acc | Dat From f3fd0853181243118b76712e227c1b408c7711b7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 19:34:26 +0200 Subject: [PATCH 24/84] (Hun) Add possessive suffixes to lincat of Pron --- src/hungarian/ResHun.gf | 10 +++++++++- src/hungarian/StructuralHun.gf | 8 ++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index ffb147e42..fdf538c9a 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -65,9 +65,17 @@ oper -- Pronouns Pronoun : Type = NounPhrase ** { - --poss : Str ; -- for PossPron : Pron -> Quant + poss : HarmForms ; -- for PossPron : Pron -> Quant } ; + possForms : Person*Number => HarmForms = \\agr => case agr of { + => harm1 "m" ; + => harm1 "d" ; + => harm "a" "e" ; + => harm1 "nk" ; -- u/ü/other vowel in stem + => harm "tok" "tök" ; + => harm "uk" "ük" + } ; -------------------------------------------------------------------------------- -- Det, Quant, Card, Ord diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index a4f6aa08d..14275ca9c 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -132,7 +132,7 @@ lin under_Prep = nomAdp "alatt" ; nonExist ; -- Translative agr = ; objdef = Def ; - poss = "em" ; + poss = possForms ! ; } ; youPol_Pron, youSg_Pron = emptyNP ** { @@ -145,7 +145,7 @@ lin under_Prep = nomAdp "alatt" ; nonExist ; -- Translative agr = ; objdef = Def ; - poss = "d" ; + poss = possForms ! ; } ; he_Pron, she_Pron = emptyNP ** { @@ -157,6 +157,7 @@ lin under_Prep = nomAdp "alatt" ; "vele" -- Instrumental nonExist ; -- Translative objdef = Def ; + poss = possForms ! ; } ; we_Pron = emptyNP ** { s = caseTable "mi" "minket" "nekünk" @@ -168,6 +169,7 @@ lin under_Prep = nomAdp "alatt" ; nonExist ; -- Translative agr = ; objdef = Def ; + poss = possForms ! ; } ; youPl_Pron = emptyNP ** { @@ -180,6 +182,7 @@ lin under_Prep = nomAdp "alatt" ; nonExist ; -- Translative agr = ; objdef = Def ; + poss = possForms ! ; } ; they_Pron = emptyNP ** { s = caseTable "ők" "őket" "nekik" @@ -191,6 +194,7 @@ lin under_Prep = nomAdp "alatt" ; nonExist ; -- Translative agr = ; objdef = Def ; + poss = possForms ! ; } ; --lin whatPl_IP = ; From 4dc5b53c3cac81727ca11c7e24019ed8bfa79239 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 19:56:10 +0200 Subject: [PATCH 25/84] (Hun) Add new QuantType param to Quants --- src/hungarian/NounHun.gf | 8 ++++---- src/hungarian/ParamHun.gf | 12 ++++++++++++ src/hungarian/ResHun.gf | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index e2e160169..721e5e332 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -69,11 +69,11 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : Quant -> Num -> Det ; DetQuant quant num = quant ** num ** { - s = \\c => case of { + 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 => case of { + sp = \\c => case of { => [] ; _ => quant.sp ! num.n ! c } ++ num.s ! Indep ; @@ -137,7 +137,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { DefArt = { s, sp = \\_,_ => pre {"a" ; "az" / v } ; - isIndefArt = False ; + qt = Article ; objdef = Def ; caseagr = True ; } ; @@ -146,7 +146,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { IndefArt = { s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ; - isIndefArt = True ; + qt = Article ; objdef = Indef ; caseagr = True ; } ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 34c9c7838..c5e98c336 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -13,7 +13,19 @@ oper -------------------------------------------------------------------------------- -- Morphophonology +-------------------------------------------------------------------------------- +-- Quant +param + QuantType = Possessive | Article ; + +oper + -- standard trick to prevent "a one car" + isIndefArt : {qt : QuantType ; objdef : ObjDef} -> Bool = \quant -> + case of { + => True ; + _ => False + } ; -------------------------------------------------------------------------------- -- Nouns diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index fdf538c9a..57ae10a10 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -89,13 +89,13 @@ oper Quant : Type = BaseQuant ** { s, -- form that comes before noun: "{this} car" sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP) - isIndefArt : Bool ; -- standard trick to prevent "a one car" + qt : QuantType ; } ; mkQuant : (s,sp : Str) -> Quant = \s,sp -> { s = mkCaseNoun s ; sp = mkCaseNoun sp ; - isIndefArt = False ; + qt = Article ; objdef = Def ; caseagr = True ; } ; From 26253d5353dedea5af845dc8bc97cedcdb955ebc Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 20:14:20 +0200 Subject: [PATCH 26/84] (Hun) Restructure caseFromStem and applyCase --- src/hungarian/ResHun.gf | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 57ae10a10..05d72142a 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -23,15 +23,17 @@ oper \\n,c => caseFromStem (\a,b -> a+b) (regNounNomAcc no ac) c n ; caseFromStem : (Str->Str->Str) -> Noun -> Case -> Number -> Str = \bind,cn,cas,n -> + let applyCase' : NumCaseStem -> Str = applyCase bind cas cn in case of { => cn.s ! SgNom ; => bind (cn.s ! SgAccStem) "t" ; => cn.s ! SgSup ; => cn.s ! PlAcc ; => cn.s ! PlStem ; - => bind (cn.s ! SgInsStem) (endCase cas ! cn.h) ; + => applyCase' SgInsStem ; => bind (bind (cn.s ! PlStem) "k") (endCase cas ! cn.h) ; - _ => applyOblCase bind (endCase cas) n cn + => applyCase' SgStem ; + => applyCase' PlStem } ; BaseNP : Type = { @@ -170,11 +172,8 @@ oper applyAdp : Adposition -> NounPhrase -> Str = \adp,np -> adp.pr ++ np.s ! adp.c ++ adp.s ; - applyOblCase : (Str->Str->Str) -> HarmForms -> Number -> Noun -> Str = - \bind,adp,n,np -> - let stem : NumCaseStem = case n of { - Sg => SgStem ; Pl => PlStem } ; - in bind (np.s ! stem) (adp ! np.h) ; + applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = + \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; ------------------ -- Conj From fc699d231f927f4858cbb841d3952396afc71956 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 21:12:37 +0200 Subject: [PATCH 27/84] (Hun) Add possessive suffixes to nouns in DetCN --- src/hungarian/NounHun.gf | 26 ++++++++++++++++---------- src/hungarian/ParamHun.gf | 23 ++++++++++++++++++++--- src/hungarian/ResHun.gf | 28 ++++++++++++++++++++++++---- 3 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 721e5e332..11790168e 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -8,10 +8,14 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : Det -> CN -> NP DetCN det cn = emptyNP ** det ** { - s = \\c => case det.caseagr of { + s = \\c => + let foo : Str = case det.dt of { + NoPoss => caseFromStem glue cn c det.n ; + DetPoss _ => caseFromPossStem cn det c } ; + in case det.caseagr of { True => det.s ! c ; False => det.s ! Nom - } ++ caseFromStem glue cn c det.n + } ++ foo ++ cn.compl ! det.n ! c ; agr = ; } ; @@ -77,6 +81,8 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { => [] ; _ => quant.sp ! num.n ! c } ++ num.s ! Indep ; + dt = case quant.qt of { QuantPoss stem => DetPoss stem ; + _ => NoPoss } ; } ; -- : Quant -> Num -> Ord -> Det ; -- these five best @@ -134,28 +140,28 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- OrdNumeralSuperl num a = num ** { } ; -- : Quant - DefArt = { + DefArt = mkQuant "a" "a" ** { s, sp = \\_,_ => pre {"a" ; "az" / v } ; qt = Article ; objdef = Def ; - caseagr = True ; } ; -- : Quant - IndefArt = { + IndefArt = mkQuant "egy" [] ** { s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ; qt = Article ; objdef = Indef ; - caseagr = True ; } ; -- : Pron -> Quant - -- PossPron pron = - -- let p = pron.poss ; - -- in DefArt ** { - -- } ; + PossPron pron = pron ** { + s,sp = \\_ => pron.s ; + qt = QuantPoss (agr2PossStem pron.agr) ; + objdef = Def ; + caseagr = False ; + } ; --2 Common nouns diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index c5e98c336..f20616229 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -17,7 +17,19 @@ oper -- Quant param - QuantType = Possessive | Article ; + QuantType = + Article -- Needed to prevent "a 2 cars" + | Other -- Not poss, not article + | QuantPoss PossStem -- Which possessive stem it takes + ; + + DetType = + NoPoss -- distinction between Article and Other no longer needed + | DetPoss PossStem -- Sill need to know which stem it takes if Poss + ; + + -- Singular stems. Plural is always same, no need to add here. + PossStem = dSg_rSg1P2 | dSg_rP3 | dSg_rPl1 ; oper -- standard trick to prevent "a one car" @@ -27,6 +39,13 @@ oper _ => False } ; + agr2PossStem : Person*Number -> PossStem = \pn -> + case of { + => dSg_rPl1 ; + => dSg_rP3 ; + _ => dSg_rSg1P2 + } ; + -------------------------------------------------------------------------------- -- Nouns @@ -56,8 +75,6 @@ param SubjCase = SCNom | SCDat ; -- Limited set of subject cases - Possessor = NoPoss | Poss Number Person ; - oper caseTable : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Case=>Str = diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 05d72142a..009f379b4 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -29,13 +29,24 @@ oper => bind (cn.s ! SgAccStem) "t" ; => cn.s ! SgSup ; => cn.s ! PlAcc ; - => cn.s ! PlStem ; + => cn.s ! PlStem ; -- don't use applyCase', it adds a BIND which breaks everything! => applyCase' SgInsStem ; => bind (bind (cn.s ! PlStem) "k") (endCase cas ! cn.h) ; => applyCase' SgStem ; => applyCase' PlStem } ; + caseFromPossStem : Noun -> Determiner -> Case -> Str = \cn,det,cas -> + let stem : NumCaseStem = case of { + => case st of { + dSg_rSg1P2 => SgAccStem ; + dSg_rP3 => PossdSg_PossrP3 ; + dSg_rPl1 => PossdSg_PossrPl1 } ; + => PossdPl ; + _ => Predef.error "caseFromPossStem: Trying to apply to non-possessive Det" + } ; + in applyCaseSuf (det.poss ! cn.h) cas cn stem ; + BaseNP : Type = { agr : Person*Number ; objdef : ObjDef ; @@ -82,6 +93,7 @@ oper -- Det, Quant, Card, Ord BaseQuant : Type = { + poss : HarmForms ; -- Quants made by PossPron need this, empty for others objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object caseagr : Bool ; -- If it agrees in case: "azoknak a nőknek" vs. "sok nőknek" } ; @@ -97,9 +109,10 @@ oper mkQuant : (s,sp : Str) -> Quant = \s,sp -> { s = mkCaseNoun s ; sp = mkCaseNoun sp ; - qt = Article ; + qt = Other ; objdef = Def ; caseagr = True ; + poss = harm1 [] ; } ; -- Det is formed in DetQuant : Quant -> Num -> Det @@ -108,7 +121,8 @@ oper s, sp : Case => Str ; n : Number ; - numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl +-- numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl + dt : DetType ; } ; mkDet : (s : Str) -> ObjDef -> Number -> Bool -> Determiner = \s,d,n,ca -> { @@ -118,6 +132,8 @@ oper numtype = NoNum ; objdef = d ; caseagr = ca ; + dt = NoPoss ; + poss = harm1 [] ; } ; mkDet2 : (n,a : Str) -> ObjDef -> Number -> Bool -> Determiner = \no,ac,d,n,ca -> @@ -173,7 +189,11 @@ oper adp.pr ++ np.s ! adp.c ++ adp.s ; applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = - \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; + \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; + + applyCaseSuf : Str -> Case -> Noun -> NumCaseStem -> Str = + \suf,cas,cn,stem -> glue (glue (cn.s ! stem) suf) (endCase cas ! cn.h) ; + ------------------ -- Conj From 207787a76cfeb1f86c8f0d82e914d13167f2bea7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 24 Apr 2020 06:48:28 +0200 Subject: [PATCH 28/84] (Hun) Fix case forms after P3 Sg possessive suffix --- src/hungarian/NounMorphoHun.gf | 11 ++++++++++- src/hungarian/ResHun.gf | 22 ++++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 7a566e718..4dd658241 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -429,7 +429,8 @@ oper } ; --- This is used in ResHun.caseFromStem, not here. +-- This is used in ResHun.caseFromStem, which makes NP out of CN. +-- Ns only have stems, and these forms are attached to the stems. endCase : Case -> HarmForms = \c -> case c of { Nom => harm1 [] ; @@ -453,4 +454,12 @@ oper -- Tem => harm1 "kor" -- Temporal 'at '. Only used with numerals. } ; + endCasePossVow : Case -> HarmForms = \c -> case c of { + Acc => harm1 "t" ; + Sup => harm1 "n" ; + Tra => harm "vá" "vé" ; + Ins => harm "val" "vel" ; + _ => endCase c + } ; + } diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 009f379b4..9f9de7a7e 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -37,15 +37,16 @@ oper } ; caseFromPossStem : Noun -> Determiner -> Case -> Str = \cn,det,cas -> - let stem : NumCaseStem = case of { + let stem_casetable : NumCaseStem*(Case->HarmForms) = case of { => case st of { - dSg_rSg1P2 => SgAccStem ; - dSg_rP3 => PossdSg_PossrP3 ; - dSg_rPl1 => PossdSg_PossrPl1 } ; - => PossdPl ; - _ => Predef.error "caseFromPossStem: Trying to apply to non-possessive Det" - } ; - in applyCaseSuf (det.poss ! cn.h) cas cn stem ; + dSg_rSg1P2 => ; + dSg_rP3 => ; -- TODO nneeds to be vowel only after Sg3 + dSg_rPl1 => } ; + => ; + _ => Predef.error "caseFromPossStem: Trying to apply to non-possessive Det" } ; + stem = stem_casetable.p1 ; + casetable = stem_casetable.p2 ; + in applyCaseSuf (det.poss ! cn.h) cas cn stem casetable ; BaseNP : Type = { agr : Person*Number ; @@ -191,8 +192,9 @@ oper applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; - applyCaseSuf : Str -> Case -> Noun -> NumCaseStem -> Str = - \suf,cas,cn,stem -> glue (glue (cn.s ! stem) suf) (endCase cas ! cn.h) ; + applyCaseSuf : Str -> Case -> Noun -> NumCaseStem -> (Case -> HarmForms) -> Str = + \suf,cas,cn,stem,casetable -> + glue (glue (cn.s ! stem) suf) (casetable cas ! cn.h) ; ------------------ From b1e25c2167cfb3958fe2eed7923d301d14ccbc93 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 24 Apr 2020 07:02:23 +0200 Subject: [PATCH 29/84] (Hun) Fix allomorph of Pl P3 possessor with Pl noun --- src/hungarian/ParamHun.gf | 4 ++-- src/hungarian/ResHun.gf | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index f20616229..af7d8d234 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -29,7 +29,7 @@ param ; -- Singular stems. Plural is always same, no need to add here. - PossStem = dSg_rSg1P2 | dSg_rP3 | dSg_rPl1 ; + PossStem = dSg_rSg1P2 | dSg_rP3 Number | dSg_rPl1 ; oper -- standard trick to prevent "a one car" @@ -42,7 +42,7 @@ oper agr2PossStem : Person*Number -> PossStem = \pn -> case of { => dSg_rPl1 ; - => dSg_rP3 ; + => dSg_rP3 n ; _ => dSg_rSg1P2 } ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 9f9de7a7e..a48b990e1 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -40,13 +40,17 @@ oper let stem_casetable : NumCaseStem*(Case->HarmForms) = case of { => case st of { dSg_rSg1P2 => ; - dSg_rP3 => ; -- TODO nneeds to be vowel only after Sg3 + dSg_rP3 Sg => ; + dSg_rP3 Pl => ; dSg_rPl1 => } ; => ; _ => Predef.error "caseFromPossStem: Trying to apply to non-possessive Det" } ; stem = stem_casetable.p1 ; casetable = stem_casetable.p2 ; - in applyCaseSuf (det.poss ! cn.h) cas cn stem casetable ; + suf = case of { + => "k" ; + _ => det.poss ! cn.h } ; + in applyCaseSuf suf cas cn stem casetable ; BaseNP : Type = { agr : Person*Number ; From 0442c0d7a7435c607a5743c25251346ab91b9e33 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 24 Apr 2020 07:23:31 +0200 Subject: [PATCH 30/84] (Hun) Add a separate table of possessive stems in CNs and NPs --- src/hungarian/NounHun.gf | 5 +++++ src/hungarian/ParamHun.gf | 1 + src/hungarian/ResHun.gf | 9 +++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 11790168e..6c3ec0d33 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -169,6 +169,11 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : N2 -> CN ; UseN,UseN2 = \n -> n ** { compl = \\_,_ => [] ; + pstems = table { + PossSg (dSg_rP3 _) => n.s ! PossdSg_PossrP3 ; + PossSg dSg_rPl1 => n.s ! PossdSg_PossrPl1 ; + PossSg dSg_rSg1P2 => n.s ! SgAccStem ; + PossPl => n.s ! PossdPl } ; } ; -- : N2 -> NP -> CN ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index af7d8d234..dbcf51f8d 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -75,6 +75,7 @@ param SubjCase = SCNom | SCDat ; -- Limited set of subject cases + CNPossStem = PossPl | PossSg PossStem ; oper caseTable : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Case=>Str = diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index a48b990e1..0c1a14c68 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -15,6 +15,7 @@ resource ResHun = NounMorphoHun ** open Prelude, Predef in { oper CNoun : Type = Noun ** { compl : Number => Case => Str ; + pstems : CNPossStem => Str ; } ; mkCaseNoun : Str -> Number => Case => Str = \s -> @@ -50,12 +51,15 @@ oper suf = case of { => "k" ; _ => det.poss ! cn.h } ; - in applyCaseSuf suf cas cn stem casetable ; - + in case cas of { + Nom => glue (cn.s ! stem) suf ; -- don't use applyCaseSuf, it adds BIND + _ => applyCaseSuf suf cas cn stem casetable + } ; BaseNP : Type = { agr : Person*Number ; objdef : ObjDef ; empty : Str ; -- standard trick for pro-drop + pstems : CNPossStem => Str ; -- Verbs might need to add poss. suffixes } ; NounPhrase : Type = BaseNP ** { @@ -68,6 +72,7 @@ oper objdef = Indef ; empty = [] ; h = H_e ; + pstems = \\_ => [] ; } ; indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ; From efcfb3cefa7ca962564ed413bb14ac1712256d8e Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 24 Apr 2020 07:39:21 +0200 Subject: [PATCH 31/84] (Hun) Use the separate pstems in caseFromPossStem --- src/hungarian/NounHun.gf | 1 + src/hungarian/ResHun.gf | 37 +++++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 6c3ec0d33..6682c325c 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -192,6 +192,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : AP -> CN -> CN AdjCN ap cn = cn ** { s = \\nc => ap.s ! Sg ++ cn.s ! nc ; + pstems = \\cs => ap.s ! Sg ++ cn.pstems ! cs ; compl = \\n,c => ap.compar ++ cn.compl ! n ! c ; } ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 0c1a14c68..0863b8fa4 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -37,22 +37,27 @@ oper => applyCase' PlStem } ; - caseFromPossStem : Noun -> Determiner -> Case -> Str = \cn,det,cas -> - let stem_casetable : NumCaseStem*(Case->HarmForms) = case of { - => case st of { - dSg_rSg1P2 => ; - dSg_rP3 Sg => ; - dSg_rP3 Pl => ; - dSg_rPl1 => } ; - => ; - _ => Predef.error "caseFromPossStem: Trying to apply to non-possessive Det" } ; - stem = stem_casetable.p1 ; - casetable = stem_casetable.p2 ; + caseFromPossStem : CNoun -> Determiner -> Case -> Str = \cn,det,cas -> + let casetable : Case->HarmForms = case of { + -- P3 Sg possessive suffix ends in vowel, others in consonant. + => endCasePossVow ; + _ => endCase + } ; + stem : CNPossStem = case det.n of { + Sg => PossSg + (case det.dt of { + DetPoss x => x ; + _ => Predef.error "caseFromPossStem: Not possessive Det"}) ; + Pl => PossPl + } ; + + -- possessive suffix e.g. "their cats-3pl" is just k. not uk/ük suf = case of { - => "k" ; - _ => det.poss ! cn.h } ; + => "k" ; + _ => det.poss ! cn.h + } ; in case cas of { - Nom => glue (cn.s ! stem) suf ; -- don't use applyCaseSuf, it adds BIND + Nom => glue (cn.pstems ! stem) suf ; -- don't use applyCaseSuf, it adds BIND _ => applyCaseSuf suf cas cn stem casetable } ; BaseNP : Type = { @@ -201,9 +206,9 @@ oper applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; - applyCaseSuf : Str -> Case -> Noun -> NumCaseStem -> (Case -> HarmForms) -> Str = + applyCaseSuf : Str -> Case -> CNoun -> CNPossStem -> (Case -> HarmForms) -> Str = \suf,cas,cn,stem,casetable -> - glue (glue (cn.s ! stem) suf) (casetable cas ! cn.h) ; + glue (glue (cn.pstems ! stem) suf) (casetable cas ! cn.h) ; ------------------ From 14bed283f4c5947908b24a1c12a179ac5f041525 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 24 Apr 2020 08:18:53 +0200 Subject: [PATCH 32/84] (Hun) WIP: have_V2 adds possessive suffixes to its object NP --- src/hungarian/NounHun.gf | 2 +- src/hungarian/PhraseHun.gf | 2 +- src/hungarian/ResHun.gf | 115 ++++++++++++++++++++++++++++----- src/hungarian/SentenceHun.gf | 2 +- src/hungarian/StructuralHun.gf | 78 ++-------------------- src/hungarian/VerbHun.gf | 25 ++++++- 6 files changed, 131 insertions(+), 93 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 6682c325c..ac4e7fcd7 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -7,7 +7,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { --2 Noun phrases -- : Det -> CN -> NP - DetCN det cn = emptyNP ** det ** { + DetCN det cn = emptyNP ** cn ** det ** { s = \\c => let foo : Str = case det.dt of { NoPoss => caseFromStem glue cn c det.n ; diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 46ed5ad22..9cc252f2d 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -13,7 +13,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { -} UttIP, UttNP = \np -> {s = np.s ! Nom} ; - UttVP vp = {s = vp.obj ++ vp.adv ++ vp.s ! VInf} ; + UttVP vp = {s = vp.obj ! ++ vp.adv ++ vp.s ! VInf} ; UttAdv adv = adv ; UttCN cn = {s = linCN cn} ; UttCard n = {s = n.s ! Indep} ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 0863b8fa4..637218216 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -18,6 +18,12 @@ oper pstems : CNPossStem => Str ; } ; + -- Used to possess NPs even after they become NPs + CNLite : Type = { + h : Harm ; + pstems : CNPossStem => Str + } ; + mkCaseNoun : Str -> Number => Case => Str = \s -> \\n,c => caseFromStem (\a,b -> a+b) (mkNoun s) c n ; mkCaseNoun2 : (n,a : Str) -> Number => Case => Str = \no,ac -> @@ -37,7 +43,7 @@ oper => applyCase' PlStem } ; - caseFromPossStem : CNoun -> Determiner -> Case -> Str = \cn,det,cas -> + caseFromPossStem : CNLite -> Determiner -> Case -> Str = \cn,det,cas -> let casetable : Case->HarmForms = case of { -- P3 Sg possessive suffix ends in vowel, others in consonant. => endCasePossVow ; @@ -65,6 +71,7 @@ oper objdef : ObjDef ; empty : Str ; -- standard trick for pro-drop pstems : CNPossStem => Str ; -- Verbs might need to add poss. suffixes + h : Harm ; -- NP may need to be possessed again because of have_V2 } ; NounPhrase : Type = BaseNP ** { @@ -104,6 +111,74 @@ oper => harm "tok" "tök" ; => harm "uk" "ük" } ; + + pronTable : Person*Number => Pronoun = \\agr => case agr of { + => emptyNP ** { + s = caseTable "én" "engem" "nekem" + "belém" "bennem" "belőlem" -- inner locatives + "hozzám" "nálam" "tőlem" -- outer locatives + "rám" "rajtam" "rólam" -- outer locatives + "értem" -- Causative + "velem" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "te" "teged" "neked" + "beléd" "benned" "belőled" + "hozzád" "nálad" "tőled" + "rád" "rajtad" "rólad" + "érted" -- Causative + "veled" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "ő" "őt" "neki" + "belé" "benne" "belőle" + "hozzá" "nála" "tőle" + "rá" "rajta" "róla" + "érte" -- Causative + "vele" -- Instrumental + nonExist ; -- Translative + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "mi" "minket" "nekünk" + "belénk" "bennünk" "belőlünk" + "hozzánk" "nálunk" "tőlünk" + "ránk" "rajtunk" "rólunk" + "értünk" -- Causative + "velünk" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "ti" "titeket" "nektek" + "belétek" "bennetek" "belőletek" + "hozzátok" "nálatok" "tőletek" + "rátok" "rajtatok" "rólatok" + "értetek" -- Causative + "veletek" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } ; + => emptyNP ** { + s = caseTable "ők" "őket" "nekik" + "beléjük" "bennük" "belőlük" + "hozzájuk" "náluk" "tőlük" + "rájuk" "rajtuk" "róluk" + "értük" -- Causative + "velük" -- Instrumental + nonExist ; -- Translative + agr = agr ; + objdef = Def ; + poss = possForms ! agr } + } ; -------------------------------------------------------------------------------- -- Det, Quant, Card, Ord @@ -157,8 +232,6 @@ oper s,sp = mkCaseNoun2 no ac ! n ; } ; - - Numeral : Type = { s : Place => Str ; -- Independent or attribute numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages @@ -206,7 +279,7 @@ oper applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; - applyCaseSuf : Str -> Case -> CNoun -> CNPossStem -> (Case -> HarmForms) -> Str = + applyCaseSuf : Str -> Case -> CNLite -> CNPossStem -> (Case -> HarmForms) -> Str = \suf,cas,cn,stem,casetable -> glue (glue (cn.pstems ! stem) suf) (casetable cas ! cn.h) ; @@ -382,7 +455,7 @@ oper -- VP VerbPhrase : Type = Verb ** { - obj : Str ; + obj : Person*Number => Str ; adv : Str ; c2 : Case ; -- for RelSlash } ; -- TODO more fields @@ -392,7 +465,8 @@ oper } ; useV : Verb -> VerbPhrase = \v -> v ** { - obj,adv = [] ; + obj = \\_ => [] ; + adv = [] ; c2 = Acc ; -- TODO check } ; @@ -400,14 +474,23 @@ oper adv = [] ; } ; - insertObj : VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { - obj = np.s ! vps.c2 ; - - -- If verb's subject case is Dat and object Nom, verb agrees with obj. - s = \\vf => case of { - => vps.s ! np.objdef ! agr2vf np.agr ; - _ => vps.s ! np.objdef ! vf } ; - } ; + -- 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 => + -- let pron : Pronoun = case vf of { + -- VPres p n => pronTable ! ; + -- _ => pronTable ! } ; + -- num : Num = case np.a.p2 of { + -- Sg => NumSg ; Pl => NumPl } ; + -- det : Determiner = DetQuant (PossPron pron) num ; + -- + -- } + -- in 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} ; @@ -436,7 +519,7 @@ oper in np.s ! subjcase ++ if_then_Pol p [] "nem" ++ vp.s ! agr2vf np.agr - ++ vp.obj + ++ vp.obj ! np.agr ++ vp.adv ++ np.empty -- standard trick for prodrop+metavariable problem } ; @@ -458,7 +541,7 @@ oper SCDat => Dat } in rp.s ! n ! subjcase ++ if_then_Pol p [] "nem" - ++ vp.obj + ++ vp.obj ! ++ vp.adv ++ vp.s ! VPres rp.agr.p1 n -- variable by number } ; diff --git a/src/hungarian/SentenceHun.gf b/src/hungarian/SentenceHun.gf index 82f884ca0..e402dc22c 100644 --- a/src/hungarian/SentenceHun.gf +++ b/src/hungarian/SentenceHun.gf @@ -15,7 +15,7 @@ lin --2 Clauses missing object noun phrases -- : NP -> VPSlash -> ClSlash ; - SlashVP np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = []}) ; + SlashVP np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = \\_ => []}) ; {- -- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today AdvSlash cls adv = cls ** insertAdv adv cls ; diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 14275ca9c..f980a7310 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -122,80 +122,14 @@ lin under_Prep = nomAdp "alatt" ; -- Pronouns are closed class, no constructor in ParadigmsHun. -- it_Pron = - i_Pron = emptyNP ** { - s = caseTable "én" "engem" "nekem" - "belém" "bennem" "belőlem" -- inner locatives - "hozzám" "nálam" "tőlem" -- outer locatives - "rám" "rajtam" "rólam" -- outer locatives - "értem" -- Causative - "velem" -- Instrumental - nonExist ; -- Translative - agr = ; - objdef = Def ; - poss = possForms ! ; - } ; + i_Pron = pronTable ! ; youPol_Pron, - youSg_Pron = emptyNP ** { - s = caseTable "te" "teged" "neked" - "beléd" "benned" "belőled" - "hozzád" "nálad" "tőled" - "rád" "rajtad" "rólad" - "érted" -- Causative - "veled" -- Instrumental - nonExist ; -- Translative - agr = ; - objdef = Def ; - poss = possForms ! ; - } ; + youSg_Pron = pronTable ! ; he_Pron, - she_Pron = emptyNP ** { - s = caseTable "ő" "őt" "neki" - "belé" "benne" "belőle" - "hozzá" "nála" "tőle" - "rá" "rajta" "róla" - "érte" -- Causative - "vele" -- Instrumental - nonExist ; -- Translative - objdef = Def ; - poss = possForms ! ; - } ; - 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 ; - poss = possForms ! ; - } ; - - 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 ; - poss = possForms ! ; - } ; - 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 ; - poss = possForms ! ; - } ; + she_Pron = pronTable ! ; + we_Pron = pronTable ! ; + youPl_Pron = pronTable ! ; + they_Pron = pronTable ! ; --lin whatPl_IP = ; --lin whatSg_IP = : diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 705805e2a..433864de7 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -1,4 +1,5 @@ -concrete VerbHun of Verb = CatHun ** open ResHun, AdverbHun, Prelude in { +concrete VerbHun of Verb = CatHun ** + open ResHun, AdverbHun, NounHun, Prelude in { lin @@ -63,7 +64,7 @@ lin } ; -} -- : VPSlash -> NP -> VP - ComplSlash = ResHun.insertObj ; + ComplSlash = insertObj ; {- -- : VV -> VPSlash -> VPSlash ; -- Just like ComplVV except missing subject! @@ -145,4 +146,24 @@ lin -- : VP -- Copula alone; UseCopula = useV copula ; +oper +insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { + obj = \\agr => + -- have_V2 needs to put object in poss. form + let pron : Pronoun = pronTable ! agr ; + num : CatHun.Num = case np.agr.p2 of { + Sg => NumSg ; Pl => NumPl } ; + det : Determiner = DetQuant (PossPron pron) num ; + possessedNP : Str = caseFromPossStem np det vps.c2 ; + in case of { + => possessedNP ; -- TODO loses stuff from np.s + _ => np.s ! vps.c2 } ; + + s = \\vf => + -- If verb's subject case is Dat and object Nom, verb agrees with obj. + case of { + => vps.s ! np.objdef ! agr2vf np.agr; + _ => vps.s ! np.objdef ! vf } ; + } ; + } From 8ea95d86249619a8f8fd39652b95dda8a31d6b24 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 24 Apr 2020 11:30:52 +0200 Subject: [PATCH 33/84] (Hun) Fix bug in plural nouns possessed by P3 Sg possessor --- src/hungarian/ResHun.gf | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 637218216..57b6792c5 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -44,28 +44,31 @@ oper } ; caseFromPossStem : CNLite -> Determiner -> Case -> Str = \cn,det,cas -> - let casetable : Case->HarmForms = case of { + let st : PossStem = case det.dt of { + DetPoss x => x ; + _ => Predef.error "caseFromPossStem: Not possessive Det" } ; + casetable : Case->HarmForms = case of { -- P3 Sg possessive suffix ends in vowel, others in consonant. => endCasePossVow ; - _ => endCase - } ; + _ => endCase } ; stem : CNPossStem = case det.n of { - Sg => PossSg - (case det.dt of { - DetPoss x => x ; - _ => Predef.error "caseFromPossStem: Not possessive Det"}) ; - Pl => PossPl - } ; + Sg => PossSg st ; + Pl => PossPl } ; -- possessive suffix e.g. "their cats-3pl" is just k. not uk/ük - suf = case of { - => "k" ; - _ => det.poss ! cn.h + suf = case of { + => "k" ; + _ => det.poss ! cn.h } ; - in case cas of { - Nom => glue (cn.pstems ! stem) suf ; -- don't use applyCaseSuf, it adds BIND + in case of { + -- don't use applyCaseSuf, it adds BIND + => cn.pstems ! PossPl ; + => glue (cn.pstems ! stem) suf ; + + -- Other forms have non-empty poss. suffix and case ending _ => applyCaseSuf suf cas cn stem casetable } ; + BaseNP : Type = { agr : Person*Number ; objdef : ObjDef ; From 6ab883705b4648377e8cd1d9ceb68293c8a8e22d Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Fri, 24 Apr 2020 13:45:16 +0200 Subject: [PATCH 34/84] comment --- src/hungarian/ResHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 57b6792c5..42e3fc971 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -109,7 +109,7 @@ oper possForms : Person*Number => HarmForms = \\agr => case agr of { => harm1 "m" ; => harm1 "d" ; - => harm "a" "e" ; + => harm "a" "e" ; --TODO: wovel cases with "ja"? See verb forms below => harm1 "nk" ; -- u/ü/other vowel in stem => harm "tok" "tök" ; => harm "uk" "ük" From 346360d54aa65cfb4ee88af3239dbcbc88bb5178 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 24 Apr 2020 16:51:27 +0200 Subject: [PATCH 35/84] (Hun) Pl nouns wit P3 Sg possessor: fix also in other cases than Nom --- src/hungarian/ResHun.gf | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 42e3fc971..ad33f3233 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -58,6 +58,7 @@ oper -- possessive suffix e.g. "their cats-3pl" is just k. not uk/ük suf = case of { => "k" ; + => "" ; _ => det.poss ! cn.h } ; in case of { From f24d9c2cad0a438d2b7b8cab407e1a210400815f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 24 Apr 2020 17:00:44 +0200 Subject: [PATCH 36/84] (Hun) Add possibility to prepose Advs --- src/hungarian/AdverbHun.gf | 3 ++- src/hungarian/CatHun.gf | 4 +++- src/hungarian/ConjunctionHun.gf | 16 ++++++++++++---- src/hungarian/GrammarHun.gf | 4 ++-- src/hungarian/NounHun.gf | 18 +++++++++++++----- src/hungarian/ParadigmsHun.gf | 2 +- src/hungarian/ResHun.gf | 2 ++ src/hungarian/SymbolHun.gf | 6 +++--- 8 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/hungarian/AdverbHun.gf b/src/hungarian/AdverbHun.gf index c7cbde60a..d4643818a 100644 --- a/src/hungarian/AdverbHun.gf +++ b/src/hungarian/AdverbHun.gf @@ -12,7 +12,8 @@ lin -- : Prep -> NP -> Adv ; PrepNP prep np = { - s = applyAdp prep np + s = applyAdp prep np ; + isPre = False ; } ; -- Adverbs can be modified by 'adadjectives', just like adjectives. diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index f900b586d..956554909 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -1,4 +1,4 @@ -concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { +concrete CatHun of Cat = CommonX - [Adv] ** open ResHun, Prelude in { flags optimize=all_subs ; @@ -118,6 +118,8 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { N3 = ResHun.Noun ; PN = ResHun.NounPhrase ; + Adv = {s : Str ; isPre : Bool} ; + linref CN = linCN ; diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index f233d22c7..e0d596c2d 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -3,12 +3,20 @@ concrete ConjunctionHun of Conjunction = -- Adverb and other simple {s : Str} types. lincat - [Adv],[AdV],[IAdv],[S] = {s1,s2 : Str} ; + [AdV],[IAdv],[S] = {s1,s2 : Str} ; lin - BaseAdv, BaseAdV, BaseIAdv, BaseS = twoSS ; - ConsAdv, ConsAdV, ConsIAdv, ConsS = consrSS comma ; - ConjAdv, ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ; + BaseAdV, BaseIAdv, BaseS = twoSS ; + ConsAdV, ConsIAdv, ConsS = consrSS comma ; + ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ; + +lincat + [Adv] = {s1,s2 : Str ; isPre : Bool} ; + +lin + BaseAdv x y = y ** twoSS x y ; + ConsAdv x xs = xs ** consrSS comma x xs ; + ConjAdv co xs = xs ** conjunctDistrSS co xs ; -- Adjectival phrases lincat diff --git a/src/hungarian/GrammarHun.gf b/src/hungarian/GrammarHun.gf index 325a57e95..5122cfb85 100644 --- a/src/hungarian/GrammarHun.gf +++ b/src/hungarian/GrammarHun.gf @@ -9,10 +9,10 @@ concrete GrammarHun of Grammar = RelativeHun, ConjunctionHun, PhraseHun, - TextX, + TextX - [Adv], StructuralHun, IdiomHun, - TenseX + TenseX - [Adv] ** { flags startcat = Phr ; unlexer = text ; lexer = text ; diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index ac4e7fcd7..f870e38a3 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -1,4 +1,5 @@ -concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { +concrete NounHun of Noun = CatHun ** open + ResHun, Prelude, Coordination in { flags optimize=all_subs ; @@ -40,7 +41,13 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { -- : NP -> Adv -> NP ; -- Paris today AdvNP np adv = np ** { - s = \\c => np.s ! c ++ adv.s ; + s = \\c => case adv.isPre of { + True => adv.s ++ np.s ! c ; + False => np.s ! c ++ adv.s } ; + -- compl = \\nc => case adv.isPre of { + -- True => np.compl ! nc ; + -- False => np.compl ! nc ++ adv.s } ; + } ; -- : NP -> Adv -> NP ; -- boys, such as .. ExtAdvNP np adv = np ** { @@ -202,9 +209,10 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in { } ; -- : CN -> Adv -> CN ; - AdvCN cn adv = cn ** { - compl = \\n,c => cn.compl ! n ! c ++ adv.s - } ; + AdvCN cn adv = case adv.isPre of { + True => AdjCN (invarAP adv.s) cn ; + False => cn ** {compl = \\n,c => cn.compl ! n ! c ++ adv.s} + } ; -- Nouns can also be modified by embedded sentences and questions. -- For some nouns this makes little sense, but we leave this for applications diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 6a6ccd161..fc07c8c2d 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -101,7 +101,7 @@ oper -- lin Subj { } ; mkAdv : Str -> Adv - = \s -> lin Adv {s = s} ; + = \s -> lin Adv {s = s ; isPre=False} ; mkAdV : Str -> AdV = \s -> lin AdV {s = s} ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index ad33f3233..c984740cd 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -336,6 +336,8 @@ oper in adj + plural } ; + invarAP : Str -> AdjPhrase = \s -> emptyAP ** {s = \\_ => s} ; + -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives comparAdj : Str -> Str = \stem -> case stem of { diff --git a/src/hungarian/SymbolHun.gf b/src/hungarian/SymbolHun.gf index 47f7c990a..2d0b3909d 100644 --- a/src/hungarian/SymbolHun.gf +++ b/src/hungarian/SymbolHun.gf @@ -24,16 +24,16 @@ oper lin -- : CN -> Int -> NP CNIntNP cn i = NH.MassNP (cn ** { - s = \\n,c => cn.s ! n ! c ++ i.s}) ; + compl = \\n,c => cn.compl ! n ! c ++ i.s}) ; -- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y CNSymbNP det cn xs = - let cnSymb : CN = cn ** {s = \\n,c => cn.s ! n ! c ++ xs.s} + let cnSymb : CN = cn ** {compl = \\n,c => cn.compl ! n ! c ++ xs.s} in NH.DetCN det cnSymb ; -- : CN -> Card -> NP ; -- level five ; level 5 CNNumNP cn i = NH.MassNP (cn ** { - s = \\n,c => cn.s ! n ! c ++ i.s ! Indep}) ; + compl = \\n,c => cn.compl ! n ! c ++ i.s ! Indep}) ; -- : Symb -> S ; SymbS sy = sy ; From 234f74b6b0faff73fa851f1eecb149fb2878bd8b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 25 Apr 2020 14:02:35 +0200 Subject: [PATCH 37/84] (Hun) Remove unused code --- src/hungarian/ResHun.gf | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index c984740cd..d0207fcfa 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -480,24 +480,6 @@ oper adv = [] ; } ; - -- insertObj : VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { - -- obj = np.s ! vps.c2 ; - -- - -- -- If verb's subject case is Dat and object Nom, verb agrees with obj. - -- s = \\vf => - -- let pron : Pronoun = case vf of { - -- VPres p n => pronTable ! ; - -- _ => pronTable ! } ; - -- num : Num = case np.a.p2 of { - -- Sg => NumSg ; Pl => NumPl } ; - -- det : Determiner = DetQuant (PossPron pron) num ; - -- - -- } - -- in 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} ; @@ -535,10 +517,6 @@ oper RP : Type = {s : Number => Case => Str} ; RClause : Type = {s : Tense => Anteriority => Polarity => Number => Case => Str} ; - np2rp : NounPhrase -> RP ** {agr : Person*Number} = \np -> np ** { - s = \\n => np.s ; - } ; - relVP : RP -> VerbPhrase -> RClause = \rp -> relVP' (rp ** {agr=}) ; relVP' : RP ** {agr : Person*Number} -> VerbPhrase -> RClause = \rp,vp -> { From 44603f7db74776c9cab871984bb54f858e7dab39 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 25 Apr 2020 14:03:10 +0200 Subject: [PATCH 38/84] (Hun) Add proper inflection tables in NP, stems only up to CN --- src/hungarian/AdjectiveHun.gf | 4 +-- src/hungarian/ConjunctionHun.gf | 8 ++--- src/hungarian/NounHun.gf | 59 +++++++++++++++++++-------------- src/hungarian/ParamHun.gf | 3 ++ src/hungarian/PhraseHun.gf | 2 +- src/hungarian/ResHun.gf | 15 +++++---- src/hungarian/VerbHun.gf | 17 ++++------ 7 files changed, 58 insertions(+), 50 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index b525638b0..4970a21a4 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -12,7 +12,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : A -> NP -> AP ; ComparA a np = emptyAP ** { s = a.s ! Compar ; - compar = np.s ! Ade ; + compar = applyAdp (caseAdp Ade) np ; -- compar = applyAdp (prepos Nom "mint") np ; } ; @@ -36,7 +36,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : 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 + compar = ap.compar ++ adv.p ++ applyAdp (caseAdp Nom) np ; } ; -- The superlative use is covered in $Ord$. diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index e0d596c2d..9fc6d33e9 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -35,12 +35,12 @@ lin -- Noun phrases lincat - [NP] = ResHun.BaseNP ** {s1,s2 : Case => Str} ; + [NP] = ResHun.BaseNP ** {s1,s2 : Possessor => Case => Str} ; lin - BaseNP x y = twoTable Case x y ** y ; - ConsNP x xs = xs ** consrTable Case comma x xs ; - ConjNP co xs = conjunctDistrTable Case co xs ** xs ** { + BaseNP x y = twoTable2 Possessor Case x y ** y ; + ConsNP x xs = xs ** consrTable2 Possessor Case comma x xs ; + ConjNP co xs = conjunctDistrTable2 Possessor Case co xs ** xs ** { agr = Pl ; _ => co.n }> diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index f870e38a3..8969ea58f 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -9,15 +9,23 @@ concrete NounHun of Noun = CatHun ** open -- : Det -> CN -> NP DetCN det cn = emptyNP ** cn ** det ** { - s = \\c => - let foo : Str = case det.dt of { - NoPoss => caseFromStem glue cn c det.n ; - DetPoss _ => caseFromPossStem cn det c } ; + s = \\p,c => + let possessed : Str = caseFromPossStem cn det c ; + standalone : Str = caseFromStem glue cn c det.n ; in case det.caseagr of { - True => det.s ! c ; - False => det.s ! Nom - } ++ foo - ++ cn.compl ! det.n ! c ; + True => det.s ! c ; + False => det.s ! Nom + } ++ case of { + + => standalone ; + <_, DetPoss _> + => possessed ; + + => let pron : Pronoun = pronTable ! ; -- Possessor's number + dnum : CatHun.Num = case det.n of { -- Possessed's number + Sg => NumSg ; Pl => NumPl } ; + in caseFromPossStem cn (DetQuant (PossPron pron) dnum) c + } ++ cn.compl ! det.n ! c ; agr = ; } ; @@ -25,11 +33,13 @@ concrete NounHun of Noun = CatHun ** open UsePN pn = pn ; -- : Pron -> NP ; - UsePron pron = pron ; + UsePron pron = pron ** { + s = \\_ => pron.s ; + } ; -- : Predet -> NP -> NP ; -- only the man PredetNP predet np = np ** { - s = \\c => predet.s ++ np.s ! c ; + s = \\p,c => predet.s ++ np.s ! p ! c ; } ; -- A noun phrase can also be postmodified by the past participle of a @@ -41,34 +51,32 @@ concrete NounHun of Noun = CatHun ** open -- : NP -> Adv -> NP ; -- Paris today AdvNP np adv = np ** { - s = \\c => case adv.isPre of { - True => adv.s ++ np.s ! c ; - False => np.s ! c ++ adv.s } ; - -- compl = \\nc => case adv.isPre of { - -- True => np.compl ! nc ; - -- False => np.compl ! nc ++ adv.s } ; + s = \\p,c => case adv.isPre of { + True => adv.s ++ np.s ! p ! c ; + False => np.s ! p ! c ++ adv.s } ; + } ; - } ; -- : NP -> Adv -> NP ; -- boys, such as .. ExtAdvNP np adv = np ** { - s = \\c => np.s ! c ++ bindComma ++ adv.s ; - } ; + s = \\p,c => np.s ! p ! c ++ bindComma ++ adv.s ; + } ; + -- : NP -> RS -> NP ; -- Paris, which is here RelNP np rs = np ** { - s = \\c => np.s ! c ++ bindComma ++ rs.s ! np.agr.p2 ! c ; - } ; + s = \\p,c => np.s ! p ! c ++ bindComma ++ rs.s ! np.agr.p2 ! c ; + } ; -- Determiners can form noun phrases directly. -- : Det -> NP ; DetNP det = emptyNP ** det ** { - s = det.sp ; + s = \\p => det.sp ; agr = ; } ; -- : CN -> NP ; MassNP cn = emptyNP ** { - s = \\c => caseFromStem glue cn c Sg ++ + s = \\p,c => caseFromStem glue cn c Sg ++ -- TODO add possessors cn.compl ! Sg ! c ; agr = ; } ; @@ -227,14 +235,15 @@ concrete NounHun of Noun = CatHun ** open -- : CN -> NP -> CN ; -- city Paris (, numbers x and y) ApposCN cn np = cn ** { - compl = \\n,c => cn.compl ! n ! c ++ np.s ! Nom + compl = \\n,c => cn.compl ! n ! c ++ np.s ! NotPossessed ! Nom } ; --2 Possessive and partitive constructs -- : PossNP : CN -> NP -> CN ; -- PossNP cn np = cn ** { - -- } ; + -- compl = \\n,c => cn.compl ! n ! c ++ np.s ! Poss P3 n ! c -- TODO check + -- } ; -- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples -- PartNP cn np = cn ** { diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index dbcf51f8d..2c07f4e75 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -76,6 +76,9 @@ param SubjCase = SCNom | SCDat ; -- Limited set of subject cases CNPossStem = PossPl | PossSg PossStem ; + + Possessor = NotPossessed | Poss Person Number ; + oper caseTable : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Case=>Str = diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 9cc252f2d..5e27da756 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -12,7 +12,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { UttImpPol = UttImpSg ; -} UttIP, - UttNP = \np -> {s = np.s ! Nom} ; + UttNP = \np -> {s = np.s ! NotPossessed ! Nom} ; UttVP vp = {s = vp.obj ! ++ vp.adv ++ vp.s ! VInf} ; UttAdv adv = adv ; UttCN cn = {s = linCN cn} ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index d0207fcfa..3ace6414f 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -79,11 +79,11 @@ oper } ; NounPhrase : Type = BaseNP ** { - s : Case => Str ; + s : Possessor => Case => Str ; } ; emptyNP : NounPhrase = { - s = \\_ => [] ; + s = \\_,_ => [] ; agr = ; objdef = Indef ; empty = [] ; @@ -91,10 +91,10 @@ oper pstems = \\_ => [] ; } ; - indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ; + indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\p,c => s} ; defNP : Str -> Number -> NounPhrase = \s,n -> emptyNP ** { - s = mkCaseNoun s ! n ; + s = \\c => mkCaseNoun s ! n ; n = n ; objdef = Def ; } ; @@ -103,7 +103,8 @@ oper -------------------------------------------------------------------------------- -- Pronouns - Pronoun : Type = NounPhrase ** { + Pronoun : Type = BaseNP ** { + s : Case => Str ; poss : HarmForms ; -- for PossPron : Pron -> Quant } ; @@ -278,7 +279,7 @@ oper emptyAdp : Adposition = nomAdp [] ; applyAdp : Adposition -> NounPhrase -> Str = \adp,np -> - adp.pr ++ np.s ! adp.c ++ adp.s ; + adp.pr ++ np.s ! NotPossessed ! adp.c ++ adp.s ; applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; @@ -504,7 +505,7 @@ oper s = \\t,a,p => let subjcase : Case = case vp.sc of { SCNom => Nom ; SCDat => Dat } - in np.s ! subjcase + in np.s ! NotPossessed ! subjcase ++ if_then_Pol p [] "nem" ++ vp.s ! agr2vf np.agr ++ vp.obj ! np.agr diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 433864de7..b3fbb51d9 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -134,8 +134,8 @@ lin -- : NP -> Comp ; CompNP np = UseCopula ** { s = \\vf => case vf of { - VPres P3 _ => np.s ! Nom ; - _ => np.s ! Nom ++ copula.s ! vf } ; + VPres P3 _ => np.s ! NotPossessed ! Nom ; + _ => np.s ! NotPossessed ! Nom ++ copula.s ! vf } ; } ; -- : Adv -> Comp ; @@ -149,15 +149,10 @@ lin oper insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { obj = \\agr => - -- have_V2 needs to put object in poss. form - let pron : Pronoun = pronTable ! agr ; - num : CatHun.Num = case np.agr.p2 of { - Sg => NumSg ; Pl => NumPl } ; - det : Determiner = DetQuant (PossPron pron) num ; - possessedNP : Str = caseFromPossStem np det vps.c2 ; - in case of { - => possessedNP ; -- TODO loses stuff from np.s - _ => np.s ! vps.c2 } ; + -- have_V2 needs its object possessed by the subject + case of { + => np.s ! Poss agr.p1 agr.p2 ! vps.c2 ; + _ => np.s ! NotPossessed ! vps.c2 } ; s = \\vf => -- If verb's subject case is Dat and object Nom, verb agrees with obj. From e2d79a72f64ba84ef853ed209d928b35f5cb26c9 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 25 Apr 2020 14:47:56 +0200 Subject: [PATCH 39/84] (Hun) Remove unused parameters --- src/hungarian/NounHun.gf | 6 ----- src/hungarian/ParamHun.gf | 2 -- src/hungarian/ResHun.gf | 54 ++++++++++++++++++--------------------- 3 files changed, 25 insertions(+), 37 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 8969ea58f..cd022af06 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -184,11 +184,6 @@ concrete NounHun of Noun = CatHun ** open -- : N2 -> CN ; UseN,UseN2 = \n -> n ** { compl = \\_,_ => [] ; - pstems = table { - PossSg (dSg_rP3 _) => n.s ! PossdSg_PossrP3 ; - PossSg dSg_rPl1 => n.s ! PossdSg_PossrPl1 ; - PossSg dSg_rSg1P2 => n.s ! SgAccStem ; - PossPl => n.s ! PossdPl } ; } ; -- : N2 -> NP -> CN ; @@ -207,7 +202,6 @@ concrete NounHun of Noun = CatHun ** open -- : AP -> CN -> CN AdjCN ap cn = cn ** { s = \\nc => ap.s ! Sg ++ cn.s ! nc ; - pstems = \\cs => ap.s ! Sg ++ cn.pstems ! cs ; compl = \\n,c => ap.compar ++ cn.compl ! n ! c ; } ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 2c07f4e75..029969d0d 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -75,8 +75,6 @@ param SubjCase = SCNom | SCDat ; -- Limited set of subject cases - CNPossStem = PossPl | PossSg PossStem ; - Possessor = NotPossessed | Poss Person Number ; oper diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 3ace6414f..1495bf98f 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -15,13 +15,6 @@ resource ResHun = NounMorphoHun ** open Prelude, Predef in { oper CNoun : Type = Noun ** { compl : Number => Case => Str ; - pstems : CNPossStem => Str ; - } ; - - -- Used to possess NPs even after they become NPs - CNLite : Type = { - h : Harm ; - pstems : CNPossStem => Str } ; mkCaseNoun : Str -> Number => Case => Str = \s -> @@ -43,28 +36,35 @@ oper => applyCase' PlStem } ; - caseFromPossStem : CNLite -> Determiner -> Case -> Str = \cn,det,cas -> + caseFromPossStem : CNoun -> Determiner -> Case -> Str = \cn,det,cas -> let st : PossStem = case det.dt of { - DetPoss x => x ; - _ => Predef.error "caseFromPossStem: Not possessive Det" } ; - casetable : Case->HarmForms = case of { + DetPoss x => x ; + _ => Predef.error "caseFromPossStem: Not possessive Det" } ; + casetable : Case->HarmForms = case of { -- P3 Sg possessive suffix ends in vowel, others in consonant. - => endCasePossVow ; - _ => endCase } ; - stem : CNPossStem = case det.n of { - Sg => PossSg st ; - Pl => PossPl } ; + => endCasePossVow ; + _ => endCase } ; + stem : NumCaseStem = case det.n of { + Pl => PossdPl ; + Sg => case st of { + dSg_rP3 _ => PossdSg_PossrP3 ; + dSg_rPl1 => PossdSg_PossrPl1 ; + dSg_rSg1P2 => SgAccStem } + } ; -- possessive suffix e.g. "their cats-3pl" is just k. not uk/ük + -- possessive suffix e.g. "her cat-3sg" is ∅, we store suf = case of { - => "k" ; - => "" ; - _ => det.poss ! cn.h - } ; + => "k" ; + => "" ; + _ => det.poss ! cn.h } ; in case of { - -- don't use applyCaseSuf, it adds BIND - => cn.pstems ! PossPl ; - => glue (cn.pstems ! stem) suf ; + -- Possessor is P3 Sg, possessed is plural, case is Nom: + -- just use the stored PossdPl stem, e.g. 'madarai' + => cn.s ! PossdPl ; + + -- Any number of possr or possd, case Nom = empty case ending + => glue (cn.s ! stem) suf ; -- Other forms have non-empty poss. suffix and case ending _ => applyCaseSuf suf cas cn stem casetable @@ -74,8 +74,6 @@ oper agr : Person*Number ; objdef : ObjDef ; empty : Str ; -- standard trick for pro-drop - pstems : CNPossStem => Str ; -- Verbs might need to add poss. suffixes - h : Harm ; -- NP may need to be possessed again because of have_V2 } ; NounPhrase : Type = BaseNP ** { @@ -87,8 +85,6 @@ oper agr = ; objdef = Indef ; empty = [] ; - h = H_e ; - pstems = \\_ => [] ; } ; indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\p,c => s} ; @@ -284,9 +280,9 @@ oper applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; - applyCaseSuf : Str -> Case -> CNLite -> CNPossStem -> (Case -> HarmForms) -> Str = + applyCaseSuf : Str -> Case -> CNoun -> NumCaseStem -> (Case -> HarmForms) -> Str = \suf,cas,cn,stem,casetable -> - glue (glue (cn.pstems ! stem) suf) (casetable cas ! cn.h) ; + glue (glue (cn.s ! stem) suf) (casetable cas ! cn.h) ; ------------------ From 5b8e2eeb23e5623cc119af7b9ce41e377c5754b0 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Sat, 25 Apr 2020 16:03:06 +0200 Subject: [PATCH 40/84] . --- src/hungarian/unittest/dative.gftest | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hungarian/unittest/dative.gftest b/src/hungarian/unittest/dative.gftest index 990bfc0fd..d7345451a 100644 --- a/src/hungarian/unittest/dative.gftest +++ b/src/hungarian/unittest/dative.gftest @@ -4,7 +4,7 @@ LangHun: nekem van egy macskám -- LangEng: I have the cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))))) NoVoc -LangHun: nekem megvan a macska +LangHun: nekem van a macskám --In this case we don't have to use plural -- LangEng: I have many cats @@ -14,4 +14,3 @@ 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" From d7e10e843b81a4945651d299898258c06a4e6356 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 13:30:00 +0200 Subject: [PATCH 41/84] (Hun) Add case to A and AP --- src/hungarian/AdjectiveHun.gf | 20 +++++++++++--------- src/hungarian/CatHun.gf | 2 +- src/hungarian/ConjunctionHun.gf | 14 +++++++------- src/hungarian/NounHun.gf | 10 ++++++---- src/hungarian/ParadigmsHun.gf | 4 ++-- src/hungarian/PhraseHun.gf | 2 +- src/hungarian/ResHun.gf | 26 +++++++++++++------------- src/hungarian/VerbHun.gf | 6 +++--- 8 files changed, 44 insertions(+), 40 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 4970a21a4..2e731e10f 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -6,19 +6,19 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : A -> AP ; PositA a = emptyAP ** { - s = a.s ! Posit + s = \\n,c => + let adj : Noun = (a ** {s = a.s ! Posit}) in + caseFromStem glue adj c n ; } ; -- : A -> NP -> AP ; - ComparA a np = emptyAP ** { - s = a.s ! Compar ; + ComparA a np = UseComparA a ** { compar = applyAdp (caseAdp Ade) np ; -- compar = applyAdp (prepos Nom "mint") np ; } ; -- : A2 -> NP -> AP ; -- married to her - ComplA2 a2 np = emptyAP ** { - s = a2.s ! Posit ; + ComplA2 a2 np = PositA a2 ** { compar = applyAdp a2.c2 np ; } ; @@ -30,12 +30,14 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : A -> AP ; -- warmer UseComparA a = emptyAP ** { - s = a.s ! Compar ; + s = \\n,c => + let adj : Noun = (a ** {s = a.s ! Compar}) in + caseFromStem glue adj c n ; } ; -- : CAdv -> AP -> NP -> AP ; -- as cool as John CAdvAP adv ap np = ap ** { - s = \\n => adv.s ++ ap.s ! n ; + s = \\n,c => adv.s ++ ap.s ! n ! c ; compar = ap.compar ++ adv.p ++ applyAdp (caseAdp Nom) np ; } ; @@ -54,7 +56,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : AdA -> AP -> AP ; AdAP ada ap = ap ** { - s = \\af => ada.s ++ ap.s ! af ; + s = \\n,c => ada.s ++ ap.s ! n ! c ; } ; @@ -62,7 +64,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : AP -> Adv -> AP ; -- warm by nature AdvAP ap adv = ap ** { - s = \\af => ap.s ! af ++ adv.s ; + s = \\n,c => ap.s ! n ! c ++ adv.s ; } ; } diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 956554909..82583e2d1 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -66,7 +66,7 @@ concrete CatHun of Cat = CommonX - [Adv] ** open ResHun, Prelude in { Quant = ResHun.Quant ; Num = ResHun.Num ; Ord = { - s : Number => Str ; -- Number => Case => Str ; -- Ord can come from AP and become AP again + s : Number => Case => Str ; -- Ord can come from AP and become AP again n : Number -- Ord can come from Num, which has inherent number } ; DAP = ResHun.Determiner ; diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index 9fc6d33e9..613f4a3ea 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -20,18 +20,18 @@ lin -- Adjectival phrases lincat - [AP] = {s1,s2 : Number => Str} ; + [AP] = {s1,s2 : Number => Case => Str} ; lin BaseAP x y = -- Don't try to have discontinuous comparative forms - let xCont : AP = x ** {s = \\n => x.s ! n ++ x.compar} ; - yCont : AP = y ** {s = \\n => y.s ! n ++ y.compar} ; - in twoTable Number xCont yCont ; + let xCont : AP = x ** {s = \\n,c => x.s ! n ! c ++ x.compar} ; + yCont : AP = y ** {s = \\n,c => y.s ! n ! c ++ y.compar} ; + in twoTable2 Number Case xCont yCont ; ConsAP a as = - let aCont : AP = a ** {s = \\n => a.s ! n ++ a.compar} ; - in consrTable Number comma aCont as ; - ConjAP co as = conjunctDistrTable Number co as ** {compar = []} ; + let aCont : AP = a ** {s = \\n,c => a.s ! n ! c ++ a.compar} ; + in consrTable2 Number Case comma aCont as ; + ConjAP co as = conjunctDistrTable2 Number Case co as ** {compar = []} ; -- Noun phrases lincat diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index cd022af06..fb4c369f5 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -103,8 +103,8 @@ concrete NounHun of Noun = CatHun ** open -- : 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 ; + s = \\c => theseFive.s ! c ++ ord.s ! num.n ! Nom ; + sp = \\c => theseFive.sp ! c ++ ord.s ! num.n ! Nom ; } ; -- Whether the resulting determiner is singular or plural depends on the @@ -145,7 +145,9 @@ concrete NounHun of Noun = CatHun ** open -} -- : A -> Ord ; OrdSuperl a = { - s = a.s ! Superl ; + s = \\n,c => + let adj : Noun = (a ** {s = a.s ! Superl}) in + caseFromStem glue adj c n ; n = Sg -- ?? is this meaningful? } ; @@ -201,7 +203,7 @@ concrete NounHun of Noun = CatHun ** open -- : AP -> CN -> CN AdjCN ap cn = cn ** { - s = \\nc => ap.s ! Sg ++ cn.s ! nc ; + s = \\nc => ap.s ! Sg ! Nom ++ cn.s ! nc ; compl = \\n,c => ap.compar ++ cn.compl ! n ! c ; } ; diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index fc07c8c2d..93e457b42 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -159,9 +159,9 @@ oper mkA2 = overload { mkA2 : A -> A2 = \a -> a ** {c2 = casePrep Nom} ; mkA2 : Str -> Prep -> A2 = \s,p -> - lin A2 {s = (mkAdj s).s ; c2 = p} ; + lin A2 ((mkAdj s) ** {c2 = p}) ; mkA2 : Str -> Case -> A2 = \s,c -> - lin A2 {s = (mkAdj s).s ; c2 = casePrep c} ; + lin A2 ((mkAdj s) ** {c2 = casePrep c}) ; mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (a ** {c2 = p}) ; } ; diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 5e27da756..b4b5a8e14 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -17,7 +17,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { UttAdv adv = adv ; UttCN cn = {s = linCN cn} ; UttCard n = {s = n.s ! Indep} ; - UttAP ap = {s = ap.s ! Sg ++ ap.compar} ; + UttAP ap = {s = ap.s ! Sg ! Nom ++ ap.compar} ; UttInterj i = i ; NoPConj = {s = []} ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 1495bf98f..23d8b62a6 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -305,35 +305,35 @@ oper -- Adjectives AdjPhrase : Type = { - s : Number => Str ; + s : Number => Case => Str ; compar : Str -- Discontinuous: Én *nagyobb* vagyok *nálad*. } ; emptyAP : AdjPhrase = { - s = \\_ => [] ; + s = \\_,_ => [] ; compar = [] ; } ; Adjective : Type = { - s : Degree => Number => Str + s : Degree => NumCaseStem => Str ; + h : Harm ; } ; + Adjective2 : Type = Adjective ** { c2 : Adposition ; } ; - mkAdj : Str -> Adjective = \sg -> { - s = \\d,n => + mkAdj : Str -> Adjective = \sgnom -> { + s = \\d,nc => let adj = case d of { - Compar => comparAdj sg ; - Superl => "leg" + comparAdj sg ; - _ => sg } ; - plural = case n of { - Sg => [] ; - Pl => pluralAdj adj } - in adj + plural + Compar => comparAdj sgnom ; + Superl => "leg" + comparAdj sgnom ; + _ => sgnom } ; + in (mkNoun adj).s ! nc ; + h = (mkNoun sgnom).h ; } ; - invarAP : Str -> AdjPhrase = \s -> emptyAP ** {s = \\_ => s} ; + invarAP : Str -> AdjPhrase = \s -> emptyAP ** {s = \\_,_ => s} ; -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives comparAdj : Str -> Str = \stem -> diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index b3fbb51d9..0abd729c4 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -110,9 +110,9 @@ lin -- : AP -> Comp ; CompAP ap = UseCopula ** { s = \\vf => case vf of { - VPres P3 n => ap.s ! n ; - VPres _ n => ap.s ! n ++ copula.s ! vf ; - _ => ap.s ! Sg ++ copula.s ! vf} + VPres P3 n => ap.s ! n ! Nom ; + VPres _ n => ap.s ! n ! Nom ++ copula.s ! vf ; + _ => ap.s ! Sg ! Nom ++ copula.s ! vf} ++ ap.compar ; } ; From b723ae1a75bad32aed550629053ec4a6f5137f99 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 14:15:31 +0200 Subject: [PATCH 42/84] (Hun) Add number as a parameter to APs complement --- src/hungarian/AdjectiveHun.gf | 8 ++++---- src/hungarian/ConjunctionHun.gf | 8 ++++---- src/hungarian/NounHun.gf | 2 +- src/hungarian/PhraseHun.gf | 2 +- src/hungarian/ResHun.gf | 5 +++-- src/hungarian/VerbHun.gf | 7 +++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 2e731e10f..4a105d10a 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -13,13 +13,13 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : A -> NP -> AP ; ComparA a np = UseComparA a ** { - compar = applyAdp (caseAdp Ade) np ; - -- compar = applyAdp (prepos Nom "mint") np ; + compl = \\n => applyAdp (caseAdp Ade) np ; + -- compl = applyAdp (prepos Nom "mint") np ; } ; -- : A2 -> NP -> AP ; -- married to her ComplA2 a2 np = PositA a2 ** { - compar = applyAdp a2.c2 np ; + compl = \\n => applyAdp a2.c2 np ; } ; -- : A2 -> AP ; -- married to itself @@ -38,7 +38,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { -- : CAdv -> AP -> NP -> AP ; -- as cool as John CAdvAP adv ap np = ap ** { s = \\n,c => adv.s ++ ap.s ! n ! c ; - compar = ap.compar ++ adv.p ++ applyAdp (caseAdp Nom) np ; + compl = \\n => ap.compl ! n ++ adv.p ++ applyAdp (caseAdp Nom) np ; } ; -- The superlative use is covered in $Ord$. diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index 613f4a3ea..689a9c891 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -25,13 +25,13 @@ lincat lin BaseAP x y = -- Don't try to have discontinuous comparative forms - let xCont : AP = x ** {s = \\n,c => x.s ! n ! c ++ x.compar} ; - yCont : AP = y ** {s = \\n,c => y.s ! n ! c ++ y.compar} ; + let xCont : AP = x ** {s = \\n,c => x.s ! n ! c ++ x.compl ! n} ; + yCont : AP = y ** {s = \\n,c => y.s ! n ! c ++ y.compl ! n} ; in twoTable2 Number Case xCont yCont ; ConsAP a as = - let aCont : AP = a ** {s = \\n,c => a.s ! n ! c ++ a.compar} ; + let aCont : AP = a ** {s = \\n,c => a.s ! n ! c ++ a.compl ! n} ; in consrTable2 Number Case comma aCont as ; - ConjAP co as = conjunctDistrTable2 Number Case co as ** {compar = []} ; + ConjAP co as = conjunctDistrTable2 Number Case co as ** {compl = \\_ => []} ; -- Noun phrases lincat diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index fb4c369f5..70dc98ba5 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -204,7 +204,7 @@ concrete NounHun of Noun = CatHun ** open -- : AP -> CN -> CN AdjCN ap cn = cn ** { s = \\nc => ap.s ! Sg ! Nom ++ cn.s ! nc ; - compl = \\n,c => ap.compar ++ cn.compl ! n ! c ; + compl = \\n,c => ap.compl ! n ++ cn.compl ! n ! c ; } ; -- : CN -> RS -> CN ; diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index b4b5a8e14..687668418 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -17,7 +17,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { UttAdv adv = adv ; UttCN cn = {s = linCN cn} ; UttCard n = {s = n.s ! Indep} ; - UttAP ap = {s = ap.s ! Sg ! Nom ++ ap.compar} ; + UttAP ap = {s = ap.s ! Sg ! Nom ++ ap.compl ! Sg} ; UttInterj i = i ; NoPConj = {s = []} ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 23d8b62a6..16a69253e 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -306,12 +306,13 @@ oper AdjPhrase : Type = { s : Number => Case => Str ; - compar : Str -- Discontinuous: Én *nagyobb* vagyok *nálad*. + compl : Number => Str -- Discontinuous comparative: Én nagyobb vagyok nálad. + -- This depends on Number to allow postmodifier APs. } ; emptyAP : AdjPhrase = { s = \\_,_ => [] ; - compar = [] ; + compl = \\_ => [] ; } ; Adjective : Type = { diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 0abd729c4..c07e22ba6 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -110,10 +110,9 @@ lin -- : AP -> Comp ; CompAP ap = UseCopula ** { s = \\vf => case vf of { - VPres P3 n => ap.s ! n ! Nom ; - VPres _ n => ap.s ! n ! Nom ++ copula.s ! vf ; - _ => ap.s ! Sg ! Nom ++ copula.s ! vf} - ++ ap.compar ; + VPres P3 n => ap.s ! n ! Nom ++ ap.compl ! n ; + VPres _ n => ap.s ! n ! Nom ++ copula.s ! vf ++ ap.compl ! n ; + _ => ap.s ! Sg ! Nom ++ copula.s ! vf ++ ap.compl ! Sg } ; } ; -- : CN -> Comp ; From ef3dc464cb90ed4b204f7c37536e56a01a3bc678 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 14:15:53 +0200 Subject: [PATCH 43/84] (Hun) Update Symbol after changes in lincats --- src/hungarian/SymbolHun.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/SymbolHun.gf b/src/hungarian/SymbolHun.gf index 2d0b3909d..1fe3dffe0 100644 --- a/src/hungarian/SymbolHun.gf +++ b/src/hungarian/SymbolHun.gf @@ -18,7 +18,7 @@ lin oper mkPN : Str -> NounPhrase = \s -> emptyNP ** { - s = \\_ => s ; + s = \\_,_ => s ; } ; lin @@ -42,7 +42,7 @@ lin SymbNum sy = baseNum ** {s = \\_ => sy.s} ; -- : Symb -> Ord ; - SymbOrd sy = {s = \\n => sy.s ; n=Pl} ; + SymbOrd sy = {s = \\n,c => sy.s ; n=Pl} ; lincat Symb, [Symb] = SS ; From 797171fb31f8099b24af9fd63d2a1a9aca9246ff Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 14:35:12 +0200 Subject: [PATCH 44/84] (Hun) Remove unnecessary distinction between digits and numbers --- src/hungarian/NounHun.gf | 2 +- src/hungarian/ParamHun.gf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 70dc98ba5..185b361b5 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -125,7 +125,7 @@ concrete NounHun of Noun = CatHun ** open -- : Digits -> Card ; NumDigits dig = dig ** { s = \\place => dig.s ! NCard ; - numtype = IsDig ; + numtype = IsNum ; } ; -- : Numeral -> Card ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 029969d0d..f340c33a0 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -112,7 +112,7 @@ param CardOrd = NOrd | NCard ; -- Not used yet - NumType = NoNum | IsDig | IsNum ; + NumType = NoNum | IsNum ; oper isNum : {numtype : NumType} -> Bool = \nt -> case nt.numtype of { From b6b462ca359694e793a6cb51860e4b089dcb7100 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 15:19:43 +0200 Subject: [PATCH 45/84] (Hun) Temporarily comment out cases+change order in funs that pat. match --- src/hungarian/NounMorphoHun.gf | 12 ++++++------ src/hungarian/ParamHun.gf | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 4dd658241..5113a5b6c 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -436,18 +436,18 @@ oper Nom => harm1 [] ; Acc => harm3 "ot" "et" "öt" ; Dat => harm "nak" "nek" ; - Ins => harm "al" "el" ; - Tra => harm "á" "é" ; - Ill => harm "ba" "be" ; + Ade => harm "nál" "nél" ; + Sup => harm3 "on" "en" "ön" ; Ine => harm "ban" "ben" ; Ela => harm "ból" "ből" ; + Ins => harm "al" "el" ; + Tra => harm "á" "é" ; All => harm3 "hoz" "hez" "höz" ; - 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" + Cau => harm1 "ért" ; + Ill => harm "ba" "be" -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' -- Ter => harm1 "ig" ; -- Terminative 'as far as ' -- For => harm1 "ként" ; -- Formal 'as ' diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index f340c33a0..9969dbd80 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -65,8 +65,16 @@ param Case = Nom | Acc | Dat - | Ill | Ine | Ela | All | Ade | Abl | Sub | Sup | Del -- Locatives - | Cau -- Causal-final 'for the purpose of, for the reason that' +-- | Ill -- Locatives + | Ine + | Ela + | All + | Ade +-- | Abl +-- | Sub + | Sup +-- | Del +-- | Cau -- Causal-final 'for the purpose of, for the reason that' | Ins -- Instrumental | Tra -- Translative -- | Ess | Ter | For @@ -87,14 +95,14 @@ oper Ins => ins ; Tra => tra ; Sup => sup ; - Sub => sub ; - Del => del ; - Ill => il ; Ine => ine ; Ela => el ; All => al ; Ade => ad ; Abl => ab ; + Sub => sub ; + Del => del ; + Ill => il ; Cau => ca } ; sc2case : SubjCase -> Case = \sc -> From 22cadd2ac64dbbc64426f9c3281ac88e12de91a5 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 15:51:34 +0200 Subject: [PATCH 46/84] (Hun) Combine the parameters on definiteness and Quant/Det type --- src/hungarian/NounHun.gf | 21 +++++++++------------ src/hungarian/ParamHun.gf | 34 ++++++++++++++++++++++++++-------- src/hungarian/ResHun.gf | 8 ++------ 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 185b361b5..3698ef6ba 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -16,17 +16,18 @@ concrete NounHun of Noun = CatHun ** open True => det.s ! c ; False => det.s ! Nom } ++ case of { - + <_, DetPoss _> + => possessed ; + => standalone ; - <_, DetPoss _> - => possessed ; - + => let pron : Pronoun = pronTable ! ; -- Possessor's number dnum : CatHun.Num = case det.n of { -- Possessed's number Sg => NumSg ; Pl => NumPl } ; in caseFromPossStem cn (DetQuant (PossPron pron) dnum) c } ++ cn.compl ! det.n ! c ; agr = ; + objdef = dt2objdef det.dt ; } ; -- : PN -> NP ; @@ -96,8 +97,7 @@ concrete NounHun of Noun = CatHun ** open => [] ; _ => quant.sp ! num.n ! c } ++ num.s ! Indep ; - dt = case quant.qt of { QuantPoss stem => DetPoss stem ; - _ => NoPoss } ; + dt = qt2dt quant.qt ; } ; -- : Quant -> Num -> Ord -> Det ; -- these five best @@ -160,23 +160,20 @@ concrete NounHun of Noun = CatHun ** open DefArt = mkQuant "a" "a" ** { s, sp = \\_,_ => pre {"a" ; "az" / v } ; - qt = Article ; - objdef = Def ; + qt = DefQuant ; } ; -- : Quant IndefArt = mkQuant "egy" [] ** { s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ; - qt = Article ; - objdef = Indef ; + qt = IndefArticle ; } ; -- : Pron -> Quant PossPron pron = pron ** { s,sp = \\_ => pron.s ; - qt = QuantPoss (agr2PossStem pron.agr) ; - objdef = Def ; + qt = QuantPoss (agr2pstem pron.agr) ; caseagr = False ; } ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 9969dbd80..dd396ddf3 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -18,13 +18,15 @@ oper param QuantType = - Article -- Needed to prevent "a 2 cars" - | Other -- Not poss, not article + IndefArticle -- Needed to prevent "a 2 cars" + | IndefQuant -- Not IndefArt, not poss, not def + | DefQuant | QuantPoss PossStem -- Which possessive stem it takes ; DetType = - NoPoss -- distinction between Article and Other no longer needed + DefDet -- distinction between Article and Other no longer needed + | IndefDet -- still need def or indef | DetPoss PossStem -- Sill need to know which stem it takes if Poss ; @@ -33,13 +35,29 @@ param oper -- standard trick to prevent "a one car" - isIndefArt : {qt : QuantType ; objdef : ObjDef} -> Bool = \quant -> - case of { - => True ; - _ => False + isIndefArt : {qt : QuantType} -> Bool = \quant -> + case quant.qt of { + IndefArticle => True ; + _ => False } ; - agr2PossStem : Person*Number -> PossStem = \pn -> + dt2objdef : DetType -> ObjDef = \dt -> case dt of { + IndefDet => Indef ; + _ => Def + } ; + + objdef2dt : ObjDef -> DetType = \od -> case od of { + Def => DefDet ; + Indef => IndefDet + } ; + + qt2dt : QuantType -> DetType = \qt -> case qt of { + QuantPoss x => DetPoss x ; + DefQuant => DefDet ; + _ => IndefDet + } ; + + agr2pstem : Person*Number -> PossStem = \pn -> case of { => dSg_rPl1 ; => dSg_rP3 n ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 16a69253e..0ff69be26 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -185,7 +185,6 @@ oper BaseQuant : Type = { poss : HarmForms ; -- Quants made by PossPron need this, empty for others - objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object caseagr : Bool ; -- If it agrees in case: "azoknak a nőknek" vs. "sok nőknek" } ; @@ -200,8 +199,7 @@ oper mkQuant : (s,sp : Str) -> Quant = \s,sp -> { s = mkCaseNoun s ; sp = mkCaseNoun sp ; - qt = Other ; - objdef = Def ; + qt = DefQuant ; caseagr = True ; poss = harm1 [] ; } ; @@ -212,7 +210,6 @@ oper s, sp : Case => Str ; n : Number ; --- numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl dt : DetType ; } ; @@ -221,9 +218,8 @@ oper sp = mkCaseNoun s ! n ; n = n ; numtype = NoNum ; - objdef = d ; caseagr = ca ; - dt = NoPoss ; + dt = objdef2dt d ; poss = harm1 [] ; } ; From bbcde26d72870ac0e71ae9c4a20e18cf9c0a95d8 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 20:16:45 +0200 Subject: [PATCH 47/84] (Hun) Add 2-argument smart paradigm for A --- src/hungarian/ParadigmsHun.gf | 3 ++- src/hungarian/ResHun.gf | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 93e457b42..b382baf3b 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -151,7 +151,8 @@ oper mkA = overload { mkA : (sgnom : Str) -> A = \s -> lin A (mkAdj s) ; - mkA : (sgnom,sgacc : Str) -> A = \s,_ -> lin A (mkAdj s) ; -- TODO + mkA : (sgnom,sgacc : Str) -> A = \n,a -> + lin A (mkAdj2 n (regNounNomAcc n a)) ; -- mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda -> -- jakda ** {s = \\af => kiga ++ jakda.s ! af} ; } ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 0ff69be26..55df9a1c3 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -320,14 +320,16 @@ oper c2 : Adposition ; } ; - mkAdj : Str -> Adjective = \sgnom -> { - s = \\d,nc => - let adj = case d of { - Compar => comparAdj sgnom ; - Superl => "leg" + comparAdj sgnom ; - _ => sgnom } ; - in (mkNoun adj).s ! nc ; - h = (mkNoun sgnom).h ; + mkAdj : Str -> Adjective = \sgnom -> mkAdj2 sgnom (mkNoun sgnom) ; + + + mkAdj2 : Str -> Noun -> Adjective = \sgnom,adjAsNoun -> adjAsNoun ** { + s = \\d => + let adj : Noun = case d of { + Compar => mkNoun (comparAdj sgnom) ; + Superl => mkNoun ("leg" + comparAdj sgnom) ; + _ => adjAsNoun } ; + in adj.s ; } ; invarAP : Str -> AdjPhrase = \s -> emptyAP ** {s = \\_,_ => s} ; From 69c73963358991d691021026345d53452bdddf46 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 20:31:49 +0200 Subject: [PATCH 48/84] (Hun) Update unit tests to use stem-based morphology --- src/hungarian/unittest/dative.gftest | 8 +++--- src/hungarian/unittest/determiners.gftest | 10 +++---- src/hungarian/unittest/inflection/alma.gftest | 2 +- .../unittest/inflection/férfi.gftest | 2 +- src/hungarian/unittest/relative.gftest | 28 +++++++++---------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/hungarian/unittest/dative.gftest b/src/hungarian/unittest/dative.gftest index d7345451a..2acdcb6e5 100644 --- a/src/hungarian/unittest/dative.gftest +++ b/src/hungarian/unittest/dative.gftest @@ -1,16 +1,16 @@ -- LangEng: I have a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)))))) NoVoc -LangHun: nekem van egy macskám +LangHun: nekem van egy macská &+ m -- LangEng: I have the cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))))) NoVoc -LangHun: nekem van a macskám +LangHun: nekem van a macská &+ m --In this case we don't have to use plural -- LangEng: I have many cats Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN many_Det (UseN cat_N)))))) NoVoc -LangHun: nekem van sok macskám +LangHun: nekem van sok macská &+ m -- LangEng: I have some cats Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN somePl_Det (UseN cat_N)))))) NoVoc -LangHun: nekem van néhány macskám +LangHun: nekem van néhány macská &+ m diff --git a/src/hungarian/unittest/determiners.gftest b/src/hungarian/unittest/determiners.gftest index 8bb2c331f..ce4856b70 100644 --- a/src/hungarian/unittest/determiners.gftest +++ b/src/hungarian/unittest/determiners.gftest @@ -1,6 +1,6 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant this_Quant NumSg) (UseN apple_N)))))) NoVoc LangEng: I see this apple -LangHun: én látom ezt az almát +LangHun: én látom ezt az almá &+ t Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant this_Quant NumPl) (UseN apple_N)))))) NoVoc LangEng: I see these apples @@ -20,11 +20,11 @@ LangHun: én látom ezeket Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN somePl_Det (UseN apple_N)))))) NoVoc LangEng: I see some apples -LangHun: én látok néhány almát +LangHun: én látok néhány almá &+ t Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN somePl_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc LangEng: I see some red apples -LangHun: én látok néhány piros almát +LangHun: én látok néhány piros almá &+ t Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetNP somePl_Det))))) NoVoc LangEng: I see some @@ -32,8 +32,8 @@ LangHun: én látok néhányat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN few_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc LangEng: I see few red apples -LangHun: én látok kevés piros almát +LangHun: én látok kevés piros almá &+ t Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN many_Det (AdjCN (PositA red_A) (UseN apple_N))))))) NoVoc LangEng: I see many red apples -LangHun: én látok sok piros almát +LangHun: én látok sok piros almá &+ t diff --git a/src/hungarian/unittest/inflection/alma.gftest b/src/hungarian/unittest/inflection/alma.gftest index a8600c754..994656c2b 100644 --- a/src/hungarian/unittest/inflection/alma.gftest +++ b/src/hungarian/unittest/inflection/alma.gftest @@ -2,7 +2,7 @@ Lang: MassNP (UseN apple_N) LangHun: alma Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN apple_N))) -LangHun: én látok egy almát +LangHun: én látok egy almá &+ t Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN apple_N)) LangHun: egy almán diff --git a/src/hungarian/unittest/inflection/férfi.gftest b/src/hungarian/unittest/inflection/férfi.gftest index 47de6fb33..171a59443 100644 --- a/src/hungarian/unittest/inflection/férfi.gftest +++ b/src/hungarian/unittest/inflection/férfi.gftest @@ -2,7 +2,7 @@ Lang: MassNP (UseN man_N) LangHun: férfi Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN man_N))) -LangHun: én látok egy férfit +LangHun: én látok egy férfi &+ t Lang: PrepNP on_Prep (DetCN (DetQuant IndefArt NumSg) (UseN man_N)) LangHun: egy férfin diff --git a/src/hungarian/unittest/relative.gftest b/src/hungarian/unittest/relative.gftest index a65477065..5e378b85e 100644 --- a/src/hungarian/unittest/relative.gftest +++ b/src/hungarian/unittest/relative.gftest @@ -6,39 +6,39 @@ -- LangEng: I see a man that flies Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))))))))) NoVoc -LangHun: én látok egy férfit ami repül +LangHun: én látok egy férfi &+ t ami repül -- LangEng: I see the man that flies Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))))))))) NoVoc -LangHun: én látom a férfit ami repül +LangHun: én látom a férfi &+ t ami repül -- LangEng: I see the man that sees a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))) NoVoc -LangHun: én látom a férfit ami egy macskát lát +LangHun: én látom a férfi &+ t ami egy macská &+ t lát -- LangEng: I see the man that sees the cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))))))) NoVoc -LangHun: én látom a férfit ami a macskát látja +LangHun: én látom a férfi &+ t ami a macská &+ t látja -- LangEng: I see the man that has a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))) NoVoc -LangHun: én látom a férfit aminek egy macskája van +LangHun: én látom a férfi &+ t aminek egy macskáj &+ a van -- LangEng: I see the man that has the cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))))))) NoVoc -LangHun: én látom a férfit aminek megvan a macska +LangHun: én látom a férfi &+ t aminek megvan a macska -- vet inte riktigt hur jag ska tänka med "the cat", tyckte det kändes mer rätt med "meg-" konstruktionen -- LangEng: I see the cat that flies and that is red -- Do we need copula in "is red" or is it still fine without? -- This constructor repeats amit, we have other constructors that don't. I think we don't need it Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseComp (CompAP (PositA red_A))))))))))))) NoVoc -LangHun: én látom a macskát ami repül és piros +LangHun: én látom a macská &+ t ami repül és piros --skulle dock byta plats på "piros" och "repül" -- LangEng: I see the man that flies and that has a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))))))))))))) NoVoc -LangHun: én látom a férfit ami repül és aminek egy macskája van +LangHun: én látom a férfi &+ t ami repül és aminek egy macskáj &+ a van ------------------------------------------------------------- @@ -47,26 +47,26 @@ LangHun: én látom a férfit ami repül és aminek egy macskája van -- LangEng: I see the man that the cat sees Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (SlashV2a see_V2)))))))))) NoVoc -LangHun: én látom a férfit amit a macska lát +LangHun: én látom a férfi &+ t amit a macska lát -- LangEng: I see a man that the cat sees -- Should this be "amit a macska lát"? Yes Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (SlashV2a see_V2)))))))))) NoVoc -LangHun: én látok egy férfit amit a macska lát +LangHun: én látok egy férfi &+ t amit a macska lát --These last cases not corrected due to "van" confusion -- LangEng: I see a cat that the man has Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN man_N)) (SlashV2a have_V2)))))))))) NoVoc -LangHun: én látok egy macskát amit a férfinak van +LangHun: én látok egy macská &+ t amit a férfi &+ nak van -- LangEng: I see the cat that the man has Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN man_N)) (SlashV2a have_V2)))))))))) NoVoc -LangHun: én látom a macskát amit a férfinak van +LangHun: én látom a macská &+ t amit a férfi &+ nak van -- LangEng: I see the cat that the man has and that flies Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN man_N)) (SlashV2a have_V2)))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV fly_V))))))))))) NoVoc -LangHun: én látom a macskát amit a férfinak van és amit repül +LangHun: én látom a macská &+ t amit a férfi &+ nak van és amit repül -- LangEng: I am redder than the cats that those women have Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompAP (ComparA red_A (DetCN (DetQuant DefArt NumPl) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant that_Quant NumPl) (UseN woman_N)) (SlashV2a have_V2)))))))))))) NoVoc -LangHun: én pirosabb vagyok a macskáknál amik azoknak a nőknek vannak +LangHun: én pirosabb vagyok a macskák &+ nál amik azoknak a nők &+ nek vannak From c076409f6a5490b6c25dbc6b51fdc383ce6644b2 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 20:32:01 +0200 Subject: [PATCH 49/84] (Hun) Fix some words --- src/hungarian/StructuralHun.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index f980a7310..3e6a44378 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -61,8 +61,8 @@ lin most_Predet = {s = ""} ; -} --lin every_Det = -lin few_Det = mkDet "kevés" Def Sg False ; -- TODO check -lin many_Det = mkDet "sok" Def Sg False ; -- TODO check +lin few_Det = mkDet "kevés" Indef Sg False ; +lin many_Det = mkDet "sok" Indef Sg False ; --lin much_Det = lin someSg_Det, From a9e02de33e407afe075765e83a2a666b5a08b484 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 20:52:09 +0200 Subject: [PATCH 50/84] (Hun) Make VP smaller by forcing object of have_V2 in s field. Probably bad decision, makes word order fixed at VP already. But works for a particular application grammar. --- src/hungarian/PhraseHun.gf | 2 +- src/hungarian/ResHun.gf | 8 ++++---- src/hungarian/SentenceHun.gf | 2 +- src/hungarian/VerbHun.gf | 19 ++++++++++++------- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 687668418..8cc417d97 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -13,7 +13,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { -} UttIP, UttNP = \np -> {s = np.s ! NotPossessed ! Nom} ; - UttVP vp = {s = vp.obj ! ++ vp.adv ++ vp.s ! VInf} ; + UttVP vp = {s = vp.obj ++ vp.adv ++ vp.s ! VInf} ; UttAdv adv = adv ; UttCN cn = {s = linCN cn} ; UttCard n = {s = n.s ! Indep} ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 55df9a1c3..bbaabd65a 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -457,7 +457,7 @@ oper -- VP VerbPhrase : Type = Verb ** { - obj : Person*Number => Str ; + obj : Str ; -- Person*Number => Str, if we want open word order in have_V2 adv : Str ; c2 : Case ; -- for RelSlash } ; -- TODO more fields @@ -467,7 +467,7 @@ oper } ; useV : Verb -> VerbPhrase = \v -> v ** { - obj = \\_ => [] ; + obj = [] ; adv = [] ; c2 = Acc ; -- TODO check } ; @@ -503,7 +503,7 @@ oper in np.s ! NotPossessed ! subjcase ++ if_then_Pol p [] "nem" ++ vp.s ! agr2vf np.agr - ++ vp.obj ! np.agr + ++ vp.obj -- ! np.agr ++ vp.adv ++ np.empty -- standard trick for prodrop+metavariable problem } ; @@ -521,7 +521,7 @@ oper SCDat => Dat } in rp.s ! n ! subjcase ++ if_then_Pol p [] "nem" - ++ vp.obj ! + ++ vp.obj -- ! ++ vp.adv ++ vp.s ! VPres rp.agr.p1 n -- variable by number } ; diff --git a/src/hungarian/SentenceHun.gf b/src/hungarian/SentenceHun.gf index e402dc22c..82f884ca0 100644 --- a/src/hungarian/SentenceHun.gf +++ b/src/hungarian/SentenceHun.gf @@ -15,7 +15,7 @@ lin --2 Clauses missing object noun phrases -- : NP -> VPSlash -> ClSlash ; - SlashVP np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = \\_ => []}) ; + SlashVP np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = []}) ; {- -- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today AdvSlash cls adv = cls ** insertAdv adv cls ; diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index c07e22ba6..06cf22441 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -147,16 +147,21 @@ lin oper insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { - obj = \\agr => - -- have_V2 needs its object possessed by the subject - case of { - => np.s ! Poss agr.p1 agr.p2 ! vps.c2 ; - _ => np.s ! NotPossessed ! vps.c2 } ; + obj = case of { + => [] ; + _ => np.s ! NotPossessed ! vps.c2 } ; s = \\vf => -- If verb's subject case is Dat and object Nom, verb agrees with obj. - case of { - => vps.s ! np.objdef ! agr2vf np.agr; + case of { -- have_V2 needs its object possessed by the subject + => + let agr : Person*Number = case vf of { + VPres p n => ; + _ => } ; + in np.s ! Poss agr.p1 agr.p2 ! vps.c2 + ++ vps.s ! np.objdef ! agr2vf np.agr ; + + -- Default case: Verb agrees in person and number with subject _ => vps.s ! np.objdef ! vf } ; } ; From 61a3fe78b451a32328c68636687ac72d42c084e0 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 26 Apr 2020 21:17:14 +0200 Subject: [PATCH 51/84] (Hun) A2 can go before or after its complement --- src/hungarian/AdjectiveHun.gf | 8 ++++++-- src/hungarian/ParadigmsHun.gf | 8 ++++---- src/hungarian/ResHun.gf | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index 4a105d10a..a9fdefd6e 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -18,8 +18,12 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { } ; -- : A2 -> NP -> AP ; -- married to her - ComplA2 a2 np = PositA a2 ** { - compl = \\n => applyAdp a2.c2 np ; + ComplA2 a2 np = let ap : AP = PositA a2 in ap ** { + s = case a2.isPost of {False => ap.s ; _ => \\_,_ => []} ; + compl = \\n => applyAdp a2.c2 np + ++ case a2.isPost of { + True => ap.s ! n ! Nom ; + False => [] } ; } ; -- : A2 -> AP ; -- married to itself diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index b382baf3b..57c5101b3 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -158,13 +158,13 @@ oper } ; mkA2 = overload { - mkA2 : A -> A2 = \a -> a ** {c2 = casePrep Nom} ; + mkA2 : A -> A2 = \a -> a ** {c2 = casePrep Nom ; isPost = False} ; mkA2 : Str -> Prep -> A2 = \s,p -> - lin A2 ((mkAdj s) ** {c2 = p}) ; + lin A2 ((mkAdj s) ** {c2 = p ; isPost = False}) ; mkA2 : Str -> Case -> A2 = \s,c -> - lin A2 ((mkAdj s) ** {c2 = casePrep c}) ; + lin A2 ((mkAdj s) ** {c2 = casePrep c ; isPost = False}) ; mkA2 : A -> Prep -> A2 = \a,p -> - lin A2 (a ** {c2 = p}) ; + lin A2 (a ** {c2 = p ; isPost = False}) ; } ; mkV = overload { diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index bbaabd65a..441fb6066 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -318,6 +318,7 @@ oper Adjective2 : Type = Adjective ** { c2 : Adposition ; + isPost : Bool ; -- put adjective past the thing it modifies } ; mkAdj : Str -> Adjective = \sgnom -> mkAdj2 sgnom (mkNoun sgnom) ; From 52b99682e40db7aeba06c01bde999c1ad4ba99a9 Mon Sep 17 00:00:00 2001 From: Julia Jansson Date: Mon, 27 Apr 2020 12:19:31 +0200 Subject: [PATCH 52/84] changed dToll paradigm to fit more possesive forms --- src/hungarian/NounMorphoHun.gf | 69 +++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 9 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 4dd658241..09afdeff1 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -111,18 +111,43 @@ oper } } ; - -- Generic constructor for cases with different stem in Sg Nom and Sg Gen. - -- Assumes that Sg Gen and all plurals have genitive stem, others Sg Nom stem. - -- Handles also words like "madár, nyár, név, bogár" with shortened stem vowel in plural. + + -- Handles regular wovel ending words, with j added in possesive forms + -- Examples: "hajó, hajója, zseni, zsenije, kestyű, kestyűje" + dHajó : (nom : Str) -> (acc : Str) -> Noun = \hajó,hajót -> + let nHajó = mkNoun hajó ; + hajój = hajó + "j" ; + in nHajó ** { + s = \\nc => case nc of { + -- All plural forms and Sg Acc use the "tolla" stem + PlStem | PlAcc | SgAccStem => nHajó.s ! nc ; + + PossdSg_PossrPl1 => hajój + harm "u" "ü" ! nHajó.h ; + + PossdSg_PossrP3 => hajój ; + + -- The plural morpheme before possessive suffixes: madarai + PossdPl => hajó + harm "a" "e" ! nHajó.h + "i" ; + + -- The rest of the forms are formed with the regular constructor, + -- using "toll" as the stem. + _ => nHajó.s ! nc + } + } ; + + -- Handles many possesive forms dToll : (nom : Str) -> (acc : Str) -> Noun = \toll,tollat -> let tolla = init tollat ; nTolla = mkNoun tolla ; nToll = mkNoun toll ; - diákj : Str = case tolla of { - x + #v => x ; - x + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny"|"ssz" - |"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") => tolla ; - _ => tolla + "j" } ; + diákj = case ifTok Bool toll tolla True False of { + True => toll + "j" ; + False => case tolla of { + x + #v => x ; + x + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny"|"ssz" + |"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") => tolla ; + _ => tolla + "j" } + } ; in nTolla ** { s = \\nc => case nc of { -- All plural forms and Sg Acc use the "tolla" stem @@ -141,6 +166,29 @@ oper } } ; + -- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural. + dMadár : (nom : Str) -> (acc : Str) -> Noun = \madár,madarat -> + let madara = init madarat ; + nMadara = mkNoun madara ; + nMadár = mkNoun madár ; + in nMadara ** { + s = \\nc => case nc of { + -- All plural forms and Sg Acc use the "tolla" stem + PlStem | PlAcc | SgAccStem => nMadara.s ! nc ; + + PossdSg_PossrPl1 => madara + harm "u" "ü" ! nMadár.h ; + + PossdSg_PossrP3 => madara ; + + -- The plural morpheme before possessive suffixes: madarai + PossdPl => madara + harm "a" "e" ! nMadár.h + "i" ; + + -- The rest of the forms are formed with the regular constructor, + -- using "toll" as the stem. + _ => nMadár.s ! nc + } + } ; + -- More words not covered by current paradigms: -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf -- TODO: teher ~ terhet (consonant-crossing) @@ -192,7 +240,10 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> -- Stem 1: Sg Nom, Sg * - [Gen] -- Stem 2: Sg Gen, Pl * - _ => dToll n a -- Generic 2-argument constructor + <_ + "á" + #c, _ + "a" + #c + "at"> + |<_ + "é" + #c,_ + "e" + #c + "et"> => dMadár n a ; + + _ => dToll n a } ; -- 1-argument smart paradigm From 9e57766263e1574555ded983765973d6a8df5778 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 27 Apr 2020 13:00:24 +0200 Subject: [PATCH 53/84] (Hun) Use regNoun in mkAdj --- src/hungarian/ResHun.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 441fb6066..89debf332 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -321,7 +321,7 @@ oper isPost : Bool ; -- put adjective past the thing it modifies } ; - mkAdj : Str -> Adjective = \sgnom -> mkAdj2 sgnom (mkNoun sgnom) ; + mkAdj : Str -> Adjective = \sgnom -> mkAdj2 sgnom (regNoun sgnom) ; mkAdj2 : Str -> Noun -> Adjective = \sgnom,adjAsNoun -> adjAsNoun ** { From 8e0a3095c0ef4be9b52bea7735039db368f8acef Mon Sep 17 00:00:00 2001 From: aarneranta Date: Mon, 27 Apr 2020 14:19:07 +0200 Subject: [PATCH 54/84] removed vocative case from Slovak --- src/slovak/NounSlo.gf | 5 ++-- src/slovak/ParadigmsSlo.gf | 2 -- src/slovak/PhraseSlo.gf | 2 +- src/slovak/ResSlo.gf | 53 ++++++++++++++++---------------------- 4 files changed, 25 insertions(+), 37 deletions(-) diff --git a/src/slovak/NounSlo.gf b/src/slovak/NounSlo.gf index 2e60e38a8..d888c4ce1 100644 --- a/src/slovak/NounSlo.gf +++ b/src/slovak/NounSlo.gf @@ -29,7 +29,7 @@ lin UsePron pron = { s = table { - Nom | Voc => pron.nom ; + Nom => pron.nom ; Gen => pron.gen ; Dat => pron.dat ; Acc => pron.acc ; @@ -38,7 +38,6 @@ lin } ; clit = table { Nom => pron.cnom ; - Voc => pron.nom ; Gen => pron.cgen ; Dat => pron.cdat ; Acc => pron.cacc ; @@ -46,7 +45,7 @@ lin Ins => pron.ins } ; prep = table { - Nom | Voc => pron.nom ; + Nom => pron.nom ; Gen => pron.pgen ; Dat => pron.pdat ; Acc => pron.pacc ; diff --git a/src/slovak/ParadigmsSlo.gf b/src/slovak/ParadigmsSlo.gf index 542d3a931..3b8b86a11 100644 --- a/src/slovak/ParadigmsSlo.gf +++ b/src/slovak/ParadigmsSlo.gf @@ -26,8 +26,6 @@ oper = Dat ; accusative : Case = Acc ; - vocative : Case - = ResSlo.Voc ; locative : Case = Loc ; instrumental : Case diff --git a/src/slovak/PhraseSlo.gf b/src/slovak/PhraseSlo.gf index 4510ff084..5fce3c4d7 100644 --- a/src/slovak/PhraseSlo.gf +++ b/src/slovak/PhraseSlo.gf @@ -14,6 +14,6 @@ lin PConjConj conj = {s = conj.s2} ; NoVoc = {s = []} ; - VocNP np = {s = np.s ! Voc} ; + VocNP np = {s = np.s ! Nom} ; } diff --git a/src/slovak/ResSlo.gf b/src/slovak/ResSlo.gf index be2179529..9ac785c05 100644 --- a/src/slovak/ResSlo.gf +++ b/src/slovak/ResSlo.gf @@ -13,7 +13,7 @@ param Animacy = Anim | Inanim ; Gender = Masc Animacy | Fem | Neutr ; - Case = Nom | Gen | Dat | Acc | Voc | Loc | Ins ; -- traditional order + Case = Nom | Gen | Dat | Acc | Loc | Ins ; -- traditional order Person = P1 | P2 | P3 ; @@ -101,7 +101,7 @@ oper -- so this is the lincat of N - NounForms : Type = {snom,sgen,sdat,sacc,svoc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ; g : Gender} ; + NounForms : Type = {snom,sgen,sdat,sacc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ; g : Gender} ; -- But traditional tables make agreement easier to handle in syntax -- so this is the lincat of CN @@ -118,12 +118,11 @@ oper Gen => forms.sgen ; Dat => forms.sdat ; Acc => forms.sacc ; - Voc => forms.svoc ; Loc => forms.sloc ; Ins => forms.sins } ; Pl => table { - Nom | Voc => forms.pnom ; + Nom => forms.pnom ; Gen => forms.pgen ; Dat => forms.pdat ; Acc => forms.pacc ; @@ -183,7 +182,6 @@ oper 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é @@ -202,7 +200,6 @@ oper sgen = predsed + "y" ; -- pacc,pins --- i sdat,sloc = predsed + "ovi" ; sacc = predsed + "u" ; - svoc = predsed + "o" ; sins = predsed + "ou" ; pnom = case predseda of { @@ -223,7 +220,6 @@ oper 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" ; @@ -241,7 +237,6 @@ oper 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 @@ -256,7 +251,7 @@ oper let mest = init mesto in { - snom,sacc,svoc = mesto ; + snom,sacc = mesto ; sgen = mest + "a" ; sdat = mest + "u" ; sloc = mest + "u" ; --- "ě" @@ -277,10 +272,6 @@ oper 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 { @@ -299,7 +290,7 @@ oper let soudc = init soudce in { - snom,sgen,sacc,svoc = soudce ; ---- pacc + snom,sgen,sacc = soudce ; ---- pacc sdat,sloc = soudc + "i" ; --- soudcovi sins = soudc + "em" ; @@ -316,7 +307,7 @@ oper { snom,sacc = stroj ; sgen = stroj + "e" ; --- pnom,pacc - sdat,svoc,sloc = stroj + "i" ; --- pins ---- svoc shorten? + sdat,sloc = stroj + "i" ; --- pins sins = stroj + "em" ; pnom,pacc = stroj + "e" ; @@ -331,7 +322,7 @@ oper let ruz = init ruze in { - snom,sgen,svoc = ruze ; --- pnom,pacc + snom,sgen = ruze ; --- pnom,pacc sdat,sacc,sloc = ruz + "i" ; sins = ruz + "í" ; @@ -349,7 +340,7 @@ oper { snom,sacc = pisen ; sgen = pisn + "ě" ; - sdat,svoc,sloc = pisn + "i" ; -- not shortened + sdat,sloc = pisn + "i" ; -- not shortened sins = pisn + "í" ; pnom,pacc = pisn + "ě" ; @@ -363,7 +354,7 @@ oper declKOST : DeclensionType = \kost -> { snom,sacc = kost ; - sgen,sdat,svoc,sloc = kost + "i" ; --- pnom,pacc + sgen,sdat,sloc = kost + "i" ; --- pnom,pacc sins = kost + "í" ; --- pgen pnom,pacc = kost + "i" ; @@ -378,7 +369,7 @@ oper let kur = init kure in { - snom,sacc,svoc = kure ; + snom,sacc = kure ; sgen = kur + "ete" ; sdat,sloc = kur + "eti" ; sins = kur + "etem" ; @@ -395,7 +386,7 @@ oper let mor = init more in { - snom,sgen,sacc,svoc = more ; --- pnom + snom,sgen,sacc = more ; --- pnom sdat,sloc = mor + "i" ; --- pins sins = mor + "em" ; @@ -409,7 +400,7 @@ oper declSTAVENI : DeclensionType = \staveni -> { - snom,sgen,sdat,sacc,svoc,sloc = staveni ; + snom,sgen,sdat,sacc,sloc = staveni ; sins = staveni + "m" ; pnom,pgen,pacc = staveni ; @@ -429,14 +420,14 @@ oper ---- TODO other degrees than positive AdjForms : Type = { - msnom, fsnom, nsnom : Str ; -- svoc = snom + msnom, fsnom, nsnom : Str ; 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 + mpnom,fpnom : Str ; -- impnom = fpnom, npnom = fsnom pgen : Str ; -- ploc = pgen pins : Str ; } ; @@ -446,11 +437,11 @@ oper adjFormsAdjective : AdjForms -> Adjective = \afs -> { s = \\g,n,c => case of { - + | => afs.msnom ; - - | => afs.fsnom ; - => afs.nsnom ; + + | => afs.fsnom ; + => afs.nsnom ; | => afs.msgen ; @@ -468,8 +459,8 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { | => afs.msins ; => afs.fsins ; - => afs.mpnom ; - => afs.fpnom ; + => afs.mpnom ; + => afs.fpnom ; => afs.pgen ; => afs.pins @@ -772,14 +763,14 @@ oper kdoForms : Case => Str = table { Nom => "kdo" ; - Gen | Acc | Voc => "koho" ; + Gen | Acc => "koho" ; Dat => "komu" ; Loc => "kom" ; Ins => "kým" } ; coForms : Case => Str = table { - Nom|Acc|Voc => "co" ; + Nom|Acc => "co" ; Gen => "čeho" ; Dat => "čemu" ; Loc => "čem" ; From 6f2cc8af964d2babcdf0b6074c242d9a05d352d7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 27 Apr 2020 17:18:19 +0200 Subject: [PATCH 55/84] =?UTF-8?q?(Hun)=20Small=20fixes=20in=20nMad=C3=A1r?= =?UTF-8?q?=20with=20possessive=20stems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/NounMorphoHun.gf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 4fa9e5d19..f6726703f 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -169,6 +169,7 @@ oper -- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural. dMadár : (nom : Str) -> (acc : Str) -> Noun = \madár,madarat -> let madara = init madarat ; + madar = init madara ; nMadara = mkNoun madara ; nMadár = mkNoun madár ; in nMadara ** { @@ -176,12 +177,12 @@ oper -- All plural forms and Sg Acc use the "tolla" stem PlStem | PlAcc | SgAccStem => nMadara.s ! nc ; - PossdSg_PossrPl1 => madara + harm "u" "ü" ! nMadár.h ; + PossdSg_PossrPl1 => madar + harm "u" "ü" ! nMadara.h ; - PossdSg_PossrP3 => madara ; + PossdSg_PossrP3 => madar ; -- The plural morpheme before possessive suffixes: madarai - PossdPl => madara + harm "a" "e" ! nMadár.h + "i" ; + PossdPl => madara + "i" ; -- The rest of the forms are formed with the regular constructor, -- using "toll" as the stem. @@ -241,7 +242,7 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> -- Stem 1: Sg Nom, Sg * - [Gen] -- Stem 2: Sg Gen, Pl * <_ + "á" + #c, _ + "a" + #c + "at"> - |<_ + "é" + #c,_ + "e" + #c + "et"> => dMadár n a ; + |<_ + "é" + #c,_ + "e" + #c + ("et"|"at")> => dMadár n a ; _ => dToll n a } ; From fd6541846fc9e7f5eef7f44d89c42a8bece8c6c8 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 27 Apr 2020 17:18:48 +0200 Subject: [PATCH 56/84] (Hun) Remove some stem changing paradigms from 1-argument regNoun --- src/hungarian/NounMorphoHun.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index f6726703f..72354b61f 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -254,8 +254,8 @@ regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> -- Words like nyár, név need to use 2-arg smart paradigm (#c|"")+("á"|"é")+ #c => mkNoun sgnom ; _ + ("á"|"é") + #c => dToll sgnom (név2nevet sgnom) ; - _ + ("ó"|"é"|"ő"|"ű") => dLó sgnom (ló2lovat sgnom) ; - _ + #v + #c + #v + #c => dMajom sgnom (majom2majmo 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 -> From 5f6db5118389e47770c7ab2dd72eade598f5994d Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 27 Apr 2020 17:19:18 +0200 Subject: [PATCH 57/84] (Hun) Rename some parameters + add show funs for param names --- src/hungarian/NounHun.gf | 4 ++-- src/hungarian/NounMorphoHun.gf | 2 +- src/hungarian/ParamHun.gf | 41 +++++++++++++++++++++++++++++++++- src/hungarian/PhraseHun.gf | 2 +- src/hungarian/ResHun.gf | 4 ++-- src/hungarian/VerbHun.gf | 6 ++--- 6 files changed, 49 insertions(+), 10 deletions(-) diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index 3698ef6ba..c4a972773 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -18,7 +18,7 @@ concrete NounHun of Noun = CatHun ** open } ++ case of { <_, DetPoss _> => possessed ; - + => standalone ; => let pron : Pronoun = pronTable ! ; -- Possessor's number @@ -228,7 +228,7 @@ concrete NounHun of Noun = CatHun ** open -- : CN -> NP -> CN ; -- city Paris (, numbers x and y) ApposCN cn np = cn ** { - compl = \\n,c => cn.compl ! n ! c ++ np.s ! NotPossessed ! Nom + compl = \\n,c => cn.compl ! n ! c ++ np.s ! NoPoss ! Nom } ; --2 Possessive and partitive constructs diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 72354b61f..8abdb44eb 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -146,7 +146,7 @@ oper x + #v => x ; x + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny"|"ssz" |"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") => tolla ; - _ => tolla + "j" } + _ => tolla + "j" } } ; in nTolla ** { s = \\nc => case nc of { diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index dd396ddf3..d309857d3 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -101,7 +101,7 @@ param SubjCase = SCNom | SCDat ; -- Limited set of subject cases - Possessor = NotPossessed | Poss Person Number ; + Possessor = NoPoss | Poss Person Number ; oper @@ -129,6 +129,45 @@ oper SCDat => Dat } ; + case2str : Case -> Str = \c -> case c of { + Nom => "Nom" ; + Acc => "Acc" ; + Dat => "Dat" ; + Ins => "Ins" ; + Tra => "Tra" ; + Sup => "Sup" ; + Ine => "Ine" ; + Ela => "Ela" ; + All => "All" ; + Ade => "Ade" ; + Abl => "Abl" ; + Sub => "Sub" ; + Del => "Del" ; + Ill => "Ill" ; + Cau => "Cau" } ; + + ncstem2str : NumCaseStem -> Str = \nc -> case nc of { + SgNom => "SgNom" ; + SgAccStem => "SgAccStem" ; + SgSup => "SgSup" ; + PlAcc => "PlAcc" ; + SgInsStem => "SgInsStem" ; + SgStem => "SgStem" ; + PlStem => "PlStem" ; + PossdSg_PossrP3 => "PossdSg_PossrP3" ; + PossdSg_PossrPl1 => "PossdSg_PossrPl1" ; + PossdPl => "PossdPl" + } ; + + possessor2str : Possessor -> Str = \p -> case p of { + NoPoss => "NoPoss" ; + Poss P1 Sg => "Poss P1 Sg" ; + Poss P2 Sg => "Poss P2 Sg" ; + Poss P3 Sg => "Poss P3 Sg" ; + Poss P1 Pl => "Poss P1 Pl" ; + Poss P2 Pl => "Poss P2 Pl" ; + Poss P3 Pl => "Poss P3 Pl" + } ; -------------------------------------------------------------------------------- -- Numerals diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 8cc417d97..e31d338b3 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -12,7 +12,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { UttImpPol = UttImpSg ; -} UttIP, - UttNP = \np -> {s = np.s ! NotPossessed ! Nom} ; + UttNP = \np -> {s = np.s ! NoPoss ! Nom} ; UttVP vp = {s = vp.obj ++ vp.adv ++ vp.s ! VInf} ; UttAdv adv = adv ; UttCN cn = {s = linCN cn} ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 89debf332..b61e5be2f 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -271,7 +271,7 @@ oper emptyAdp : Adposition = nomAdp [] ; applyAdp : Adposition -> NounPhrase -> Str = \adp,np -> - adp.pr ++ np.s ! NotPossessed ! adp.c ++ adp.s ; + adp.pr ++ np.s ! NoPoss ! adp.c ++ adp.s ; applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; @@ -501,7 +501,7 @@ oper s = \\t,a,p => let subjcase : Case = case vp.sc of { SCNom => Nom ; SCDat => Dat } - in np.s ! NotPossessed ! subjcase + in np.s ! NoPoss ! subjcase ++ if_then_Pol p [] "nem" ++ vp.s ! agr2vf np.agr ++ vp.obj -- ! np.agr diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 06cf22441..ef21c0631 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -133,8 +133,8 @@ lin -- : NP -> Comp ; CompNP np = UseCopula ** { s = \\vf => case vf of { - VPres P3 _ => np.s ! NotPossessed ! Nom ; - _ => np.s ! NotPossessed ! Nom ++ copula.s ! vf } ; + VPres P3 _ => np.s ! NoPoss ! Nom ; + _ => np.s ! NoPoss ! Nom ++ copula.s ! vf } ; } ; -- : Adv -> Comp ; @@ -149,7 +149,7 @@ oper insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { obj = case of { => [] ; - _ => np.s ! NotPossessed ! vps.c2 } ; + _ => np.s ! NoPoss ! vps.c2 } ; s = \\vf => -- If verb's subject case is Dat and object Nom, verb agrees with obj. From b4fac5bd7593ad3f0aa7337ade2b405c9bd0119f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 27 Apr 2020 20:48:26 +0200 Subject: [PATCH 58/84] (Hun) Some fixes in lexicon --- src/hungarian/LexiconHun.gf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 211e321b8..cd6d9d54a 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -133,7 +133,7 @@ lin floor_N = mkN "padló" "padlót" ; lin flower_N = mkN "virág" "virágot" ; lin fly_V = mkV "repül" ; lin fog_N = mkN "köd" "ködöt"; -- TODO ködöket -lin foot_N = mkN "láb" "lábot"; --same as leg, to specify "lábfej" +lin foot_N = leg_N ; --same as leg, to specify "lábfej" lin forest_N = mkN "erdő" "erdőt" ; -- lin forget_V2 = mkV2 "" ; -- lin freeze_V = mkV "" ; @@ -207,7 +207,7 @@ lin leaf_N = mkN "levél" "levelet"; -- lin learn_V2 = mkV2 "" ; lin leather_N = mkN "bőr" "bőrt"; -- lin leave_V2 = mkV2 "" ; -lin leg_N = mkN "láb" "lábot"; +lin leg_N = mkN "láb" "lábat"; -- lin lie_V = mkV "" ; -- lin like_V2 = mkV2 "" ; -- lin listen_V2 = mkV2 "" ; @@ -280,7 +280,7 @@ lin rain_N = mkN "eső" "esőt" ; lin ready_A = mkA "kész" ; lin reason_N = mkN "ok" "okot" ; lin red_A = mkA "piros" ; -lin religion_N = mkN "vallás" "vallásot"; +lin religion_N = mkN "vallás" "vallást"; lin restaurant_N = mkN "étterem" "éttermet"; lin river_N = mkN "folyó" "folyót" ; lin road_N = mkN "út" "utat" ; From 95eb7104c858af43329b4e9bc66b23b4a938dc16 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 27 Apr 2020 20:50:14 +0200 Subject: [PATCH 59/84] (Hun) Better guesses for PossdSg_PossrP3 stem in dToll --- src/hungarian/NounMorphoHun.gf | 47 ++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 8abdb44eb..0692d3e57 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -126,8 +126,8 @@ oper PossdSg_PossrP3 => hajój ; - -- The plural morpheme before possessive suffixes: madarai - PossdPl => hajó + harm "a" "e" ! nHajó.h + "i" ; + -- The plural morpheme before possessive suffixes: hajói + PossdPl => hajó + "i" ; -- The rest of the forms are formed with the regular constructor, -- using "toll" as the stem. @@ -140,25 +140,46 @@ oper let tolla = init tollat ; nTolla = mkNoun tolla ; nToll = mkNoun toll ; - diákj = case ifTok Bool toll tolla True False of { - True => toll + "j" ; - False => case tolla of { - x + #v => x ; - x + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny"|"ssz" - |"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") => tolla ; - _ => tolla + "j" } - } ; + napj = case andB (ifTok Bool toll tolla True False) + (notB (vowFinal tolla)) of { + True => toll ; -- sör, sör|t -> sör|e + -- király, király|t -> király|a + -- TODO fails for plafon, papír + False => case tolla of { + -- hegy, hegy|et -> hegy|e + _ + ("ty"|"gy"|"ny"|"j"|"ly"|"m"|"h") + ("e"|"a"|"ö"|"o") => init tolla ; + + -- ház, ház|at -> ház|a + _ + #c + ("a"|"e") => init tolla ; + + -- orr, orr|ot -> orr|a + -- TODO fails for gyümölcs, gyümölcs|öt -> gyümölcs|e + -- I don't know what this list means /IL + _ + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l" + |"r"|"n"|"ny"|"ssz"|"zz"|"ss" + |"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") + ("o"|"ö") => init tolla ; + + -- nap, nap|ot -> napj|a + -- bank, bank|ot -> bankj|a + -- kabát, kabát|ot -> kabátj|a (diák, barát, újság …) + -- NB. fails for virág, ország (virág|ot -> virág|a, ország|ot -> ország|a) + _ + #c + ("o"|"ö") => init tolla + "j" ; + + -- háború, háború|t -> háborúj|a + _ => tolla + "j" } + } ; + in nTolla ** { s = \\nc => case nc of { -- All plural forms and Sg Acc use the "tolla" stem PlStem | PlAcc | SgAccStem => nTolla.s ! nc ; - PossdSg_PossrPl1 => diákj + harm "u" "ü" ! nToll.h ; + PossdSg_PossrPl1 => napj + harm "u" "ü" ! nToll.h ; - PossdSg_PossrP3 => diákj ; + PossdSg_PossrP3 => napj ; -- The plural morpheme before possessive suffixes: madarai - PossdPl => diákj + harm "a" "e" ! nToll.h + "i" ; + PossdPl => napj + harm "a" "e" ! nToll.h + "i" ; -- The rest of the forms are formed with the regular constructor, -- using "toll" as the stem. From 6cbcbd99fb91eaa95a31db1bd280aa5da36e6080 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 27 Apr 2020 21:15:43 +0200 Subject: [PATCH 60/84] (Hun) Add new paradigms and a 4-arg smart paradigm --- src/hungarian/LexiconHun.gf | 6 +- src/hungarian/NounMorphoHun.gf | 126 +++++++++++++++++++++------------ src/hungarian/ParadigmsHun.gf | 11 ++- 3 files changed, 91 insertions(+), 52 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index cd6d9d54a..86ae37814 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -37,7 +37,7 @@ lin black_A = mkA "fekete" ; lin blood_N = mkN "vér" "vért"; -- lin blow_V = mkV "" ; lin blue_A = mkA "kék" ; -lin boat_N = mkN "hajó" "hajót" ; +lin boat_N = mkN "hajó" "hajót" "hajók" "hajója" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; @@ -130,7 +130,7 @@ lin fish_N = mkN "hal" "halat" ; -- lin float_V = mkV "" ; lin floor_N = mkN "padló" "padlót" ; -- lin flow_V = mkV "" ; -lin flower_N = mkN "virág" "virágot" ; +lin flower_N = mkN "virág" "virágot" "virágok" "virága" ; lin fly_V = mkV "repül" ; lin fog_N = mkN "köd" "ködöt"; -- TODO ködöket lin foot_N = leg_N ; --same as leg, to specify "lábfej" @@ -285,7 +285,7 @@ lin restaurant_N = mkN "étterem" "éttermet"; lin river_N = mkN "folyó" "folyót" ; lin road_N = mkN "út" "utat" ; lin rock_N = mkN "szikla" "sziklát"; -lin roof_N = mkN "plafon" "plafont" ; +lin roof_N = mkN "plafon" "plafont" "plafonok" "plafonja" ; lin root_N = mkN "gyökér" "gyökeret"; lin rope_N = mkN "kötél" "kötelet"; -- lin rotten_A = mkA "" ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 0692d3e57..1f7bcd0b4 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -116,25 +116,47 @@ oper -- Examples: "hajó, hajója, zseni, zsenije, kestyű, kestyűje" dHajó : (nom : Str) -> (acc : Str) -> Noun = \hajó,hajót -> let nHajó = mkNoun hajó ; - hajój = hajó + "j" ; in nHajó ** { s = \\nc => case nc of { - -- All plural forms and Sg Acc use the "tolla" stem - PlStem | PlAcc | SgAccStem => nHajó.s ! nc ; + PossdSg_PossrPl1 => hajó ; - PossdSg_PossrPl1 => hajój + harm "u" "ü" ! nHajó.h ; - - PossdSg_PossrP3 => hajój ; + PossdSg_PossrP3 => hajó + "j" ; -- The plural morpheme before possessive suffixes: hajói PossdPl => hajó + "i" ; - -- The rest of the forms are formed with the regular constructor, - -- using "toll" as the stem. + -- The rest of the forms are formed with the regular constructor _ => nHajó.s ! nc } } ; + -- Unexpected j after consonant + dPlafon : (nom : Str) -> (acc : Str) -> Noun = \plafon,plafont -> + let nPlafon = mkNoun plafon ; + h = nPlafon.h ; + in nPlafon ** { + s = \\nc => case nc of { + PossdSg_PossrPl1 => plafon + harm "u" "ü" ! h ; + PossdSg_PossrP3 => plafon + "j" ; + PossdPl => plafon + harm "jai" "jei" ! h ; + + -- The rest of the forms are formed with the regular constructor + _ => nPlafon.s ! nc + } + } ; + + -- Opposite to dHajó: regular paradigm puts j, but these words don't have it. + dVirág : (nom : Str) -> (acc : Str) -> Noun = \virág,virágot -> + let nVirág = mkNoun virág ; + h = nVirág.h ; + in nVirág ** { + s = \\nc => case nc of { + PossdSg_PossrPl1 => virág + harm "u" "ü" ! h ; + PossdSg_PossrP3 => virág ; + PossdPl => virág + harm "a" "e" ! h + "i" ; + _ => nVirág.s ! nc } + } ; + -- Handles many possesive forms dToll : (nom : Str) -> (acc : Str) -> Noun = \toll,tollat -> let tolla = init tollat ; @@ -218,55 +240,67 @@ oper -- All regNoun* are /smart paradigms/: they take one or a couple of forms, -- and decides which (non-smart) paradigm is the most likely to match. -regNounNomAccPl : (nomsg, accsg, nompl : Str) -> Noun = \nsg,asg,npl -> - case of { - <_ + ("u"|"ú"|"ü"|"ű"|"ó"), -- falu, falut, falvak ; szó, szót, szavak - _ + ("u"|"ú"|"ü"|"ű"|"ó") + "t", - _ + "v" + #v + "k"> => dFalu nsg npl ; + regNoun4 : (nomsg, accsg, nompl, possdSg_possrP3sg : Str) -> Noun = + \nsg,asg,npl,possd -> case possd of { + _ + #v + "j" + ("a"|"e") => dHajó nsg asg ; + _ + #c + "j" + ("a"|"e") => dPlafon nsg asg ; - -- Fall back to 2-argument smart paradigm - _ => regNounNomAcc nsg asg - } ; + _ + #c + ("a"|"e") => dVirág nsg asg ; -regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> - case of { - -- Stem 1: Sg Nom - -- Stem 2: Everything else - -- alma, almát - <_ + "a", _ + "át"> - |<_ + "e" ,_ + "ét"> => dAlma n a ; + -- Fall back to 3-argument smart paradigm + _ => regNounNomAccPl nsg asg npl + } ; - -- Stem 1: Sg Nom - -- Stem 2: Sg Gen, Sg Sup, Pl * - <_ + #shortv + #c, -- majom, majmot - _ + #c + #shortv + "t"> => dMajom n a ; + regNounNomAccPl : (nomsg, accsg, nompl : Str) -> Noun = \nsg,asg,npl -> + case of { + <_ + ("u"|"ú"|"ü"|"ű"|"ó"), -- falu, falut, falvak ; szó, szót, szavak + _ + ("u"|"ú"|"ü"|"ű"|"ó") + "t", + _ + "v" + #v + "k"> => dFalu nsg npl ; - -- Stem 1: Sg Nom - -- Stem 2: Sg Sup - -- Stem 3: Sg Gen, Pl * - <_ + "ó", -- ló, lovat - _ + "o" + #c + #v + "t"> + -- Fall back to 2-argument smart paradigm + _ => regNounNomAcc nsg asg + } ; - |<_ + "ó", -- tó, tavat - _ + "a" + #c + #v + "t"> + regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a -> + case of { - |<_ + "ő", -- kő, követ - _ + "ö" + #c + #v + "t"> + -- Stem 1: Sg Nom + -- Stem 2: Everything else + -- alma, almát + <_ + "a", _ + "át"> + |<_ + "e" ,_ + "ét"> => dAlma n a ; - |<_ + "ű", -- fű, füvet - _ + "ü" + #c + #v + "t"> + -- Stem 1: Sg Nom + -- Stem 2: Sg Gen, Sg Sup, Pl * + <_ + #shortv + #c, -- majom, majmot + _ + #c + #shortv + "t"> => dMajom n a ; - |<_ + "é", -- lé, levet - _ + "e" + #c + #v + "t"> => dLó n a ; + -- Stem 1: Sg Nom + -- Stem 2: Sg Sup + -- Stem 3: Sg Gen, Pl * + <_ + "ó", -- ló, lovat + _ + "o" + #c + #v + "t"> - -- Stem 1: Sg Nom, Sg * - [Gen] - -- Stem 2: Sg Gen, Pl * - <_ + "á" + #c, _ + "a" + #c + "at"> - |<_ + "é" + #c,_ + "e" + #c + ("et"|"at")> => dMadár n a ; + |<_ + "ó", -- tó, tavat + _ + "a" + #c + #v + "t"> - _ => dToll n a - } ; + |<_ + "ő", -- kő, követ + _ + "ö" + #c + #v + "t"> + + |<_ + "ű", -- fű, füvet + _ + "ü" + #c + #v + "t"> + + |<_ + "é", -- lé, levet + _ + "e" + #c + #v + "t"> => dLó n a ; + + -- Stem 1: Sg Nom, Sg * - [Gen] + -- Stem 2: Sg Gen, Pl * + <_ + "á" + #c, _ + "a" + #c + "at"> + |<_ + "é" + #c,_ + "e" + #c + ("et"|"at")> => dMadár n a ; + + _ => dToll n a + } ; -- 1-argument smart paradigm -- Here we guess the genitive form and give it to appropriate 2-arg paradigm diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 57c5101b3..543288e30 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -18,9 +18,11 @@ oper --2 Nouns mkN : overload { - mkN : (sgnom : Str) -> N ; -- Predictable nouns from singular nominative. Accusative vowel is o for back harmony. No stem lowering (TODO better explanation/examples) - mkN : (sgnom, sggen : Str) -> N ; -- Singular nominative and accusative. Takes care of cases like … TODO example - mkN : (sgnom, sggen, plnom : Str) -> N ; -- Singular nominative, singular accusative, plural nominative, e.g. `mkN "falu" "falut" "falvak"` + mkN : (sgnom : Str) -> N ; -- Predictable nouns from singular nominative. Accusative vowel is o/ö, no stem lowering. Use: `mkN "nap"` for nap, napot. + mkN : (sgnom, sggen : Str) -> N ; -- Singular nominative and accusative. Use: `mkN "név" "nevet"` + mkN : (sgnom, sggen, plnom : Str) -> N ; -- Singular nominative, singular accusative, plural nominative. Use: `mkN "falu" "falut" "falvak"` + mkN : (sgnom, sggen, plnom, sgnom_possdSg3 : Str) -> N ; -- Singular nominative, singular accusative, plural nominative, singular nominative possessed by 3rd person singular. Use: `mkN "virág" "virágot" "virágok" "virága"` (would give "virágja" otherwise) + mkN : (férfi : Str) -> (harm : Harmony) -> (ak : Str) -> N ; -- Noun with unpredictable vowel harmony and plural allomorph } ; @@ -130,6 +132,9 @@ oper mkN : Str -> Str -> Str -> N = \n,a,pln-> lin N (regNounNomAccPl n a pln) ; + mkN : (x1,_,_,x4 : Str) -> N = + \n,a,pln,possd -> lin N (regNoun4 n a pln possd) ; + mkN : Str -> Harmony -> N = \s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ; From 4d9f7e929d5e50746bbae5c0bc75a73d9ecf13b2 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Tue, 28 Apr 2020 08:46:42 +0200 Subject: [PATCH 61/84] first version of Slovak noun paradigms --- src/slovak/ResSlo.gf | 427 ++++++++++++++++++++++++------------------- 1 file changed, 243 insertions(+), 184 deletions(-) diff --git a/src/slovak/ResSlo.gf b/src/slovak/ResSlo.gf index 9ac785c05..cb4b0765a 100644 --- a/src/slovak/ResSlo.gf +++ b/src/slovak/ResSlo.gf @@ -25,7 +25,7 @@ param oper hardConsonant : pattern Str = #("d"|"t"|"g"|"h"|"k"|"n"|"r") ; - softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"ř"|"š"|"c"|"č"|"ž") ; + softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"š"|"c"|"č"|"ž"|"ľ"|"ĺ"|"ŕ"|"dz") ; neutralConsonant : pattern Str = #("b"|"f"|"l"|"m"|"p"|"s"|"v") ; consonant : pattern Str = @@ -93,6 +93,9 @@ oper -- Nouns --------------- +-- https://en.wikipedia.org/wiki/Slovak_declension +-- http://www.angelfire.com/sk3/quality/Slovak_declension.html + -- novel idea (for RGL): lexical items stored as records rather than tables -- advantages: -- - easier to make exceptions to paradigms (by ** {}) @@ -133,14 +136,17 @@ oper g = forms.g } ; + -- terminology of CEG DeclensionType : Type = Str -> NounForms ; +{- ----- declensionNounForms : (nom,gen : Str) -> Gender -> NounForms = \nom,gen,g -> let decl : DeclensionType = case of { - => declPAN ; - => declPREDSEDA ; + => declHRDINA ; + + => declCHLAP ; => declHRAD ; => declZENA ; => declMESTO ; @@ -173,243 +179,296 @@ oper _ + "í" => 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 +-- they are also exported in ParadigmsSlo with names chlapN etc - declPAN : DeclensionType = \pan -> --- plural nom ové|i|é can be changed with ** {pnom = ...} CEG 3.5.1 + chlapN : DeclensionType = \chlap -> { - snom = pan ; - sgen,sacc = pan + "a" ; - sdat,sloc = pan + "ovi" ; --- pánu - sins = pan + "em" ; + snom = chlap ; + sgen,sacc = chlap + "a" ; + sdat,sloc = chlap + "ovi" ; + sins = chlap + "om" ; - pnom = addI pan ; -- pani, kluk-kluci --- panové, host-hosté - pgen = pan + "ů" ; - pdat = pan + "ům" ; - pacc,pins = pan + "y" ; - ploc = addEch pan ; + pnom = chlap + "i" ; + pgen,pacc = chlap + "ov" ; + pdat = chlap + "om" ; + ploc = chlap + "och" ; + pins = chlap + "mi" ; g = Masc Anim } ; - declPREDSEDA : DeclensionType = \predseda -> --- 3.5.4: sgen y/i - let predsed = init predseda + hrdinaN : DeclensionType = \hrdina -> + let hrdin = init hrdina in { - snom = predseda ; - sgen = predsed + "y" ; -- pacc,pins --- i - sdat,sloc = predsed + "ovi" ; - sacc = predsed + "u" ; - sins = predsed + "ou" ; + snom = hrdina ; + sgen,sacc = hrdin + "u" ; + sdat,sloc = hrdin + "ovi" ; + sins = hrdin + "om" ; + + pnom = hrdin + "ovia" ; + pgen,pacc = hrdin + "ov" ; + pdat = hrdin + "om" ; + ploc = hrdin + "och" ; + pins = hrdin + "ami" ; - pnom = case predseda of { - tur + "ista" => tur + "isté" ; - _ => predsed + "ové" - } ; - pgen = predsed + "ů" ; - pdat = predsed + "ům" ; - pacc,pins = predsed + "y" ; - ploc = addEch predsed ; g = Masc Anim } ; - - declHRAD : DeclensionType = \hrad -> --- 3.5.2: sloc u/ě/e extra arg, sport-u, hrad-ě ; sgen u/a - let hrd = dropFleetingE hrad - in + + dubN : DeclensionType = \dub -> { - snom,sacc = hrad ; - sgen,sdat = hrd + "u" ; --- Berlín-a - sloc = hrd + "u" ; --- addE hrad ; -- stůl-stole - sins = hrd + "em" ; + snom = dub ; + sgen = dub + "a" ; + sdat = dub + "u" ; + sacc = dub + "" ; + sloc = dub + "e" ; + sins = dub + "om" ; + + pnom = dub + "y" ; + pgen = dub + "ov" ; + pdat = dub + "om" ; + pacc = dub + "y" ; + ploc = dub + "och" ; + pins = dub + "mi" ; - pnom,pacc,pins = hrd + "y" ; - pgen = hrd + "ů" ; - pdat = hrd + "ům" ; - ploc = addEch hrd ; g = Masc Inanim } ; - declZENA : DeclensionType = \zena -> --- 3.6.1 sge y/i ; pgen sometimes shortening - let zen = init zena + strojN : DeclensionType = \stroj -> + { + snom = stroj ; + sgen = stroj + "a" ; + sdat = stroj + "u" ; + sacc = stroj + "" ; + sloc = stroj + "i" ; + sins = stroj + "om" ; + + pnom = stroj + "e" ; + pgen = stroj + "ov" ; + pdat = stroj + "om" ; + pacc = stroj + "e" ; + ploc = stroj + "och" ; + pins = stroj + "mi" ; + + g = Masc Inanim + } ; + +-- "fifth type" + ponyN : DeclensionType = \pony -> + { + snom = pony ; + sgen = pony + "ho" ; + sdat = pony + "mu" ; + sacc = pony + "ho" ; + sloc = pony + "m" ; + sins = pony + "m" ; + + pnom = pony + "ovia" ; + pgen = pony + "ov" ; + pdat = pony + "om" ; + pacc = pony + "ov" ; + ploc = pony + "och" ; + pins = pony + "mi" ; + + g = Masc Anim + } ; + + zenaN : DeclensionType = \zena -> + let + zen = init zena ; + zien : Str = case zen of { + z + "e" + c@? => z + "ie" + c ; + _ => zen ---- TODO: many more rules + } in { snom = zena ; - sgen = zen + "y" ; --- i after soft cons sometimes - sdat,sloc = zen + "ě" ; --- i after soft cons sometimes ; skol+e + sgen = zen + "y" ; + sdat = zen + "e" ; sacc = zen + "u" ; + sloc = zen + "e" ; sins = zen + "ou" ; - pnom,pacc = zen + "y" ; --- also sgen - pgen = zen ; --- sometimes with vowel shortening + pnom = zen + "y" ; + pgen = zien ; pdat = zen + "ám" ; + pacc = zen + "y" ; 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 + ulicaN : DeclensionType = \ulica -> + let + ulic = init ulica ; + ulíc : Str = case ulic of { + ul + "i" + c@? => ul + "í" + c ; + _ => ulic + } in { - snom,sacc = mesto ; + snom = ulica ; + sgen = ulic + "e" ; + sdat = ulic + "i" ; + sacc = ulic + "u" ; + sloc = ulic + "i" ; + sins = ulic + "ou" ; + + pnom = ulic + "e" ; + pgen = ulíc ; + pdat = ulic + "iam" ; + pacc = ulic + "e" ; + ploc = ulic + "iach" ; + pins = ulic + "ami" ; + + g = Fem + } ; + + dlanN : DeclensionType = \dlanj -> + let dlan : Str = case dlanj of { + dla + "ň" => dla + "n" ; + _ => dlanj ---- TODO many more cases + } ; + in + { + snom = dlanj ; + sgen = dlan + "e" ; + sdat = dlan + "i" ; + sacc = dlanj ; + sloc = dlan + "i" ; + sins = dlanj + "ou" ; + + pnom = dlan + "e" ; + pgen = dlan + "í" ; + pdat = dlan + "iam" ; + pacc = dlan + "e" ; + ploc = dlan + "iach" ; + pins = dlanj + "ami" ; + + g = Fem + } ; + + kostN : DeclensionType = \kost' -> + let kost : Str = case kost' of { + kos + "ť" => kos + "t" ; + _ => kost' ---- TODO more cases + } ; + in + { + snom = kost' ; + sgen = kost + "i" ; + sdat = kost + "i" ; + sacc = kost' ; + sloc = kost + "i" ; + sins = kost' + "ou" ; + + pnom = kost + "i" ; + pgen = kost + "í" ; + pdat = kost + "iam" ; + pacc = kost + "i" ; + ploc = kost + "iach" ; + pins = kost' + "ami" ; + + g = Fem + } ; + + mestoN : DeclensionType = \mesto -> + let + mest = init mesto ; + miest : Str = case mest of { + m + "e" + c@(? | (? + ?)) => m + "ie" + c ; + _ => mest ---- TODO: many more rules + } + + in + { + snom = mesto ; sgen = mest + "a" ; sdat = mest + "u" ; - sloc = mest + "u" ; --- "ě" - sins = mest + "em" ; + sacc = mesto ; + sloc = mest + "e" ; + sins = mest + "om" ; + + pnom = mest + "á" ; + pgen = miest ; + pdat = mest + "ám" ; + pacc = mest + "á" ; + ploc = mest + "ách" ; + pins = mest + "ami" ; - pnom,pacc = mest + "a" ; - pgen = mest ; --- léta - let - pdat = mest + "ům" ; - ploc = mest + "ech" ; --- with variations - pins = mest + "y" ; g = Neutr } ; - declMUZ : DeclensionType = \muz_ -> --- 3.5.3 : sdat,sloc ; pnom - let muz = dropFleetingE muz_ + srdceN : DeclensionType = \srdce -> + let srdc = init srdce in { - snom = muz_ ; - sgen,sacc = muz + "e" ; --- pacc - sdat,sloc = muz + "i" ; --- muzovi - sins = muz + "em" ; + snom = srdce ; + sgen = srdc + "a" ; + sdat = srdc + "u" ; + sacc = srdce ; + sloc = srdc + "i" ; + sins = srdc + "om" ; - pnom = case muz_ of { - uci + "tel" => uci + "telé" ; - _ => muz + "i" --- muzové - } ; - pgen = muz + "ů" ; - pacc = muz + "e" ; - pdat = muz + "ům" ; - ploc = muz + "ích" ; - pins = muz + "i" ; - g = Masc Anim - } ; + pnom = srdc + "ia" ; + pgen = srdc ; ---- TODO sŕdc + pdat = srdc + "iam" ; + pacc = srdc + "ia" ; + ploc = srdc + "iach" ; + pins = srdc + "ami" ; - declSOUDCE : DeclensionType = \soudce -> --- 3.5.3: sdat/sloc i,ovi ; pnom i/ové - let soudc = init soudce - in - { - snom,sgen,sacc = 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,sloc = stroj + "i" ; --- pins - 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 = 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,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,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 = kure ; - sgen = kur + "ete" ; - sdat,sloc = kur + "eti" ; - sins = kur + "etem" ; - - pnom,pacc = kur + "ata" ; - pgen = kur + "at" ; - pdat = kur + "atům" ; - ploc = kur + "atech" ; - pins = kur + "aty" ; g = Neutr } ; - declMORE : DeclensionType = \more -> --- 3.7.2 pgen zero sometimes - let mor = init more + vysvedcenieN : DeclensionType = \vysvedcenie -> + let + vysvedceni = init vysvedcenie ; + vysvedcen = init vysvedceni in { - snom,sgen,sacc = more ; --- pnom - sdat,sloc = mor + "i" ; --- pins - sins = mor + "em" ; + snom = vysvedcenie ; + sgen = vysvedceni + "a" ; + sdat = vysvedceni + "u" ; + sacc = vysvedcenie ; + sloc = vysvedcen + "í" ; + sins = vysvedcen + "ím" ; + + pnom = vysvedceni + "a" ; + pgen = vysvedcen + "í" ; + pdat = vysvedceni + "am" ; + pacc = vysvedceni + "a" ; + ploc = vysvedceni + "ach" ; + pins = vysvedceni + "ami" ; - pnom,pacc = more ; - pgen = mor + "í" ; --- - pdat = mor + "ím" ; - ploc = mor + "ích" ; - pins = mor + "i" ; g = Neutr } ; - declSTAVENI : DeclensionType = \staveni -> + dievcaN : DeclensionType = \dievca -> + let dievc = init dievca + in { - snom,sgen,sdat,sacc,sloc = staveni ; - sins = staveni + "m" ; + snom = dievca ; + sgen = dievca + "ťa" ; + sdat = dievca + "ťu" ; + sacc = dievca ; + sloc = dievca + "ti" ; + sins = dievca + "ťom" ; + + pnom = dievca + "tá" ; ---- TODO alternatives dievčence etc + pgen = dievc + "iat" ; + pdat = dievca + "tám" ; + pacc = dievca + "tá" ; + ploc = dievca + "tách" ; + pins = dievca + "tami" ; - pnom,pgen,pacc = staveni ; - pdat = staveni + "m" ; - ploc = staveni + "ch" ; - pins = staveni + "mi" ; g = Neutr } ; + + --------------------------- -- Adjectives From f9e7b2ff5e7daf650b0430d42344b484d8fe6df0 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 09:24:48 +0200 Subject: [PATCH 62/84] (Hun) More words with 4-arg mkN --- src/hungarian/LexiconHun.gf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 86ae37814..372161f7a 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -78,7 +78,7 @@ lin cold_A = mkA "hideg" ; lin computer_N = mkN "számítógép" "számítógépet" ; lin correct_A = mkA "igaz" ; -- lin count_V2 = mkV2 "" ; -lin country_N = mkN "ország" "országot" ; +lin country_N = mkN "ország" "országot" "országok" "országa" ; lin cousin_N = mkN "unokatestvér" "unokatestvért"; --short "unoka" lin cow_N = mkN "tehén" ; -- lin cut_V2 = mkV2 "" ; @@ -139,7 +139,7 @@ lin forest_N = mkN "erdő" "erdőt" ; -- lin freeze_V = mkV "" ; lin fridge_N = mkN "hűtő" "hűtőt" ; lin friend_N = mkN "barát" "barátot" ; -lin fruit_N = mkN "gyümölcs" "gyümölcsöt"; +lin fruit_N = mkN "gyümölcs" "gyümölcsöt" "gyümölcsök" "gyümölcse" ; lin full_A = mkA "tele" ; -- --lin fun_AV @@ -254,7 +254,7 @@ lin oil_N = mkN "olaj" "olajat" ; -- TODO olajok or olajak? lin old_A = mkA "öreg" ; --also "idős" -- lin open_V2 = mkV2 "" ; -- lin paint_V2A = mkV2A "" ; -lin paper_N = mkN "papír" "papírt"; +lin paper_N = mkN "papír" "papírt" "papírok" "papírja" ; -- lin paris_PN = mkPN "Paris" ; lin peace_N = mkN "béke" "békét"; lin pen_N = mkN "toll" "tollat" ; From 1adffb2b9d86bd4c66996a6cac9fbaef7426937e Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 09:36:59 +0200 Subject: [PATCH 63/84] =?UTF-8?q?(Hun)=20Tweak=20dHaj=C3=B3=20to=20work=20?= =?UTF-8?q?for=20words=20ending=20in=20i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hungarian/NounMorphoHun.gf | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 1f7bcd0b4..36c831b02 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -116,14 +116,18 @@ oper -- Examples: "hajó, hajója, zseni, zsenije, kestyű, kestyűje" dHajó : (nom : Str) -> (acc : Str) -> Noun = \hajó,hajót -> let nHajó = mkNoun hajó ; + hajój = hajó + "j" ; + h = nHajó.h ; in nHajó ** { s = \\nc => case nc of { + -- hajó|nk, zseni|nk PossdSg_PossrPl1 => hajó ; + -- hajój|a, zsenij|e + PossdSg_PossrP3 => hajój ; - PossdSg_PossrP3 => hajó + "j" ; - - -- The plural morpheme before possessive suffixes: hajói - PossdPl => hajó + "i" ; + PossdPl => case hajó of { + _ + "i" => hajój + harm "a" "e" ! h + "i" ; -- zsenij|ei + _ => hajó + "i" } ; -- hajó|i -- The rest of the forms are formed with the regular constructor _ => nHajó.s ! nc @@ -294,6 +298,11 @@ oper |<_ + "é", -- lé, levet _ + "e" + #c + #v + "t"> => dLó n a ; + -- Stem 1 == Stem 2 == Stem 3 + -- j in PossdSg_PossrP3 but not elsewhere: gumi -> gumi|nk, gumij|a + <_ + "i", -- gumi, gumit: + _ + "it"> => dHajó n a ; + -- Stem 1: Sg Nom, Sg * - [Gen] -- Stem 2: Sg Gen, Pl * <_ + "á" + #c, _ + "a" + #c + "at"> From 0a31212a9e2e18eb85506e9191f016c8b2fc29eb Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 09:42:18 +0200 Subject: [PATCH 64/84] (Hun) Small tweaks and cleanup --- src/hungarian/NounMorphoHun.gf | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 36c831b02..2dd6d6506 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -54,9 +54,10 @@ oper _ => nLó.s ! nc } } ; - -- NB. arguments are Sg Nom, Pl Nom + -- NB. Relevant arguments are Sg Nom, Pl Nom. + -- Third argument prevents accidental application of this paradigm -- handles words like: falu, daru, tetű -> falvak, darvak, tetvek - dFalu : (nomsg : Str) -> (nompl : Str) -> Noun = \falu,falvak -> + dFalu : (nomsg,_,nompl : Str) -> Noun = \falu,_,falvak -> let falva = init falvak ; nFalva = mkNoun falva ; nFalu = mkNoun falu ; @@ -112,8 +113,8 @@ oper } ; - -- Handles regular wovel ending words, with j added in possesive forms - -- Examples: "hajó, hajója, zseni, zsenije, kestyű, kestyűje" + -- Handles regular wovel ending words, with j added in possesive forms + -- Examples: "hajó, hajója, zseni, zsenije, kestyű, kestyűje" dHajó : (nom : Str) -> (acc : Str) -> Noun = \hajó,hajót -> let nHajó = mkNoun hajó ; hajój = hajó + "j" ; @@ -134,24 +135,22 @@ oper } } ; - -- Unexpected j after consonant + -- Opposite to dVirág: unexpected j after consonant dPlafon : (nom : Str) -> (acc : Str) -> Noun = \plafon,plafont -> - let nPlafon = mkNoun plafon ; + let nPlafon = regNounNomAcc plafon plafont ; h = nPlafon.h ; in nPlafon ** { s = \\nc => case nc of { PossdSg_PossrPl1 => plafon + harm "u" "ü" ! h ; PossdSg_PossrP3 => plafon + "j" ; PossdPl => plafon + harm "jai" "jei" ! h ; - - -- The rest of the forms are formed with the regular constructor _ => nPlafon.s ! nc } } ; - -- Opposite to dHajó: regular paradigm puts j, but these words don't have it. + -- Opposite to dPlafon: regular paradigm puts j, but these words don't have it. dVirág : (nom : Str) -> (acc : Str) -> Noun = \virág,virágot -> - let nVirág = mkNoun virág ; + let nVirág = regNounNomAcc virág virágot ; h = nVirág.h ; in nVirág ** { s = \\nc => case nc of { @@ -170,7 +169,7 @@ oper (notB (vowFinal tolla)) of { True => toll ; -- sör, sör|t -> sör|e -- király, király|t -> király|a - -- TODO fails for plafon, papír + -- NB. plafon, papír with dPlafon False => case tolla of { -- hegy, hegy|et -> hegy|e _ + ("ty"|"gy"|"ny"|"j"|"ly"|"m"|"h") + ("e"|"a"|"ö"|"o") => init tolla ; @@ -188,7 +187,7 @@ oper -- nap, nap|ot -> napj|a -- bank, bank|ot -> bankj|a -- kabát, kabát|ot -> kabátj|a (diák, barát, újság …) - -- NB. fails for virág, ország (virág|ot -> virág|a, ország|ot -> ország|a) + -- NB. virág, ország with dVirág (virág|ot -> virág|a) _ + #c + ("o"|"ö") => init tolla + "j" ; -- háború, háború|t -> háborúj|a @@ -240,7 +239,6 @@ oper -- More words not covered by current paradigms: -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf -- TODO: teher ~ terhet (consonant-crossing) - -- TODO: do we need possessive forms? e.g. fiú ~ fia{m,d,tok} -- All regNoun* are /smart paradigms/: they take one or a couple of forms, -- and decides which (non-smart) paradigm is the most likely to match. @@ -260,7 +258,7 @@ oper case of { <_ + ("u"|"ú"|"ü"|"ű"|"ó"), -- falu, falut, falvak ; szó, szót, szavak _ + ("u"|"ú"|"ü"|"ű"|"ó") + "t", - _ + "v" + #v + "k"> => dFalu nsg npl ; + _ + "v" + #v + "k"> => dFalu nsg asg npl ; -- Fall back to 2-argument smart paradigm _ => regNounNomAcc nsg asg From 851a0dedc89ad1cdbba664ecaa0c79388e7a9e20 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 12:31:53 +0200 Subject: [PATCH 65/84] (Hun) Add SgAll to the forms --- src/hungarian/NounMorphoHun.gf | 1 + src/hungarian/ParamHun.gf | 2 ++ src/hungarian/ResHun.gf | 1 + 3 files changed, 4 insertions(+) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 2dd6d6506..d8ce99343 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -458,6 +458,7 @@ oper SgSup => harm3 "on" "en" "ön" ; PlAcc => harm3 "ot" "et" "öt" ; SgAccStem => harm3 "o" "e" "ö" ; + SgAll => harm3 "hoz" "hez" "höz" ; PossdPl => harm1 "i" ; -- TODO figure out allomorphs _ => harm1 [] } ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index d309857d3..59c6593ed 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -72,6 +72,7 @@ param NumCaseStem = SgNom | SgAccStem | SgSup -- These may use 2-3 different stems | PlAcc -- May have irregular vowel in suffix + | SgAll -- May have irregular vowel in suffix | SgInsStem -- Instrumental and translative: -v after vowels | SgStem -- Rest of the cases in Sg | PlStem -- Rest of the cases in Pl @@ -150,6 +151,7 @@ oper SgNom => "SgNom" ; SgAccStem => "SgAccStem" ; SgSup => "SgSup" ; + SgAll => "SgAll" ; PlAcc => "PlAcc" ; SgInsStem => "SgInsStem" ; SgStem => "SgStem" ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index b61e5be2f..11da50ba2 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -28,6 +28,7 @@ oper => cn.s ! SgNom ; => bind (cn.s ! SgAccStem) "t" ; => cn.s ! SgSup ; + => cn.s ! SgAll ; => cn.s ! PlAcc ; => cn.s ! PlStem ; -- don't use applyCase', it adds a BIND which breaks everything! => applyCase' SgInsStem ; From 4eb210da056afb70581341a6e64379b397c9e9c6 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 12:32:10 +0200 Subject: [PATCH 66/84] (Hun) Add 9-argument worst case noun constructor --- src/hungarian/LexiconHun.gf | 12 ++++++++---- src/hungarian/NounMorphoHun.gf | 33 ++++++++++++++++++++++++++++----- src/hungarian/ParadigmsHun.gf | 3 +++ 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 372161f7a..fb18af669 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -41,7 +41,7 @@ lin boat_N = mkN "hajó" "hajót" "hajók" "hajója" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; -- lin boss_N = mkN "" ; -lin book_N = mkN "könyv" harmE ; -- TODO Sg Sup könyvön, Sg All könyvhöz, all others in HarmE +lin book_N = mkN "könyv" "könyvet" ; lin boy_N = mkN "fiú" ; lin bread_N = mkN "kenyér" "kenyeret"; lin break_V2 = mkV2 "szünet" ; @@ -132,7 +132,9 @@ lin floor_N = mkN "padló" "padlót" ; -- lin flow_V = mkV "" ; lin flower_N = mkN "virág" "virágot" "virágok" "virága" ; lin fly_V = mkV "repül" ; -lin fog_N = mkN "köd" "ködöt"; -- TODO ködöket +lin fog_N = mkN "köd" "ködöt" "ködön" "ködhöz" + "ködök" "ködöket" + "köde" "ködünk" "ködei" ; lin foot_N = leg_N ; --same as leg, to specify "lábfej" lin forest_N = mkN "erdő" "erdőt" ; -- lin forget_V2 = mkV2 "" ; @@ -318,7 +320,9 @@ lin shirt_N = mkN "ing" "inget"; --shirt like t-shirt or the more formal? lin shoe_N = mkN "cipő" "cipőt" ; lin shop_N = mkN "üzlet" "üzletet"; lin short_A = mkA "rövid" ; --in short text, if human length then "alacsony" -lin silver_N = mkN "ezüst" "ezüstet"; -- TODO fix: ezüstöket +lin silver_N = mkN "ezüst" "ezüstöt" "ezüstön" "ezüsthöz" + "ezüstök" "ezüstöket" + "ezüstje" "ezüstünk" "ezüstjei" ; -- lin sing_V = mkV "" ; -- lin sister_N = mkN "" ; -- lin sit_V = mkV "" ; @@ -332,7 +336,7 @@ lin smooth_A = mkA "sima" ; lin snake_N = mkN "kígyó" "kígyót" ; lin snow_N = mkN "hó" "havat" ; lin sock_N = mkN "zokni" "zoknit"; -lin song_N = mkN "dal" "dalat"; -- TODO fix: dalokat +lin song_N = mkN "dal" "dalt" ; -- lin speak_V2 = mkV2 "" ; -- lin spit_V = mkV "" ; -- lin split_V2 = mkV2 "" ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index d8ce99343..ec83c239f 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -172,7 +172,8 @@ oper -- NB. plafon, papír with dPlafon False => case tolla of { -- hegy, hegy|et -> hegy|e - _ + ("ty"|"gy"|"ny"|"j"|"ly"|"m"|"h") + ("e"|"a"|"ö"|"o") => init tolla ; + _ + ("ty"|"gy"|"ny"|"j"|"ly"|"m"|"h") + + ("e"|"a"|"ö"|"o") => init tolla ; -- ház, ház|at -> ház|a _ + #c + ("a"|"e") => init tolla ; @@ -180,9 +181,9 @@ oper -- orr, orr|ot -> orr|a -- TODO fails for gyümölcs, gyümölcs|öt -> gyümölcs|e -- I don't know what this list means /IL - _ + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l" - |"r"|"n"|"ny"|"ssz"|"zz"|"ss" - |"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") + ("o"|"ö") => init tolla ; + _ + #v + ("sz"|"z"|"s"|"zs"|"j"|"ly"|"l"|"r"|"n"|"ny" + |"ssz"|"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz") + + ("o"|"ö") => init tolla ; -- nap, nap|ot -> napj|a -- bank, bank|ot -> bankj|a @@ -193,7 +194,6 @@ oper -- háború, háború|t -> háborúj|a _ => tolla + "j" } } ; - in nTolla ** { s = \\nc => case nc of { -- All plural forms and Sg Acc use the "tolla" stem @@ -240,6 +240,29 @@ oper -- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf -- TODO: teher ~ terhet (consonant-crossing) + -- Worst case constructor: takes all stems + worstCaseNoun : (x1,_,_,_,_,_,_,_,x10 : Str) -> Harm -> Noun = + \nomsg,accsg,supsg,allsg,nompl,accpl,possdSg_possrP3sg,possdSg_PossrPl1,possdPl,h -> + let sgstem = tk 3 allsg ; -- remove -hoz/hez/höz + sginsstem : Str = case vowFinal sgstem of { + True => sgstem + "v" ; + False => duplicateLast sgstem } ; + in {s = table { + SgNom => nomsg ; + SgSup => supsg ; + SgAll => allsg ; + SgStem => sgstem ; + SgAccStem => init accsg ; -- remove t; same stem used for other forms + SgInsStem => sginsstem ; + PlStem => nompl ; + PlAcc => accpl ; + PossdSg_PossrP3 => init possdSg_possrP3sg ; -- remove -a/e + PossdSg_PossrPl1 => tk 2 possdSg_PossrPl1 ; -- remove -nk + PossdPl => possdPl } ; + h = h ; + } ; + + -- All regNoun* are /smart paradigms/: they take one or a couple of forms, -- and decides which (non-smart) paradigm is the most likely to match. regNoun4 : (nomsg, accsg, nompl, possdSg_possrP3sg : Str) -> Noun = diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 543288e30..4d61ef17c 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -135,6 +135,9 @@ oper mkN : (x1,_,_,x4 : Str) -> N = \n,a,pln,possd -> lin N (regNoun4 n a pln possd) ; + mkN : (x1,_,_,_,_,_,_,_,x9 : Str) -> N = + \a,b,c,d,e,f,g,h,i -> lin N (worstCaseNoun a b c d e f g h i (getHarm a)) ; + mkN : Str -> Harmony -> N = \s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ; From 1d50cc8bca543db5334dc9bf282010a789b41557 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 12:40:18 +0200 Subject: [PATCH 67/84] (Hun) Add special cases for derivative morphemes in regNoun (1-arg mkN) --- src/hungarian/NounMorphoHun.gf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index ec83c239f..6f132ee91 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -338,6 +338,8 @@ oper _ + ("a"|"e") => dAlma sgnom (lengthen sgnom + "t") ; -- Words like nyár, név need to use 2-arg smart paradigm (#c|"")+("á"|"é")+ #c => mkNoun sgnom ; + _ + ("ság"|"ség"|"gás"|"gés") -- source: https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Nouns + => mkNoun sgnom ; _ + ("á"|"é") + #c => dToll sgnom (név2nevet sgnom) ; -- _ + ("ó"|"é"|"ő"|"ű") => dLó sgnom (ló2lovat sgnom) ; -- _ + #v + #c + #v + #c => dMajom sgnom (majom2majmo sgnom); From 84985b91c0791ca963286baea7603402386d2bfd Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 12:57:24 +0200 Subject: [PATCH 68/84] (Hun) Merge the param Number into NumType: NoNum {Sg|Pl} | IsNum --- src/hungarian/CatHun.gf | 2 +- src/hungarian/NounHun.gf | 37 ++++++++++++++++++++----------------- src/hungarian/ParamHun.gf | 11 +++++++---- src/hungarian/ResHun.gf | 10 ++++++---- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 82583e2d1..e60c34b8e 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -78,7 +78,7 @@ concrete CatHun of Cat = CommonX - [Adv] ** open ResHun, Prelude in { Card = ResHun.Numeral ; Numeral = ResHun.Numeral ; - Digits = {s : CardOrd => Str ; n : Number} ; + Digits = {s : CardOrd => Str} ; diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index c4a972773..e3d3e2e4e 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -88,23 +88,27 @@ concrete NounHun of Noun = CatHun ** open -- 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 => case of { - => [] ; - _ => quant.sp ! num.n ! c } - ++ num.s ! Indep ; - dt = qt2dt quant.qt ; - } ; + DetQuant quant num = let n = num2number num.n in + quant ** num ** { + s = \\c => case of { + => [] ; -- don't output "a 2 cars" + _ => quant.s ! n ! c } + ++ num.s ! Attrib ; -- TODO: add inflection table in numbers + sp = \\c => case of { + => [] ; + _ => quant.sp ! n ! c } + ++ num.s ! Indep ; + n = n ; + dt = qt2dt quant.qt ; + } ; -- : Quant -> Num -> Ord -> Det ; -- these five best DetQuantOrd quant num ord = - let theseFive = DetQuant quant num in theseFive ** { - s = \\c => theseFive.s ! c ++ ord.s ! num.n ! Nom ; - sp = \\c => theseFive.sp ! c ++ ord.s ! num.n ! Nom ; + let theseFive = DetQuant quant num ; + n = num2number num.n ; + in theseFive ** { + s = \\c => theseFive.s ! c ++ ord.s ! n ! Nom ; + sp = \\c => theseFive.sp ! c ++ ord.s ! n ! Nom ; } ; -- Whether the resulting determiner is singular or plural depends on the @@ -115,17 +119,16 @@ concrete NounHun of Noun = CatHun ** open -- the inherent number. NumSg = baseNum ; - NumPl = baseNum ** {n = Pl} ; + NumPl = baseNum ** {n = NoNum Pl} ; -- : Card -> Num ; NumCard card = card ** { - n = Sg -- Numerals take noun in Sg: e.g. öt város, literally 'five city' + n = IsNum -- Numerals take noun in Sg: e.g. öt város, literally 'five city' } ; -- : Digits -> Card ; NumDigits dig = dig ** { s = \\place => dig.s ! NCard ; - numtype = IsNum ; } ; -- : Numeral -> Card ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 59c6593ed..707207e16 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -179,13 +179,16 @@ param CardOrd = NOrd | NCard ; -- Not used yet - NumType = NoNum | IsNum ; + NumType = NoNum Number | IsNum ; oper - isNum : {numtype : NumType} -> Bool = \nt -> case nt.numtype of { - NoNum => False ; - _ => True + isNum : {n : NumType} -> Bool = \n -> case n.n of { + IsNum => True ; + _ => False } ; + + num2number : NumType -> Number = \n -> + case n of {NoNum x => x ; IsNum => Sg} ; -------------------------------------------------------------------------------- -- Adjectives diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 11da50ba2..b18c6fddd 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -230,9 +230,12 @@ oper s,sp = mkCaseNoun2 no ac ! n ; } ; + -- No need for number: + -- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Nouns + -- "Nouns are used in the singular only, if preceded by a numeral or any other + -- word expressing quantity; as két ember, two men; sok fa, many trees." Numeral : Type = { s : Place => Str ; -- Independent or attribute - numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages -- TODO add ordinal } ; @@ -241,13 +244,12 @@ oper Noun.gf: NumCard : Card -> Num ; -} Num : Type = Numeral ** { - n : Number ; -- Singular or plural + n : NumType ; -- Singular, plural or numeral } ; baseNum : Num = { s = \\_ => [] ; - n = Sg ; - numtype = NoNum + n = NoNum Sg ; } ; -------------------------------------------------------------------------------- From 0d379dbf3a0be23d5d162e764778c35c884a6b1a Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Tue, 28 Apr 2020 14:25:38 +0200 Subject: [PATCH 69/84] Update languages.csv to build Czech --- languages.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.csv b/languages.csv index 18d0d92a5..4345453dc 100644 --- a/languages.csv +++ b/languages.csv @@ -5,7 +5,7 @@ Ara,Arabic,arabic,,,,,,y,,y Bul,Bulgarian,bulgarian,,,y,,,,,y Cat,Catalan,catalan,Romance,,y,,,,y,y Chi,Chinese (simplified),chinese,,,,,,,,y -Cze,Czech,czech,,,n,n,n,n,n,n +Cze,Czech,czech,,,,,,n,,y Dan,Danish,danish,Scand,,y,,,,,y Dut,Dutch,dutch,,,y,,,,,y Eng,English,english,,,y,,,,y,y From 0f19b70b86405be424397fe6ca35360b0ce0c3c4 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 14:41:47 +0200 Subject: [PATCH 70/84] (Hun) Remove PlAcc from stems, turns out it wasn't needed According to https://www.researchgate.net/publication/268175865_Does_Hungarian_have_a_case_system p. 45, the allomorph for plural accusative is predictable. --- src/hungarian/LexiconHun.gf | 6 ++---- src/hungarian/NounMorphoHun.gf | 34 +++++++++++++--------------------- src/hungarian/ParadigmsHun.gf | 4 ++-- src/hungarian/ParamHun.gf | 3 +-- src/hungarian/ResHun.gf | 1 - 5 files changed, 18 insertions(+), 30 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index fb18af669..4d70bedf3 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -132,8 +132,7 @@ lin floor_N = mkN "padló" "padlót" ; -- lin flow_V = mkV "" ; lin flower_N = mkN "virág" "virágot" "virágok" "virága" ; lin fly_V = mkV "repül" ; -lin fog_N = mkN "köd" "ködöt" "ködön" "ködhöz" - "ködök" "ködöket" +lin fog_N = mkN "köd" "ködöt" "ködön" "ködhöz" "ködök" "köde" "ködünk" "ködei" ; lin foot_N = leg_N ; --same as leg, to specify "lábfej" lin forest_N = mkN "erdő" "erdőt" ; @@ -320,8 +319,7 @@ lin shirt_N = mkN "ing" "inget"; --shirt like t-shirt or the more formal? lin shoe_N = mkN "cipő" "cipőt" ; lin shop_N = mkN "üzlet" "üzletet"; lin short_A = mkA "rövid" ; --in short text, if human length then "alacsony" -lin silver_N = mkN "ezüst" "ezüstöt" "ezüstön" "ezüsthöz" - "ezüstök" "ezüstöket" +lin silver_N = mkN "ezüst" "ezüstöt" "ezüstön" "ezüsthöz" "ezüstök" "ezüstje" "ezüstünk" "ezüstjei" ; -- lin sing_V = mkV "" ; -- lin sister_N = mkN "" ; diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index 6f132ee91..d214fae30 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -37,7 +37,7 @@ oper s = \\nc => case nc of { -- All plural forms and Sg Acc use the "lova" stem - PlStem | PlAcc | SgAccStem + PlStem | SgAccStem => nLova.s ! nc ; SgSup | -- Sg Sup has vowel o/ö, not a/e @@ -64,8 +64,8 @@ oper in nFalu ** { s = \\nc => case nc of { - -- All plural forms and Sg Acc, Sg Sup use the "falu" stem - PlStem | PlAcc => nFalva.s ! nc ; + -- All plural forms use the "falva" stem + PlStem => nFalva.s ! nc ; -- The plural morpheme before possessive suffixes is i PossdPl => nFalu.s ! nc + "i" ; @@ -95,7 +95,6 @@ oper s = \\nc => case nc of { SgSup -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - | PlAcc | PlStem | SgAccStem => nMajmo.s ! nc ; @@ -197,7 +196,7 @@ oper in nTolla ** { s = \\nc => case nc of { -- All plural forms and Sg Acc use the "tolla" stem - PlStem | PlAcc | SgAccStem => nTolla.s ! nc ; + PlStem | SgAccStem => nTolla.s ! nc ; PossdSg_PossrPl1 => napj + harm "u" "ü" ! nToll.h ; @@ -221,7 +220,7 @@ oper in nMadara ** { s = \\nc => case nc of { -- All plural forms and Sg Acc use the "tolla" stem - PlStem | PlAcc | SgAccStem => nMadara.s ! nc ; + PlStem | SgAccStem => nMadara.s ! nc ; PossdSg_PossrPl1 => madar + harm "u" "ü" ! nMadara.h ; @@ -241,8 +240,8 @@ oper -- TODO: teher ~ terhet (consonant-crossing) -- Worst case constructor: takes all stems - worstCaseNoun : (x1,_,_,_,_,_,_,_,x10 : Str) -> Harm -> Noun = - \nomsg,accsg,supsg,allsg,nompl,accpl,possdSg_possrP3sg,possdSg_PossrPl1,possdPl,h -> + worstCaseNoun : (x1,_,_,_,_,_,_,x8 : Str) -> Harm -> Noun = + \nomsg,accsg,supsg,allsg,nompl,possdSg_possrP3sg,possdSg_PossrPl1,possdPl,h -> let sgstem = tk 3 allsg ; -- remove -hoz/hez/höz sginsstem : Str = case vowFinal sgstem of { True => sgstem + "v" ; @@ -255,7 +254,6 @@ oper SgAccStem => init accsg ; -- remove t; same stem used for other forms SgInsStem => sginsstem ; PlStem => nompl ; - PlAcc => accpl ; PossdSg_PossrP3 => init possdSg_possrP3sg ; -- remove -a/e PossdSg_PossrPl1 => tk 2 possdSg_PossrPl1 ; -- remove -nk PossdPl => possdPl } ; @@ -481,7 +479,6 @@ oper -- Variant of case forms when the noun stem ends in consonant. endCaseCons : NumCaseStem -> HarmForms = \c -> case c of { SgSup => harm3 "on" "en" "ön" ; - PlAcc => harm3 "ot" "et" "öt" ; SgAccStem => harm3 "o" "e" "ö" ; SgAll => harm3 "hoz" "hez" "höz" ; PossdPl => harm1 "i" ; -- TODO figure out allomorphs @@ -492,7 +489,6 @@ oper -- Variant where accusative has the allomorph -at endCaseConsAccAt : NumCaseStem -> HarmForms = \c -> case c of { SgAccStem => harm3 "a" "e" "ö" ; - PlAcc => harm3 "at" "et" "öt" ; _ => endCaseCons c } ; @@ -541,11 +537,7 @@ oper |"zz"|"ss"|"ll"|"rr"|"nn"|"ns"|"nsz"|"nz")> => endCaseConsAcc ; => endCaseConsAccAt ; _ => endCaseCons } ; - endCasePl : NumCaseStem -> HarmForms = - case of { - <"ak",_> => endCaseConsAccAt ; - <_,True> => endCaseConsAccAt ; - _ => endCaseCons } ; + -- Last consonant doubles before instrumental and translative duplConsStem : Str = case vowFinal w of { True => w ; @@ -557,14 +549,14 @@ oper -- Before Sg Ins, Tra: -- * Double the last letter if consonant -- * Add v if vowel (comes from endCaseSg) - SgInsStem => duplConsStem + endCaseSg SgInsStem ! h ; + SgInsStem => duplConsStem + endCaseSg SgInsStem ! h ; -- endCaseCons, because we only use -k as plural morpheme. - -- If we add possessive forms with allomorph -i, then revise. - c@(PlStem|PlAcc) => w + plural + endCasePl c ! h ; + -- Possessive forms with allomorph -i are handled separately. + PlStem => w + plural ; -- All other singular forms and stems - c => w + endCaseSg c ! h } ; + c => w + endCaseSg c ! h } ; } ; @@ -574,7 +566,7 @@ oper endCase : Case -> HarmForms = \c -> case c of { Nom => harm1 [] ; - Acc => harm3 "ot" "et" "öt" ; + Acc => harm "at" "et" ; -- NB. this is only used for plural acc! Dat => harm "nak" "nek" ; Ade => harm "nál" "nél" ; Sup => harm3 "on" "en" "ön" ; diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 4d61ef17c..4da3067a3 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -135,8 +135,8 @@ oper mkN : (x1,_,_,x4 : Str) -> N = \n,a,pln,possd -> lin N (regNoun4 n a pln possd) ; - mkN : (x1,_,_,_,_,_,_,_,x9 : Str) -> N = - \a,b,c,d,e,f,g,h,i -> lin N (worstCaseNoun a b c d e f g h i (getHarm a)) ; + mkN : (x1,_,_,_,_,_,_,x8 : Str) -> N = + \a,b,c,d,e,f,g,h -> lin N (worstCaseNoun a b c d e f g h (getHarm a)) ; mkN : Str -> Harmony -> N = \s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ; diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf index 707207e16..911bac0a7 100644 --- a/src/hungarian/ParamHun.gf +++ b/src/hungarian/ParamHun.gf @@ -71,7 +71,7 @@ param NumCaseStem = SgNom | SgAccStem | SgSup -- These may use 2-3 different stems - | PlAcc -- May have irregular vowel in suffix + -- May have irregular vowel in suffix | SgAll -- May have irregular vowel in suffix | SgInsStem -- Instrumental and translative: -v after vowels | SgStem -- Rest of the cases in Sg @@ -152,7 +152,6 @@ oper SgAccStem => "SgAccStem" ; SgSup => "SgSup" ; SgAll => "SgAll" ; - PlAcc => "PlAcc" ; SgInsStem => "SgInsStem" ; SgStem => "SgStem" ; PlStem => "PlStem" ; diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index b18c6fddd..dcc6139f0 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -29,7 +29,6 @@ oper => bind (cn.s ! SgAccStem) "t" ; => cn.s ! SgSup ; => cn.s ! SgAll ; - => cn.s ! PlAcc ; => cn.s ! PlStem ; -- don't use applyCase', it adds a BIND which breaks everything! => applyCase' SgInsStem ; => bind (bind (cn.s ! PlStem) "k") (endCase cas ! cn.h) ; From 794d3ab4e02126928ef9362b09166e83130ff3f0 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 15:10:04 +0200 Subject: [PATCH 71/84] Remove reference to ExtendTur which isn't present in the repo --- src/turkish/AllTur.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/turkish/AllTur.gf b/src/turkish/AllTur.gf index 343381bf1..fb1524e2a 100644 --- a/src/turkish/AllTur.gf +++ b/src/turkish/AllTur.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common:../prelude concrete AllTur of AllTurAbs = - LangTur, - ExtendTur + LangTur +-- ,ExtendTur ** {} ; From 8feabbfb41b268dfc7beffcd037ad9e906aa7478 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 15:10:52 +0200 Subject: [PATCH 72/84] Remove old unnecessary file --- src/hungarian/NounMorphoHunOneArgument.gf | 361 ---------------------- 1 file changed, 361 deletions(-) delete mode 100644 src/hungarian/NounMorphoHunOneArgument.gf diff --git a/src/hungarian/NounMorphoHunOneArgument.gf b/src/hungarian/NounMorphoHunOneArgument.gf deleted file mode 100644 index 979b63269..000000000 --- a/src/hungarian/NounMorphoHunOneArgument.gf +++ /dev/null @@ -1,361 +0,0 @@ -resource NounMorphoHunOneArgument = ParamHun ** open Prelude, Predef in { - -oper - Noun = {s : Number => Case => Str} ; - - -- Paradigm functions - -- http://www.cse.chalmers.se/~aarne/articles/smart-preprint.pdf - - -- Words like "alma, kefe, apa, anya, fa": - dAlma : Str -> Noun = \alma -> - let almá : Str = lengthen alma; - - nAlmá : Noun = mkNoun almá ; - in {s = \\n,c => case of { - -- Singular nominative uses the given form, e.g. "alma" or "kefe" - => alma ; - - -- The rest of the forms are formed with the regular constructor, - -- using "almá" or "kefé" as the stem. - _ => nAlmá.s ! n ! c - } ; - } ; - --- Handles words like "madár, nyár, név, bogár" with shortened stem vowel in plural --- No special case here --- dMadár: "víz" has wovel shortening but "vizek" not "vizik", implement differently? -dMadár : Str -> Noun = \madár -> - let r = last madár ; - madá = init madár ; - mada = shorten madá ; -- shortens vowels - a = last mada ; - a = case a of { - "e"|"i" => "e" ; - a => a - } ; - madara = mada + r + a ; - nMadara = mkNounHarm (getHarm madara) "k" madara ; - nMadár = mkNoun madár ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc use the "madara"/"neve" stem - | => nMadara.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "madár"/"név" as the stem. - _ => nMadár.s ! n ! c - - } ; - } ; - ---Handles words like "ló, lé, kő" which are "lovak, levek, kövek" in plural. --- "lovon" instead of "lón" fixed but that gives the following problems: -dLó : Str -> Noun = \ló -> - let lo = shorten ló ; - lov = lo + "v" ; - ak : Str = case ló of { - _ + ("ö" | "ő") => "ek" ; - _ + ("o" | "ó") => "ak" ; - lé => shorten (last lé) + "k"} ; - harmonyPlural : Harm = case ló of { - _ + ("ö" | "ő") => H_e ; -- All plural allomorphs have E harmony, singular ones have O. - _ + ("o" | "ó") => H_a ; - lé => getHarm (lé)} ; - nLov = mkNounHarm harmonyPlural ak lov ; - nLó = mkNoun ló ; - in {s = \\n,c => case of { - - -- All plural forms and Sg Acc, Sg Sup use the "lov" stem - | | => nLov.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "ló" as the stem. - _ => nLó.s ! n ! c - - } ; - } ; - ---Handles words like "tó, hó"" which are "tavak, havak" in plural. ---(Since I only have these examples for now I do a simplified case with ó, a) --- "tavon" instead of "tón" case fixed, works automatically with the Sup rules -dTó : Str -> Noun = \tó -> - let t = init tó ; - tav = t + "av" ; - nTav = mkNounHarm H_a "ak" tav ; - nTó = mkNoun tó ; - in {s = \\n,c => case of { - - -- All plural forms and Sg Acc use the "tav" stem - || => nTav.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "tó" as the stem. - _ => nTó.s ! n ! c - - } ; - } ; - ---Handles words like "gyomor, majom, retek" which are "gyomrot, majmot, retket" in accusative (wovel dropping base) ---More examples: "ajak, bokor, cukor, csokor, eper, fészek, fodor, gödör, haszon, iker, izom, kölyök, köröm, méreg, piszok, sarok, selyem, szeder, szobor, takony, terem, titok, torok, torony, tükör, vödör" -> --- "ajkat, bokrot, cukrot, csokrot, epret, fészket, fodrot, gödröt, hasznot, ikret, izmot, kölyköt, körmet, mérget, piszkot, sarkot, selymet, szedret, szobrot, taknyot, termet, titkot, torkot, tornyot, tükröt, vödröt" --- case handled -dMajom : Str -> Noun = \majom -> - -- Str*Str is syntactic sugar for {p1 : Str ; p2 : Str} ; - -- confusing syntax: you can't write let : Str*Str = … - -- it has to be called something else, and then you - -- can get "tako" and "ny" with p1, p2. - let tako_ny : Str*Str = case majom of { - x + dzs@#trigraph => ; - x + zs@#digraph => ; - -- ? pattern matches exactly 1 character - x + s@? => } ; - tako = tako_ny.p1 ; - ny = tako_ny.p2 ; - - nyo = ny + last tako ; - tak = init tako ; - taknyo = tak + nyo ; - nMajmo = mkNounHarm (getHarm taknyo) "k" taknyo ; - nMajom = mkNoun majom ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - | | => nMajmo.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "majom" as the stem. - _ => nMajom.s ! n ! c - } ; - } ; - ---Handles words like "sátor, álom, alkalom, farok, halom, vászon" --- "sátrat, álmat, alkalmat, farkat, halmat, vásznat" --- (bátor not noun) -dFarok : Str -> Noun = \farok -> - let k = last farok ; - far = init (init farok) ; - fark = far + k ; - nFark = mkNounHarm (getHarm fark) "ak" fark ; - nFarok = mkNoun farok ; - in {s = \\n,c => case of { - -- All plural forms and Sg Acc and Sg Sup use the "fark" stem - | | => nFark.s ! n ! c ; - - -- The rest of the forms are formed with the regular constructor, - -- using "farok" as the stem. - _ => nFarok.s ! n ! c - } ; - } ; - --- More words not covered by current paradigms: --- https://cl.lingfil.uu.se/~bea/publ/megyesi-hungarian.pdf --- TODO: falu ~ falva-k (v-case) --- TODO: teher ~ terhet (consonant-crossing) --- TODO: do we need possessive forms? e.g. fiú ~ fia{m,d,tok} - --- regNoun is a /smart paradigm/: it takes one or a couple of forms, --- and decides which (non-smart) paradigm is the most likely to match. -regNoun : Str -> Noun = \sgnom -> case sgnom of { - _ + "a"|"e" => dAlma sgnom ; - (? | #digraph | #trigraph) + ("á"|"é") + (? | #digraph | #trigraph) => mkNoun sgnom ; - _ + ("á"|"é") + ? => dMadár sgnom ; - _ + "é"|"ő"|"ű" => dLó sgnom ; - _ + "ó" => dTó sgnom ; - _ + "alom" => dFarok sgnom ; - _ + "elem" => dMajom sgnom ; - - -- TODO: more non-smart paradigms + more pattern matching - -- TODO: smart paradigms with >1 form. Which forms are the most descriptive? - - _ => mkNoun sgnom -- Fall back to the regular paradigm -} ; - ---TODO: Special cases (enter these words manually to not complicate the paradigms): ---dTó: szó special case which fulfills the plural cases but not the or case ("szót" not "szavat") ---dLó: special case "lén" not "leven" ---dLó: also "kövön" not "köven", but that is due to H_e, which is needed for "köveket" so it's conflicting ---endCaseConsAcc: "falat, fület, várat, könnyet", ---also special in superessive case "falon, fülek, vizen" ---pattern matching in regNoun: one-syllable words that in fact belong to dMadár: "nyár, név" ---------------------------------------------------------------------------------------------- --- Following code by EG in 2009 (?), comments and some additions by IL 2020 - -param - -- Harmony types - Harm = H_a | H_e | H_o ; - -oper - - -- Vowels as a pattern. - v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | - "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; - -- Digraphs - digraph : pattern Str = #("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") ; - - -- Trigraphs - trigraph : pattern Str = #("dzs") ; - - duplicateLast : Str -> Str = \str -> case str of { - x + "dzs" => x + "ddzs" ; - x + "ny" => x + "nny" ; -- takony : takonnyal - x + "cs" => x + "ccs" ; - x + "dz" => x + "ddz" ; - x + "gy" => x + "ggy" ; - x + "ly" => x + "lly" ; - x + "sz" => x + "ssz" ; - x + "ty" => x + "tty" ; - x + "zs" => x + "zzs" ; - - -- Base cacse: just duplicate the single letter - x + s@? => x + s + s } ; - - -- Function to test if a string ends in a vowel - vowFinal : Str -> Bool = \str -> - case str of { - _ + #v => True ; -- Matching a string against a pattern. - _ => False - } ; - - lengthen : Str -> Str = \str -> case str of { - x + "a" => x + "á" ; - x + "e" => x + "é" ; - x + "i" => x + "í" ; - x + "o" => x + "ó" ; - x + "u" => x + "ú" ; - x + "ö" => x + "ő" ; - x + "ü" => x + "ű" ; - _ => Predef.error "Lengthening not applicable to" ++ str - } ; - - shorten : Str -> Str = \str -> case str of { - x + "á" => x + "a" ; - x + "é" => x + "e" ; - x + "í" => x + "i" ; - x + "ó" => x + "o" ; - x + "ú" => x + "u" ; - x + "ő" => x + "ö" ; - x + "ű" => x + "ü" ; - _ => Predef.error "Shortening not applicable to" ++ str - } ; - - -- Function to get a harmony from a string - getHarm : Str -> Harm = \s -> case s of { - _ + ("a" | "á" | "o" | "ó" | "u" | "ú") + _ => H_a ; - _ + ("ö" | "ő" | "ü") + _ => H_o ; - _ => H_e - } ; - - -- Used as a table of allomorphs for a give case. - HarmForms : Type = Harm => Str ; - - -- Functions for constructing a HarmForms table. - harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> table { - H_a => a ; - H_e => e ; - H_o => o - } ; - harm : Str -> Str -> HarmForms = \a,e -> harm3 a e e ; - harm1 : Str -> HarmForms = \i -> harm i i ; - - -- Variant of case forms when the noun stem ends in consonant. - endCaseCons : Case -> HarmForms = \c -> case c of { - Nom => harm1 [] ; - Acc => harm3 "ot" "et" "öt" ; - Dat => harm "nak" "nek" ; - Ill => harm "ba" "be" ; - Ine => harm "ban" "ben" ; - Ela => harm "ból" "ből" ; - All => harm3 "hoz" "hez" "höz" ; - Ade => harm "nál" "nél" ; - Abl => harm "tól" "től" ; - Sub => harm "ra" "re" ; - Sup => harm3 "on" "en" "ön" ; - Del => harm "ról" "ről" ; - Cau => harm1 "ért" ; - Ins => harm "al" "el" ; - Tra => harm "á" "é" - -- Ess => harm "stul" "stül" ; -- Essive-modal 'with and its parts' - -- Ter => harm1 "ig" ; -- Terminative 'as far as ' - -- For => harm1 "ként" ; -- Formal 'as ' - -- Tem => harm1 "kor" -- Temporal 'at '. Only used with numerals. - } ; - - -- Variant where accusative has the allomorph -at - endCaseConsAccAt : Case -> HarmForms = \c -> case c of { - Acc => harm3 "at" "et" "öt" ; - _ => endCaseCons c - } ; - - -- Variant where accusative has the allomorph -t for consonants - -- Examples: "pénz, bor, orr, szín, lány, kés, dal" - endCaseConsAcc : Case -> HarmForms = \c -> case c of { - Acc => harm1 "t" ; - _ => endCaseCons c - } ; - - -- Variant of case forms when the noun stem ends in vowel. - endCaseVow : Case -> HarmForms = \c -> case c of { - Acc => harm1 "t" ; - Sup => harm1 "n" ; - Ins => harm "val" "vel" ; - Tra => harm "vá" "vé" ; - - -- Other forms are shared with endCaseCons. - _ => endCaseCons c - } ; - - -- Function to return a plural allomorph given the stem (e.g. név, almá). - pluralAllomorph : (stem : Str) -> Str = pluralAllomorphLowStem False ; - - -- Function to return a plural allomorph given lowering stem or not - -- Examples of lowering stems: ág, ágy, ár, fal, fog, gyár, hal, has, hát, ház, hold, láz, lyuk, nyak, olaj, oldal, toll, ujj, vonal - -- Examples of lowering stems: férj, fej, hely, fül, könny, könyv, mell, szög - pluralAllomorphLowStem : (low : Bool) -> (stem : Str) -> Str = \low,stem -> - case of { - <_,True> => "k" ; - => harm "ak" "ek" ! getHarm stem ; - _ => harm3 "ok" "ek" "ök" ! getHarm stem - } ; - - - -- Harmony and plural allomorph read from the singular nominative - mkNoun : Str -> Noun = \w -> - mkNounHarm (getHarm w) (pluralAllomorph w) w ; - - -- Harmony and plural allomorph given explicitly (check if the True makes it bad) - mkNounHarm : Harm -> (plural : Str) -> Str -> Noun = mkNounHarmAcc True ; - - mkNounHarmAcc : (useAt : Bool) -> Harm -> (plural : Str) -> Str -> Noun = \useAt,h,plural,w -> - let endCaseSg : Case -> HarmForms = case of { - <_,_ + #v> => endCaseVow ; - <_,_ + #v + ("sz"|"z"|"s"|"zs"|"j" - |"ly"|"l"|"r"|"n"|"ny"|"ssz"|"zz" - |"ss"|"ll"|"rr"|"nn"|"ns"|"nsz" - |"nz")> => endCaseConsAcc ; - => endCaseConsAccAt ; - _ => endCaseCons } ; - endCasePl : Case -> HarmForms = case of { - <"ak",_> => endCaseConsAccAt ; - <_,True> => endCaseConsAccAt ; - _ => endCaseCons } ; - -- Last consonant doubles before instrumental and translative - duplConsStem : Str = case vowFinal w of { - True => w ; - False => duplicateLast w } ; - - -- Noun is {s : Number => Case => Str}, we construct nested tables. - in {s = table { - Sg => table { - -- Double the last letter (if consonant) before Ins, Tra - c@(Ins|Tra) => duplConsStem + endCaseSg c ! h ; - c@_ => w + endCaseSg c ! h } ; - - Pl => table { - -- Double the plural k before Ins, Tra - c@(Ins|Tra) => w + plural + "k" + endCasePl c ! h ; - - -- endCaseCons, because we only use -k as plural morpheme. - -- If we add possessive forms with allomorph -i, then revise. - c@_ => w + plural + endCasePl c ! h } - } - } ; - -} From 6166b99237f298428df87884f2a27a9fb194eb52 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 28 Apr 2020 16:47:07 +0200 Subject: [PATCH 73/84] (Hun) Add mkA paradigm for N -> A --- src/hungarian/ParadigmsHun.gf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 4da3067a3..ed05e9859 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -37,7 +37,7 @@ oper mkA : overload { mkA : (sgnom : Str) -> A ; -- Regular adjective, given in singular nominative mkA : (sgnom, sgacc : Str) -> A ; -- Singular nominative and accusative - -- mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A. + mkA : N -> A ; -- Adjective from a noun. mkN has more paradigms, so anything irregular goes via N. } ; mkA2 : overload { @@ -159,10 +159,11 @@ oper mkA = overload { mkA : (sgnom : Str) -> A = \s -> lin A (mkAdj s) ; - mkA : (sgnom,sgacc : Str) -> A = \n,a -> - lin A (mkAdj2 n (regNounNomAcc n a)) ; - -- mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda -> - -- jakda ** {s = \\af => kiga ++ jakda.s ! af} ; + mkA : (sgnom,sgacc : Str) -> A = \nom,acc -> + lin A (mkAdj2 nom (regNounNomAcc nom acc)) ; + mkA : N -> A = \noun -> + let sgnom : Str = noun.s ! SgNom in + lin A (mkAdj2 sgnom noun) ; } ; mkA2 = overload { From fc7d3b2218dee3f9c059485ee88645209894dbd3 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Tue, 28 Apr 2020 17:50:20 +0200 Subject: [PATCH 74/84] fixed Slo noun declensions and smart paradigms ; LexiconSlo doesn't compile --- src/slovak/ParadigmsSlo.gf | 58 +++++++++---------- src/slovak/ResSlo.gf | 110 ++++++++++++++++++++----------------- 2 files changed, 90 insertions(+), 78 deletions(-) diff --git a/src/slovak/ParadigmsSlo.gf b/src/slovak/ParadigmsSlo.gf index 3b8b86a11..b8330b44f 100644 --- a/src/slovak/ParadigmsSlo.gf +++ b/src/slovak/ParadigmsSlo.gf @@ -1,4 +1,4 @@ -resource ParadigmsSlo = open CatSlo, ResSlo, Prelude in { +resource ParadigmsSlo = open CatSlo, ResSlo, (R=ResSlo), Prelude in { ---------------- -- Parameters @@ -35,6 +35,7 @@ oper -- Nouns oper + mkN = overload { mkN : (nom : Str) -> N = \nom -> lin N (guessNounForms nom) ; @@ -46,35 +47,36 @@ oper -- However, they have some defaults that may have to be overwritten. -- This can be done easily by overriding those formes with record extension (**). -- The default extensions are shown in comments; if the default is correct, no extension is needed. +-- Notice that some paradigms take two arguments, some take one. - panN : Str -> N -- default ** {pnom = +i} - = \s -> lin N (declPAN s) ; - predsedaN : Str -> N -- default ** {sgen = +i} - = \s -> lin N (declPREDSEDA s) ; - hradN : Str -> N -- default ** {sgen,sloc = +u} - = \s -> lin N (declHRAD s) ; - zenaN : Str -> N -- default ** {pgen = zen} - = \s -> lin N (declZENA s) ; - mestoN : Str -> N -- default ** {sloc = +u ; pgen = mest ; ploc = +ech} - = \s -> lin N (declMESTO s) ; - muzN : Str -> N - = \s -> lin N (declMUZ s) ; - soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i} - = \s -> lin N (declSOUDCE s) ; + chlapN : Str -> N + = \s -> lin N (R.chlapN s) ; + hrdinaN : Str -> N + = \s -> lin N (R.hrdinaN s) ; + dubN : Str -> N + = \s -> lin N (R.dubN s) ; strojN : Str -> N - = \s -> lin N (declSTROJ s) ; - ruzeN : Str -> N - = \s -> lin N (declRUZE s) ; - pisenN : Str -> N - = \s -> lin N (declPISEN s) ; - kostN : Str -> N - = \s -> lin N (declKOST s) ; - kureN : Str -> N - = \s -> lin N (declKURE s) ; - moreN : Str -> N -- default ** {pgen = +í} - = \s -> lin N (declMORE s) ; - staveniN : Str -> N - = \s -> lin N (declSTAVENI s) ; + = \s -> lin N (R.strojN s) ; + ponyN : Str -> N + = \s -> lin N (R.ponyN s) ; + zenaN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.zenaN s) ** {pgen = p} ; + ulicaN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.ulicaN s) ** {pgen = p} ; + dlanN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.dlanN s p) ; + kostN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.kostN s p) ; + mestoN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.mestoN s) ** {pgen = p} ; + srdceN : (snom, pgen : Str) -> N + = \s,p -> lin N (R.srdceN s) ** {pgen = p} ; + vysvedcenieN : Str -> N + = \s -> lin N (R.vysvedcenieN s) ; + dievcaN : Str -> N + = \s -> lin N (R.dievcaN s) ; + dievceniecN : Str -> N + = \s -> lin N (R.dievceniecN s) ; -- The full definition of the noun record is -- { diff --git a/src/slovak/ResSlo.gf b/src/slovak/ResSlo.gf index cb4b0765a..edbaefc83 100644 --- a/src/slovak/ResSlo.gf +++ b/src/slovak/ResSlo.gf @@ -31,8 +31,8 @@ oper consonant : pattern Str = #( "d" | "t" | "g" | "h" | "k" | "n" | "r" | - "ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" | - "b" | "f" | "l" | "m" | "p" | "s" | "v" + "ť" | "ď" | "j" | "ň" | "š" | "c" | "č" | "ž" | + "b" | "f" | "l" | "m" | "p" | "s" | "v" | "ľ" | "ĺ" | "ŕ" | "dz" ) ; dropFleetingE : Str -> Str = \s -> case s of { @@ -140,46 +140,52 @@ oper -- terminology of CEG DeclensionType : Type = Str -> NounForms ; -{- ----- - declensionNounForms : (nom,gen : Str) -> Gender -> NounForms - = \nom,gen,g -> - let decl : DeclensionType = case of { - => declHRDINA ; + declensionNounForms : (snom,pgen : Str) -> Gender -> NounForms + = \snom,pgen,g -> case of { + => hrdinaN snom ; + => ponyN snom ; ---- + => hrdinaN snom ; + + => strojN snom ; + => dubN snom ; + => dubN snom ; - => declCHLAP ; - => 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 ; + => zenaN snom ; + => zenaN snom ; + => ulicaN snom ; + => ulicaN snom ; + => kostN snom pgen ; + => dlanN snom pgen ; + + => mestoN snom ; + => vysvedcenieN snom ; + => srdceN snom ; + => dievceniecN snom ; + => dievcaN snom ; + + _ => Predef.error ("cannot infer declension type for" ++ snom ++ pgen) + } ** {pgen = pgen ; g = g} ; -- the "smartest" one-argument mkN guessNounForms : Str -> NounForms - = \s -> case s of { - _ + "ost" => declKOST s ; - _ + "tel" => declMUZ s ; - _ + #hardConsonant => declHRAD s ; - _ + #softConsonant => declSTROJ s ; - _ + "a" => declZENA s ; - _ + "o" => declMESTO s ; - _ + "ce" => declSOUDCE s ; - _ + "e" => declMORE s ; - _ + "í" => declSTAVENI s ; - _ => Predef.error ("cannot guess declension type for" ++ s) + = \snom -> case snom of { + _ + ("i"|"y"|"e") => ponyN snom ; + _ + #softConsonant => strojN snom ; + _ + #hardConsonant => dubN snom ; + _ + #neutralConsonant => dubN snom ; + _ + #hardConsonant + "a" => zenaN snom ; + _ + #neutralConsonant + "a" => zenaN snom ; + _ + #softConsonant + "a" => ulicaN snom ; + _ + ("ia"|"ya") => ulicaN snom ; + _ + "o" => mestoN snom ; + _ + "ie" => vysvedcenieN snom ; + _ + "e" => srdceN snom ; + _ + "ä" => dievcaN snom ; + + _ => Predef.error ("cannot guess declension type for" ++ snom) } ; --} + -- the traditional declensions, in both CEG and Wiki -- they are also exported in ParadigmsSlo with names chlapN etc @@ -327,11 +333,8 @@ oper g = Fem } ; - dlanN : DeclensionType = \dlanj -> - let dlan : Str = case dlanj of { - dla + "ň" => dla + "n" ; - _ => dlanj ---- TODO many more cases - } ; + dlanN : Str -> DeclensionType = \dlanj,dlani -> + let dlan : Str = init dlani in { snom = dlanj ; @@ -342,7 +345,7 @@ oper sins = dlanj + "ou" ; pnom = dlan + "e" ; - pgen = dlan + "í" ; + pgen = dlani ; pdat = dlan + "iam" ; pacc = dlan + "e" ; ploc = dlan + "iach" ; @@ -351,11 +354,8 @@ oper g = Fem } ; - kostN : DeclensionType = \kost' -> - let kost : Str = case kost' of { - kos + "ť" => kos + "t" ; - _ => kost' ---- TODO more cases - } ; + kostN : Str -> DeclensionType = \kost',kosti -> + let kost = init kosti in { snom = kost' ; @@ -366,7 +366,7 @@ oper sins = kost' + "ou" ; pnom = kost + "i" ; - pgen = kost + "í" ; + pgen = kosti ; pdat = kost + "iam" ; pacc = kost + "i" ; ploc = kost + "iach" ; @@ -457,7 +457,7 @@ oper sloc = dievca + "ti" ; sins = dievca + "ťom" ; - pnom = dievca + "tá" ; ---- TODO alternatives dievčence etc + pnom = dievca + "tá" ; pgen = dievc + "iat" ; pdat = dievca + "tám" ; pacc = dievca + "tá" ; @@ -467,7 +467,17 @@ oper g = Neutr } ; - + -- with variant plural forms of the previous + dievceniecN : DeclensionType = \dievca -> + let dievc = init dievca + in dievcaN dievca ** { + pnom = dievc + "ence" ; + pgen = dievc + "eniec" ; + pdat = dievc + "encom" ; + pacc = dievc + "ence" ; + ploc = dievc + "encoch" ; + pins = dievc + "encami" ; + } ; --------------------------- -- Adjectives From 600bc66c9f4f784049b481e95cc21ddfa1c9b2d0 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Tue, 28 Apr 2020 17:51:13 +0200 Subject: [PATCH 75/84] commented out contents of LexiconSlo --- src/slovak/LexiconSlo.gf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slovak/LexiconSlo.gf b/src/slovak/LexiconSlo.gf index e4e27d48d..b625f1f50 100644 --- a/src/slovak/LexiconSlo.gf +++ b/src/slovak/LexiconSlo.gf @@ -5,6 +5,7 @@ concrete LexiconSlo of Lexicon = ResSlo, ParadigmsSlo in { +{- lin boy_N = declPAN "kluk" ; man_N = declMUZ "muž" ; @@ -54,6 +55,6 @@ concrete LexiconSlo of Lexicon = buy_V2 = mkV2 (iii_kupovatVerbForms "kupovat") ; love_V2 = mkV2 (iii_kupovatVerbForms "milovat") ; - +-} } From 2304194b65d7dac451153cde33b3069967d84de8 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Wed, 29 Apr 2020 10:14:13 +0200 Subject: [PATCH 76/84] Slovak adj, det, numeral paradigms --- src/slovak/ParadigmsSlo.gf | 34 ++-- src/slovak/ResSlo.gf | 395 +++++++++++++++++++------------------ 2 files changed, 217 insertions(+), 212 deletions(-) diff --git a/src/slovak/ParadigmsSlo.gf b/src/slovak/ParadigmsSlo.gf index b8330b44f..82f98ea06 100644 --- a/src/slovak/ParadigmsSlo.gf +++ b/src/slovak/ParadigmsSlo.gf @@ -92,27 +92,31 @@ oper mkA = overload { mkA : Str -> A - = \s -> lin A (case s of { - _ + "ý" => mladyAdjForms s ; - _ + "í" => jarniAdjForms s ; - _ + "ův" => otcuvAdjForms s ; - _ + "in" => matcinAdjForms s ; - _ => Predef.error ("no mkA for" ++ s) - }) ; + = \s -> lin A (guessAdjForms s) } ; - mladyA : Str -> A - = \s -> lin A (mladyAdjForms s) ; - jarniA : Str -> A - = \s -> lin A (jarniAdjForms s) ; - otcuvA : Str -> A - = \s -> lin A (otcuvAdjForms s) ; - matcinA : Str -> A - = \s -> lin A (matcinAdjForms s) ; + peknyA : Str -> A + = \s -> lin A (R.peknyA s) ; + krasnyA : Str -> A + = \s -> lin A (R.krasnyA s) ; + cudziA : Str -> A + = \s -> lin A (R.cudziA s) ; + rydziA : Str -> A + = \s -> lin A (R.rydziA s) ; + otcovA : Str -> A + = \s -> lin A (R.otcovA s) ; + mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (a ** {c = p}) ; +-- the full definition of the adjective record is +-- { +-- msnom, fsnom, nsnom, msgen, fsgen, msdat, fsacc, msloc, msins, fsins, +-- ampnom, pgen, pins : Str +-- } +-- + ------------------------- -- Verbs diff --git a/src/slovak/ResSlo.gf b/src/slovak/ResSlo.gf index edbaefc83..3e241d0c3 100644 --- a/src/slovak/ResSlo.gf +++ b/src/slovak/ResSlo.gf @@ -35,60 +35,8 @@ oper "b" | "f" | "l" | "m" | "p" | "s" | "v" | "ľ" | "ĺ" | "ŕ" | "dz" ) ; - dropFleetingE : Str -> Str = \s -> case s of { - x + "e" + c@("k"|"c"|"n") => x + c ; - x + "e" + "ň" => x + "n" ; - _ => s - } ; - - 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) - } ; - + accentedVowel : pattern Str = #("á"|"é"|"í"|"ó"|"ú"|"ý") ; + --------------- -- Nouns --------------- @@ -489,15 +437,16 @@ oper ---- TODO other degrees than positive AdjForms : Type = { - msnom, fsnom, nsnom : Str ; - msgen, fsgen : Str ; -- nsgen = msgen, pacc = fsgen - msdat, fsdat : Str ; -- nsdat = msdat + msnom, fsnom, nsnom : Str ; + msgen, fsgen : Str ; -- nsgen = msgen + msdat : Str ; -- nsdat = msdat fsacc : Str ; -- amsacc = msgen, imsacc = msnom, nsacc = nsnom msloc : Str ; -- fsloc = fsdat, nsloc = msloc msins, fsins : Str ; -- nsins = msins, pdat = msins - mpnom,fpnom : Str ; -- impnom = fpnom, npnom = fsnom - pgen : Str ; -- ploc = pgen + ampnom : Str ; -- *pnom = nsnom + pgen : Str ; -- + -- pdat = msins, ampacc = pgen, *pacc = nsnom, ploc = pgen pins : Str ; } ; @@ -507,90 +456,130 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { s = \\g,n,c => case of { - | => afs.msnom ; - - | => afs.fsnom ; - => afs.nsnom ; - + | => afs.msnom ; + => afs.fsnom ; + + | => afs.nsnom ; | => afs.msgen ; - - | => afs.fsgen ; - + => afs.fsgen ; => afs.msdat ; - => afs.fsdat ; => afs.fsacc ; - => afs.msloc ; - | => afs.msins ; => afs.fsins ; - => afs.mpnom ; - => afs.fpnom ; - - => afs.pgen ; + => afs.ampnom ; + + | => afs.pgen ; => afs.pins } } ; --- hard declension + guessAdjForms : Str -> AdjForms + = \s -> case s of { + _ + "ý" => peknyA s ; + _ + "y" => krasnyA s ; + _ + "í" => cudziA s ; + _ + "i" => rydziA s ; + _ + "ov" => otcovA s ; + _ => Predef.error ("no mkA for" ++ s) + } ; - mladyAdjForms : Str -> AdjForms = \mlady -> - let mlad = init mlady + +-- hard consonant + y + + peknyA : Str -> AdjForms = \pekny -> + let pekn = init pekny in { - msnom = mlad + "ý" ; - fsnom = mlad + "á" ; - nsnom,fsgen,fsdat,fpnom = mlad + "é" ; - msgen = mlad + "ého" ; - msdat = mlad + "ému" ; - fsacc,fsins = mlad + "ou" ; - msloc = mlad + "ém" ; - msins,pdat = mlad + "ým" ; - mpnom = addAdjI mlad ; - pgen = mlad + "ých" ; - pins = mlad + "ými" ; + msnom = pekn + "ý" ; + fsnom = pekn + "á" ; + nsnom = pekn + "é" ; + msgen = pekn + "ého" ; + fsgen = pekn + "ej" ; + msdat = pekn + "ému" ; + fsacc = pekn + "ú" ; + msloc = pekn + "om" ; + msins = pekn + "ým" ; + fsins = pekn + "ou" ; + ampnom = pekn + "í" ; + pgen = pekn + "ých" ; + pins = pekn + "ými" ; } ; --- soft declension +-- if the penultimate has accent, e.g. krásny, the last accent disappears + krasnyA : Str -> AdjForms = \krasny -> + let + krasn = init krasny ; + in peknyA krasny ** { + msnom = krasn + "y" ; + fsnom = krasn + "a" ; + nsnom = krasn + "e" ; + msgen = krasn + "eho" ; + msdat = krasn + "emu" ; + fsacc = krasn + "u" ; + msins = krasn + "ym" ; + ampnom = krasn + "i" ; + pgen = krasn + "ych" ; + pins = krasn + "ymi" ; + } ; - jarniAdjForms : Str -> AdjForms = \jarni -> - { - msnom,fsnom,nsnom, - fsgen,fsdat,fsacc,fsins, - mpnom,fpnom = jarni ; - msgen = jarni + "ho" ; - msdat = jarni + "mu" ; - msloc,msins = jarni + "m" ; - pgen = jarni + "ch" ; - pins = jarni + "mi" ; +-- soft consonant + i + + cudziA : Str -> AdjForms = \cudzi -> + let cudz = init cudzi + in { + msnom = cudz + "í" ; + fsnom = cudz + "ia" ; + nsnom = cudz + "ie" ; + msgen = cudz + "ieho" ; + fsgen = cudz + "ej" ; + msdat = cudz + "iemu" ; + fsacc = cudz + "iu" ; + msloc = cudz + "om" ; + msins = cudz + "ím" ; + fsins = cudz + "ou" ; + ampnom = cudz + "í" ; + pgen = cudz + "ích" ; + pins = cudz + "ími" ; + } ; + +-- accented vowel + soft consonant + i + rydziA : Str -> AdjForms = \rydzi -> + let rydz = init rydzi + in peknyA rydzi ** { + msnom = rydz + "i" ; + fsnom = rydz + "a" ; + nsnom = rydz + "e" ; + msgen = rydz + "eho" ; + msdat = rydz + "emu" ; + fsacc = rydz + "u" ; + msins = rydz + "im" ; + ampnom = rydz + "i" ; + pgen = rydz + "ich" ; + pins = rydz + "imi" ; } ; -- masculine possession: the same endings as in feminine - otcuvAdjForms : Str -> AdjForms = \otcuv -> - let otcov = Predef.tk 2 otcuv + "ov" - in - matcinAdjForms otcov ** {msnom = otcuv} ; - --- feminine possession - - matcinAdjForms : Str -> AdjForms = \matcin -> + otcovA : Str -> AdjForms = \otcov -> { - msnom = matcin ; - fsnom,msgen = matcin + "a" ; - nsnom = matcin + "o" ; - fsgen,fpnom = matcin + "y" ; - msdat,fsacc = matcin + "u" ; - fsdat,msloc = matcin + "ě" ; - msins = matcin + "ým" ; - fsins = matcin + "ou" ; - mpnom = matcin + "i" ; - pgen = matcin + "ých" ; - pins = matcin + "ými" ; + msnom = otcov ; + fsnom = otcov + "a" ; + nsnom = otcov + "o" ; + msgen = otcov + "ho" ; + fsgen = otcov + "ej" ; + msdat = otcov + "mu" ; + fsacc = otcov + "u" ; + msloc = otcov + "om" ; + msins = otcov + "ým" ; + fsins = otcov + "ou" ; + ampnom = otcov + "i" ; + pgen = otcov + "ých" ; + pins = otcov + "ými" ; } ; --------------------- @@ -685,52 +674,51 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { {a = a ; cnom = []} ** case a of { Ag _ Sg P1 => { - nom = "já" ; - gen,acc,pgen,pacc = "mne" ; - cgen,cacc = "mě" ; - dat,pdat,loc = "mně" ; + nom = "ja" ; + gen,acc,pgen,pacc = "mňa" ; + cgen,cacc = "ma" ; + dat,pdat,loc = "mne" ; cdat = "mi" ; ins,pins = "mnou" } ; Ag _ Sg P2 => { nom = "ty" ; - gen,acc,pgen,pacc = "tebe" ; - cgen,cacc = "tě" ; - dat,pdat,loc = "tobě" ; + gen,acc,pgen,pacc = "teba" ; + cgen,cacc = "ťa" ; + dat,pdat,loc = "tebe" ; cdat = "ti" ; ins,pins = "tebou" } ; Ag (Masc _) Sg P3 => { nom = "on" ; - gen,acc = "jeho" ; + gen,acc = "jeho" ; ---- + other forms cgen,cacc = "ho" ; - pgen,pacc = "něho" ; + pgen,pacc = "neho" ; ---- + other forms dat = "jemu" ; cdat = "mu" ; - pdat = "němu" ; - loc = "něm" ; - ins = "jím" ; - pins = "ním" ; + pdat = "nemu" ; + loc = "ňom" ; + ins,pins = "ním" ; } ; Ag Fem Sg P3 => { nom = "ona" ; - gen = "její" ; - dat,acc,cgen,cacc,cdat,ins = "ji" ; - pgen,pdat,pacc,loc,pins = "ní" ; + gen,cgen,pgen,acc,cacc,pacc = "ju" ; + cdat = "jej" ; + dat,pdat,loc = "nej" ; + ins,pins = "ní" ; } ; Ag Neutr Sg P3 => { nom = "ono" ; gen = "jeho" ; cgen,cacc = "ho" ; - pgen = "něho" ; + pgen = "neho" ; dat = "jemu" ; acc = "je" ; - pacc = "ně" ; + pacc = "eň" ; ---- bind? cdat = "mu" ; - pdat = "němu" ; - loc = "něm" ; - ins = "jím" ; - pins = "ním" ; + pdat = "nemu" ; + loc = "ňom" ; + ins,pins = "ním" ; } ; Ag _ Pl P1 => { nom = "my" ; @@ -739,7 +727,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { pgen,pacc, loc = "nás" ; dat,cdat,pdat = "nám" ; - ins,pins = "námi" ; + ins,pins = "nami" ; } ; Ag _ Pl P2 => { nom = "vy" ; @@ -748,23 +736,25 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { pgen,pacc, loc = "vás" ; dat,cdat,pdat = "vám" ; - ins,pins = "vámi" ; + ins,pins = "vami" ; } ; - Ag g Pl P3 => { - nom = case g of { - Masc _ => "oni" ; - Fem => "ony" ; - Neutr => "ona" - } ; - gen,cgen = "jich" ; - pgen = "nich" ; - dat,cdat = "jim" ; + Ag (Masc Anim) Pl P3 => { + nom = "oni" ; + gen,cgen,acc,cacc = "ich" ; + pgen,pacc = "nich" ; + dat,cdat = "im" ; pdat = "nim" ; - acc,cacc = "je" ; - pacc = "ně" ; loc = "nich" ; - ins = "jimi" ; - pins = "nimi" ; + ins,pins = "nimi" ; + } ; + Ag _ Pl P3 => { + nom = "ony" ; + gen,cgen,acc,cacc = "ich" ; + pgen,pacc = "ne" ; + dat,cdat = "im" ; + pdat = "nim" ; + loc = "nich" ; + ins,pins = "nimi" ; } } ; @@ -774,13 +764,13 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { oper DemPronForms : Type = { - msnom, fsnom, nsnom, - msgen, fsgen, + msnom, fsnom, nsnom, + msgen, fsgen, pgen, msdat, -- fsdat = fsgen unlike AdjForms fsacc, msloc, msins, fsins, - mpnom, fpnom, -- mpacc = fpacc = fpnom + ampnom, fpnom, -- mpacc = fpacc = fpnom pgen, pdat, -- NOT msins like AdjForms pins : Str @@ -804,34 +794,34 @@ oper size : NumSize } ; - mkDemPronForms : Str -> DemPronForms = \t -> { - msnom = t + "en" ; - fsnom = t + "a" ; - nsnom = t + "o" ; - msgen = t + "oho" ; - fsgen = t + "é" ; - msdat = t + "omu" ; - fsacc = t + "u" ; - msloc = t + "om" ; - msins = t + "ím" ; - fsins = t + "ou" ; - mpnom = t + "i" ; - fpnom = t + "y" ; - pgen = t + "ěch" ; - pdat = t + "ěm" ; - pins = t + "ěmi" ; + mkDemPronForms : Str -> DemPronForms = \jedn -> { + msnom = jedn + "y" ; + fsnom = jedn + "a" ; + nsnom = jedn + "o" ; + msgen = jedn + "ého" ; + fsgen = jedn + "ej" ; + msdat = jedn + "ému" ; + fsacc = jedn + "u" ; + msloc = jedn + "om" ; + msins = jedn + "ým" ; + fsins = jedn + "ou" ; + ampnom = jedn + "i" ; + fpnom = jedn + "é" ; ---- ? + pgen = jedn + "ých" ; + pdat = jedn + "ým" ; + pins = jedn + "ými" ; } ; invarDemPronForms : Str -> DemPronForms = \s -> { msnom, fsnom, nsnom, msgen, fsgen, msdat, fsacc, msloc, msins, fsins, - mpnom, fpnom, pgen, pdat, pins = s ; + ampnom, fpnom, pgen, pdat, pins = s ; } ; -- interrogatives kdoForms : Case => Str = table { - Nom => "kdo" ; + Nom => "kto" ; Gen | Acc => "koho" ; Dat => "komu" ; Loc => "kom" ; @@ -839,10 +829,10 @@ oper } ; coForms : Case => Str = table { - Nom|Acc => "co" ; - Gen => "čeho" ; + Nom|Acc => "čo" ; + Gen => "čoho" ; Dat => "čemu" ; - Loc => "čem" ; + Loc => "čom" ; Ins => "čím" } ; @@ -850,6 +840,7 @@ oper -- singular forms of demonstratives NumeralForms : Type = { + ---- amsnom, msnom, fsnom, nsnom, msgen, fsgen, msdat, @@ -862,11 +853,14 @@ oper \nume,size -> let dem = nume ** - {mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used + {ampnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used demAdj = dem ** {fsdat = dem.fsgen} ; adjAdj = adjFormsAdjective demAdj in { - s = \\g,c => adjAdj.s ! g ! Sg ! c ; + s = \\g,c => case of { +---- => nume.amsnom ; + _ => adjAdj.s ! g ! Sg ! c + } ; size = size } ; @@ -876,36 +870,43 @@ oper -- numbers 2,3,4 ---- to check if everything comes out right with the determiner type twoNumeral : Determiner = let forms = { - msnom = "dva" ; fsnom, nsnom, fsacc = "dvě" ; - msgen, fsgen, msloc = "dvou" ; - msdat, msins, fsins = "dvěma" +---- amsnom = "dvaja" ; + msnom = "dva" ; fsnom, nsnom, fsacc = "dve" ; + msgen, fsgen, msloc = "dvoch" ; + msdat = "dvom" ; + msins, fsins = "dvoma" } in numeralFormsDeterminer forms Num2_4 ; threeNumeral : Determiner = let forms = { - msnom, fsnom, nsnom, fsacc, msgen, fsgen = "tři" ; - msdat = "třem" ; - msloc = "třech" ; - msins,fsins = "třemi" ; + ---- amsnom = "traja" ; + msnom, fsnom, nsnom, fsacc = "tri" ; ---- amsacc = "troch" + msgen, fsgen = "troch" ; + msdat = "trom" ; + msloc = "troch" ; + msins,fsins = "tromi" ; } in numeralFormsDeterminer forms Num2_4 ; fourNumeral : Determiner = - let forms = { - msnom, fsnom, nsnom, fsacc = "čtyři" ; - msgen, fsgen = "čtyř" ; - msdat = "čtyřem" ; - msloc = "čtyřech" ; - msins,fsins = "čtyřmi" ; + let forms = { + ---- amsnom = "štiraja" ; + msnom, fsnom, nsnom, fsacc = "štiri" ; ---- amsacc = "štiroch" + msgen, fsgen = "štiroch" ; + msdat = "štirom" ; + msloc = "štiroch" ; + msins,fsins = "štiromi" ; } in numeralFormsDeterminer forms Num2_4 ; -- for the numbers 5 upwards - regNumeral : Str -> Str -> Determiner = \pet,peti -> + regNumeral : Str -> Str -> Determiner = \pät,piati -> let forms = { - msnom,fsnom,nsnom = pet ; - msgen, fsgen, msdat, fsacc, msloc, msins, fsins = peti + msnom,fsnom,nsnom, fsacc = pät ; + msgen, fsgen, msloc = piati + "ch" ; + msdat = piati + "m" ; + msins, fsins = piati + "mi" ; } in numeralFormsDeterminer forms Num5 ; From c24bf306219a81b0b8132992a6c293bc156e1dc6 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Wed, 29 Apr 2020 12:16:41 +0200 Subject: [PATCH 77/84] Slovak complete up to Czech, except content words, and needs checking --- src/slovak/NumeralSlo.gf | 32 +++++++++---------- src/slovak/ResSlo.gf | 62 ++++++++++++++++++------------------- src/slovak/StructuralSlo.gf | 16 +++++----- 3 files changed, 54 insertions(+), 56 deletions(-) diff --git a/src/slovak/NumeralSlo.gf b/src/slovak/NumeralSlo.gf index 19538c46e..96b2229fc 100644 --- a/src/slovak/NumeralSlo.gf +++ b/src/slovak/NumeralSlo.gf @@ -35,31 +35,31 @@ oper mk2Num : Determiner -> Str -> Str -> Str -> LinDigit = \unit, teenbase, tenbase, hundred -> mkNum unit teenbase (tenbase + "cet") hundred ; -oper mk5Num : Str -> Str -> Str -> Str -> LinDigit = - \unit,uniti, teenbase, tenbase -> - mkNum (regNumeral unit uniti) teenbase (tenbase + "desát") (unit ++ "set") ; +oper mk5Num : Str -> Str -> Str -> Str -> Str -> Str -> LinDigit = + \unit,unitich,unitim,unitimi, teenbase, tenbase -> + mkNum (regNumeral unit unitich unitim unitimi) teenbase (tenbase + "desiat") (unit ++ "sto") ; oper bigNumeral : Str -> LinNumeral = \s -> invarNumeral s ; lin num x = x ; -lin n2 = mk2Num twoNumeral "dva" "dva" ("dvě" ++ "stě") ; -lin n3 = mk2Num threeNumeral "tři" "tři" ("tři" ++ "sta") ; -lin n4 = mk2Num fourNumeral "čtr" "čtyři" ("čtyři" ++ "sta") ; -lin n5 = mk5Num "pět" "pěti" "pat" "pa" ; -lin n6 = mk5Num "šest" "šesti" "šest" "še" ; -lin n7 = mk5Num "sedm" "sedmi" "sedm" "sedm"; -lin n8 = mk5Num "osm" "osmi" "osm" "osm"; -lin n9 = mk5Num "devět" "devíti" "devate" "deva" ; +lin n2 = mk2Num twoNumeral "dva" "dva" ("dve" ++ "sto") ; +lin n3 = mk2Num threeNumeral "tri" "tri" ("tri" ++ "sto") ; +lin n4 = mk2Num fourNumeral "štr" "štyři" ("styri" ++ "sto") ; +lin n5 = mk5Num "päť" "piatich" "piatim" "piatimi" "pät" "pät" ; ---- +lin n6 = mk5Num "šest" "šestich" "šestim" "šestimi" "šest" "šest" ; ---- +lin n7 = mk5Num "sedem" "sedemich" "sedemim" "sedemimi" "sedem" "sedem"; ---- +lin n8 = mk5Num "osem" "osemich" "osemim" "osemimi" "osem" "osem"; +lin n9 = mk5Num "deväť" "deviatich" "deviatim" "deviatimi" "deväť" "deväť" ; lin pot01 = { - unit = oneNumeral.s ; hundred = "sto" ; ten = "deset" ; teen = "jedenáct" ; + unit = oneNumeral.s ; hundred = "sto" ; ten = "desať" ; teen = "jedenásť" ; size = Num1 } ; lin pot0 d = d ; -lin pot110 = bigNumeral "deset" ; -lin pot111 = bigNumeral "jedenáct" ; +lin pot110 = bigNumeral "desať" ; +lin pot111 = bigNumeral "jedenásť" ; lin pot1to19 d = bigNumeral d.teen ; lin pot0as1 n = {s = n.unit ; size = n.size} ; @@ -91,8 +91,8 @@ oper tfSize : NumSize -> NumSize = \sz -> oper mkTh : Str -> NumSize -> Str = \attr,size -> case size of { Num1 => "tisíc" ; - Num2_4 => attr ++ "tisíce" ; - Num5 => attr ++ "tisíc" + Num2_4 => attr ++ "tisíc" ; + Num5 => attr ++ "tisí" } ; oper determinerStr : Determiner -> Str = \d -> d.s ! Masc Anim ! Nom ; diff --git a/src/slovak/ResSlo.gf b/src/slovak/ResSlo.gf index 3e241d0c3..041a71d03 100644 --- a/src/slovak/ResSlo.gf +++ b/src/slovak/ResSlo.gf @@ -584,14 +584,13 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { --------------------- -- Verbs +-- https://en.wikipedia.org/wiki/Slovak_language#Verbs - VerbForms : Type = { ---- TODO more forms to add + VerbForms : Type = { ---- TODO more forms to add ? inf, pressg1, pressg2, pressg3, prespl1, prespl2, prespl3, - pastpartsg, pastpartpl, ----- passpart, - negpressg3 : Str -- matters only for copula + pastpmasc, pastpfem, pastpneutr : Str } ; ComplementCase : Type = {s : Str ; c : Case ; hasPrep : Bool} ; @@ -600,38 +599,36 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { = \vf,a,b -> case a of { Ag _ Sg P1 => vf.pressg1 ; Ag _ Sg P2 => vf.pressg2 ; - Ag _ Sg P3 => case b of { - True => vf.pressg3 ; - False => vf.negpressg3 -- matters only for copula - } ; + Ag _ Sg P3 => vf.pressg3 ; Ag _ Pl P1 => vf.prespl1 ; Ag _ Pl P2 => vf.prespl2 ; Ag _ Pl P3 => vf.prespl3 } ; copulaVerbForms : VerbForms = { - inf = "být" ; - pressg1 = "jsem" ; - pressg2 = "jsi" ; + inf = "byť" ; + pressg1 = "som" ; + pressg2 = "si" ; pressg3 = "je" ; - prespl1 = "jsme" ; - prespl2 = "jste" ; - prespl3 = "jsou" ; - pastpartsg = "byl" ; - pastpartpl = "byli" ; - negpressg3 = "ní" ; -- ne is added to this + prespl1 = "sme" ; + prespl2 = "ste" ; + prespl3 = "sú" ; + pastpmasc = "bol" ; + pastpfem = "bola" ; + pastpneutr = "bolo" ; } ; haveVerbForms : VerbForms = { - inf = "mít" ; + inf = "mať" ; pressg1 = "mám" ; pressg2 = "máš" ; - pressg3, negpressg3 = "má" ; + pressg3 = "má" ; prespl1 = "máme" ; prespl2 = "máte" ; - prespl3 = "mají" ; - pastpartsg = "měl" ; - pastpartpl = "měli" ; + prespl3 = "majú" ; + pastpmasc = "mal" ; + pastpfem = "mala" ; + pastpneutr = "malo" ; } ; -- just an example of a traditional paradigm @@ -644,14 +641,15 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { in { inf = kupovat ; - pressg1 = kupu + "ji" ; --- kupuju + pressg1 = kupu + "jem" ; pressg2 = kupu + "ješ" ; - pressg3, negpressg3 = kupu + "je" ; + pressg3 = kupu + "je" ; prespl1 = kupu + "jeme" ; prespl2 = kupu + "jete" ; - prespl3 = kupu + "jí" ; --- kupujou - pastpartsg = kupo + "val" ; - pastpartpl = kupo + "vali" ; + prespl3 = kupu + "jú" ; + pastpmasc = "kupoval" ; + pastpfem = "kupovala" ; + pastpneutr = "kupovalo" ; } ; @@ -901,17 +899,17 @@ oper in numeralFormsDeterminer forms Num2_4 ; -- for the numbers 5 upwards - regNumeral : Str -> Str -> Determiner = \pät,piati -> + regNumeral : Str -> Str -> Str -> Str -> Determiner = \pät,piatich,piatim,piatimi -> let forms = { msnom,fsnom,nsnom, fsacc = pät ; - msgen, fsgen, msloc = piati + "ch" ; - msdat = piati + "m" ; - msins, fsins = piati + "mi" ; + msgen, fsgen, msloc = piatich ; + msdat = piatim ; + msins, fsins = piatimi ; } in numeralFormsDeterminer forms Num5 ; invarDeterminer : Str -> NumSize -> Determiner = \sto,size -> - regNumeral sto sto ; + regNumeral sto sto sto sto ; invarNumeral : Str -> Determiner = \s -> invarDeterminer s Num5 ; diff --git a/src/slovak/StructuralSlo.gf b/src/slovak/StructuralSlo.gf index 6fea21060..214ca9fe2 100644 --- a/src/slovak/StructuralSlo.gf +++ b/src/slovak/StructuralSlo.gf @@ -4,20 +4,20 @@ concrete StructuralSlo of Structural = CatSlo ** lin and_Conj = mkConj "a" ; by8agent_Prep = mkPrep "od" Gen ; ---- TODO this means "from", there might be no good translation - few_Det = invarNumeral "málo" ; -- CEG 6.8 --- TODO genitive mála + few_Det = invarNumeral "málo" ; ----- for_Prep = mkPrep "pro" accusative ; - from_Prep = mkPrep (pre {"s"|"z" => "ze" ; _ => "z"}) Gen ; ---- consonant clusters + from_Prep = mkPrep (pre {"s"|"z" => "zo" ; _ => "z"}) Gen ; ---- consonant clusters have_V2 = mkV2 haveVerbForms ; - in_Prep = mkPrep (pre {"v"|"m" => "ve" ; _ => "v"}) Loc ; ---- - many_Det = regNumeral "mnoho" "mnoha" ; -- CEG 6.8 ---- - or_Conj = mkConj "nebo" ; - somePl_Det = regNumeral "několik" "několika" ; -- CEG 6.8 ---- - something_NP = {s,clit,prep = \\c => "ně" + coForms ! c ; a = Ag Neutr Sg P3 ; hasClit = False} ; -- CEG 5.6.3 + in_Prep = mkPrep (pre {"v"|"m" => "vo" ; _ => "v"}) Loc ; ---- + many_Det = regNumeral "mnoho" "mnohých" "mnohým" "mnohými" ; -- CEG 6.8 ---- + or_Conj = mkConj "alebo" ; + somePl_Det = {s = \\g,c => (demPronFormsAdjective (mkDemPronForms "nektor") "").s ! g ! Pl ! c ; size = Num5} ; + something_NP = {s,clit,prep = \\c => "nie" + coForms ! c ; a = Ag Neutr Sg P3 ; hasClit = False} ; -- CEG 5.6.3 possess_Prep = mkPrep "" Gen ; that_Quant = demPronFormsAdjective (mkDemPronForms "tamt") "" ; this_Quant = demPronFormsAdjective (mkDemPronForms "t") "to" ; to_Prep = mkPrep "do" Gen ; - with_Prep = mkPrep (pre {"s"|"z" => "se" ; _ => "s"}) Ins ; ---- + with_Prep = mkPrep (pre {"s"|"z" => "so" ; _ => "s"}) Ins ; ---- i_Pron = personalPron (Ag (Masc Anim) Sg P1) ; youSg_Pron = personalPron (Ag (Masc Anim) Sg P2) ; From 715787894f9824984cf435335457457fe2d49150 Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Wed, 29 Apr 2020 13:20:04 +0200 Subject: [PATCH 78/84] some words in LexiconSlo, to be checked --- src/slovak/LexiconSlo.gf | 62 +++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/src/slovak/LexiconSlo.gf b/src/slovak/LexiconSlo.gf index b625f1f50..ef99eb7bf 100644 --- a/src/slovak/LexiconSlo.gf +++ b/src/slovak/LexiconSlo.gf @@ -5,27 +5,28 @@ concrete LexiconSlo of Lexicon = ResSlo, ParadigmsSlo in { -{- + lin - boy_N = declPAN "kluk" ; - man_N = declMUZ "muž" ; - teacher_N = declMUZ "učitel" ; - horse_N = declMUZ "kůň" ; - father_N = declMUZ "otec" ; - husband_N = declPAN "manžel" ; + boy_N = mkN "chlapec" ; + man_N = mkN "muž" ; + teacher_N = mkN "učiteľ" ; + horse_N = mkN "kôň" ; + father_N = mkN "otec" ; + husband_N = mkN "manžel" ; - castle_N = declHRAD "hrad" ; - forest_N = declHRAD "les" ; - machine_N = declSTROJ "stroj" ; + castle_N = mkN "hrad" ; + forest_N = mkN "les" ; + machine_N = mkN "stroj" ; - woman_N = declZENA "žena" ; - school_N = declZENA "škola" ; ---- - skirt_N = declRUZE "sukně"; - street_N = declRUZE "ulice" ; - rose_N = declRUZE "růže" ; - song_N = declPISEN "píseň" ; - bed_N = declPISEN "postel" ; - door_N = declRUZE "dveře" ; + woman_N = mkN "žena" ; + school_N = mkN "učilište" ; + skirt_N = mkN "sukňa"; + street_N = mkN "ulica" ; + rose_N = mkN "ruže" ; + song_N = mkN "pieseň" ; + bed_N = mkN "posteľ" ; +{- + door_N = mkN "dveře" ; bone_N = declKOST "kost" ; village_N = declKOST "ves" ; ---- @@ -44,17 +45,20 @@ concrete LexiconSlo of Lexicon = beautiful_A = mkA "krásný" ; clean_A = mkA "čistý" ; dirty_A = mkA "špinavý" ; - - white_A = mkA "bílý" ; - black_A = mkA "černý" ; - red_A = mkA "červený" ; - brown_A = mkA "hnědý" ; - blue_A = mkA "modrý" ; - green_A = mkA "zelený" ; - yellow_A = mkA "žlutý" ; - - buy_V2 = mkV2 (iii_kupovatVerbForms "kupovat") ; - love_V2 = mkV2 (iii_kupovatVerbForms "milovat") ; -} + +--- from Google translate dictionary + + white_A = mkA "biely" ; + black_A = mkA "čierny" ; + red_A = mkA "červený" ; + brown_A = mkA "hnedý" ; + blue_A = mkA "modrý" ; --- belasý + green_A = mkA "zelený" ; + yellow_A = mkA "žltý" ; + + buy_V2 = mkV2 (iii_kupovatVerbForms "kupovať") ; + love_V2 = mkV2 (iii_kupovatVerbForms "milovať") ; + } From 219b3a2c0115f81a98f88e85cac59c94170843c0 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Wed, 29 Apr 2020 15:05:24 +0200 Subject: [PATCH 79/84] (Cze) Remove calls to Predef.error and just do something stupid instead. --- src/czech/ParadigmsCze.gf | 6 +++--- src/czech/ResCze.gf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/czech/ParadigmsCze.gf b/src/czech/ParadigmsCze.gf index 2f0a7bb0f..2c850d5e3 100644 --- a/src/czech/ParadigmsCze.gf +++ b/src/czech/ParadigmsCze.gf @@ -61,7 +61,7 @@ oper = \s -> lin N (declMESTO s) ; muzN : Str -> N = \s -> lin N (declMUZ s) ; - soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i} + soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i} = \s -> lin N (declSOUDCE s) ; strojN : Str -> N = \s -> lin N (declSTROJ s) ; @@ -97,7 +97,7 @@ oper _ + "í" => jarniAdjForms s ; _ + "ův" => otcuvAdjForms s ; _ + "in" => matcinAdjForms s ; - _ => Predef.error ("no mkA for" ++ s) + _ => matcinAdjForms s -- Predef.error ("no mkA for" ++ s) }) ; } ; @@ -133,7 +133,7 @@ oper mkPrep : Str -> Case -> Prep = \s,c -> lin Prep {s = s ; c = c ; hasPrep = True} ; ---- True if s /= "" - + mkConj : Str -> Conj = \s -> lin Conj {s1 = [] ; s2 = s} ; diff --git a/src/czech/ResCze.gf b/src/czech/ResCze.gf index f683a2ab1..b065aaca1 100644 --- a/src/czech/ResCze.gf +++ b/src/czech/ResCze.gf @@ -86,7 +86,7 @@ oper ul + "ice" => ul + "ic" ; koleg + "yně" => koleg + "yň" ; ruz + "e" => ruz + "í" ; - _ => Predef.error ("shortFemPlGen does not apply to" ++ s) + _ => s -- Predef.error ("shortFemPlGen does not apply to" ++ s) } ; --------------- @@ -155,7 +155,7 @@ oper => declKURE ; => declMORE ; => declSTAVENI ; - _ => Predef.error ("cannot infer declension type for" ++ nom ++ gen) + _ => declSTAVENI -- Predef.error ("cannot infer declension type for" ++ nom ++ gen) } in decl nom ; @@ -172,7 +172,7 @@ oper _ + "ce" => declSOUDCE s ; _ + "e" => declMORE s ; _ + "í" => declSTAVENI s ; - _ => Predef.error ("cannot guess declension type for" ++ s) + _ => declSTAVENI s -- Predef.error ("cannot guess declension type for" ++ s) } ; -- the traditional declensions, in both CEG and Wiki From 382279fb5beb0ada5ce34f69a105d4af14c6e508 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 29 Apr 2020 19:15:12 +0200 Subject: [PATCH 80/84] (Hun) Fixes in dMajom + pattern that recognises dMajom in smart paradigm --- src/hungarian/NounMorphoHun.gf | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index d214fae30..ebf4e85c0 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -91,12 +91,17 @@ oper majm = init majmo ; nMajmo = mkNoun majmo ; nMajom = mkNoun majom ; + o = last (init majom) ; in nMajmo ** { s = \\nc => case nc of { - SgSup -- All plural forms and Sg Acc and Sg Sup use the "majmo" stem - | PlStem - | SgAccStem => nMajmo.s ! nc ; + -- All plural forms and Sg Acc use the "majmo" stem + PlStem | SgAccStem => nMajmo.s ! nc ; + + -- Sg Sup uses the same majm* stem, but vowel can be different: + -- sátor, sátrat -> sátron, not *sátran + -- vászon, vásznat -> vásznon, not *vásznan + SgSup => majm + o + "n" ; -- The plural morpheme before possessive suffixes: majmai PossdPl => majm + harm "a" "e" ! nMajmo.h + "i" ; @@ -296,8 +301,8 @@ oper -- Stem 1: Sg Nom -- Stem 2: Sg Gen, Sg Sup, Pl * - <_ + #shortv + #c, -- majom, majmot - _ + #c + #shortv + "t"> => dMajom n a ; + <_ + #c + #shortv + #c, -- majom, majmot + _ + #c + #c + #shortv + "t"> => dMajom n a ; -- Stem 1: Sg Nom -- Stem 2: Sg Sup From 0e80e3b76d27715b3c07be11f337562e805eb898 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 29 Apr 2020 19:15:59 +0200 Subject: [PATCH 81/84] (Hun) Use 4-arg paradigm for some words in Lexicon --- src/hungarian/LexiconHun.gf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index 4d70bedf3..deda0643c 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -8,7 +8,7 @@ concrete LexiconHun of Lexicon = CatHun ** lin airplane_N = mkN "repülőgép" "repülőgépet" ; -- lin alas_Interj = mkInterj "" ; -- lin already_Adv = mkA "" ; -lin animal_N = mkN "állat" "állatot" ; +lin animal_N = mkN "állat" "állatot" "állatok" "állata" ; -- lin answer_V2S = mkV2S "válasz" ; lin apartment_N = mkN "lakás" "lakást" ; lin apple_N = mkN "alma" ; @@ -261,10 +261,10 @@ lin peace_N = mkN "béke" "békét"; lin pen_N = mkN "toll" "tollat" ; lin person_N = mkN "ember" "embert"; lin planet_N = mkN "bolygó" "bolygót" ; -lin plastic_N = mkN "műanyag" "műanyagot" ; +lin plastic_N = mkN "műanyag" "műanyagot" "műanyagok" "műanyaga" ; -- lin play_V = mkV "" ; lin policeman_N = mkN "rendőr" "rendőrt"; --the police "rendőrség" -lin priest_N = mkN "pap" "papot" ; +lin priest_N = mkN "pap" "papot" "papok" "papja" ; -- lin pull_V2 = mkV2 "" ; -- lin push_V2 = mkV2 "" ; -- lin put_V2 = mkV2 "" ; @@ -279,7 +279,7 @@ lin rain_N = mkN "eső" "esőt" ; -- lin rain_V0 = mkV "" ; -- lin read_V2 = mkV2 "" ; lin ready_A = mkA "kész" ; -lin reason_N = mkN "ok" "okot" ; +lin reason_N = mkN "ok" "okot" "okok" "oka" ; lin red_A = mkA "piros" ; lin religion_N = mkN "vallás" "vallást"; lin restaurant_N = mkN "étterem" "éttermet"; @@ -300,14 +300,14 @@ lin rule_N = mkN "szabály" "szabályt" ; -- S lin salt_N = mkN "só" "sót" ; -lin sand_N = mkN "homok" "homokot" ; +lin sand_N = mkN "homok" "homokot" "homokok" "homokja" ; -- lin say_VS = mkVS "" ; lin school_N = mkN "iskola" "iskolát"; lin science_N = mkN "tudomány" "tudományt" ; -- lin scratch_V2 = mkV2 "" ; lin sea_N = mkN "tenger" "tengert"; lin see_V2 = mkV2 "lát" ; -lin seed_N = mkN "mag" "magot" ; +lin seed_N = mkN "mag" "magot" "magok" "magja" ; -- lin seek_V2 = mkV2 "" ; -- lin sell_V3 = mkV3 "" ; -- lin send_V3 = mkV3 "" ; @@ -341,7 +341,7 @@ lin song_N = mkN "dal" "dalt" ; -- lin squeeze_V2 = mkV2 "" ; -- lin stab_V2 = mkV2 "" ; -- lin stand_V = mkV "" ; -lin star_N = mkN "csillag" "csillagot" ; +lin star_N = mkN "csillag" "csillagot" "csillagok" "csillaga" ; lin steel_N = mkN "acél" "ok" harmA ; lin stick_N = mkN "rúd" "rudat" ; lin stone_N = mkN "kő" "követ" ; @@ -373,7 +373,7 @@ lin thin_A = mkA "vekony" ; lin today_Adv = mkAdv "ma" ; lin tongue_N = mkN "nyelv" "nyelvet"; --same as language lin tooth_N = mkN "fog" "fogat" ; -lin train_N = mkN "vonat" "vonatot" ; +lin train_N = mkN "vonat" "vonatot" "vonatok" "vonata" ; -- lin travel_V = mkV "" ; lin tree_N = mkN "fa" "fát"; -- lin turn_V = mkV "" ; @@ -404,7 +404,7 @@ lin wide_A = mkA "széles" ; lin wife_N = mkN "feleség" "feleséget" ; -- lin win_V2 = mkV2 "" ; lin wind_N = mkN "szél" "szelet" ; -lin window_N = mkN "ablak" "ablakot" ; +lin window_N = mkN "ablak" "ablakot" "ablakok" "ablaka" ; lin wine_N = mkN "bor" "bort"; lin wing_N = mkN "szárny" "szárnyat"; -- lin wipe_V2 = mkV2 "" ; From db3c559fc85fb3028a2a22a07878b5e35060e956 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 29 Apr 2020 19:20:34 +0200 Subject: [PATCH 82/84] (Hun) Remove calls to Predef.error --- src/hungarian/NounMorphoHun.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hungarian/NounMorphoHun.gf b/src/hungarian/NounMorphoHun.gf index ebf4e85c0..5b08fb429 100644 --- a/src/hungarian/NounMorphoHun.gf +++ b/src/hungarian/NounMorphoHun.gf @@ -448,7 +448,7 @@ oper x + "u" => x + "ú" ; x + "ö" => x + "ő" ; x + "ü" => x + "ű" ; - _ => Predef.error "Lengthening not applicable to" ++ str + _ => str -- Lengthening not applicable to str } ; shorten : Str -> Str = \str -> case str of { @@ -459,7 +459,7 @@ oper x + "ú" => x + "u" ; x + "ő" => x + "ö" ; x + "ű" => x + "ü" ; - _ => Predef.error "Shortening not applicable to" ++ str + _ => str -- Shortening not applicable to str } ; -- Function to get a harmony from a string From f9db17993afd8d3cb31711e0d77e9bba1c47c6c9 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Thu, 30 Apr 2020 07:51:50 +0200 Subject: [PATCH 83/84] Slo: probe for long vs short endings ; default with prefix ?? instead of errorr in smart paradigms --- src/slovak/ResSlo.gf | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/slovak/ResSlo.gf b/src/slovak/ResSlo.gf index 041a71d03..531125255 100644 --- a/src/slovak/ResSlo.gf +++ b/src/slovak/ResSlo.gf @@ -35,8 +35,17 @@ oper "b" | "f" | "l" | "m" | "p" | "s" | "v" | "ľ" | "ĺ" | "ŕ" | "dz" ) ; - accentedVowel : pattern Str = #("á"|"é"|"í"|"ó"|"ú"|"ý") ; - + accentedVowel : pattern Str = #("á"|"é"|"í"|"ú"|"ý") ; + + diphthong : pattern Str = #("ia"|"ie"|"iu"|"ô") ; + + addAccented : (stem,long,short : Str) -> Str = \stem,long,short -> + case stem of { + _ + (#accentedVowel | #diphthong) + ? + ? => stem + short ; + _ + (#accentedVowel | #diphthong) + ? => stem + short ; + _ => stem + long + } ; + --------------- -- Nouns --------------- @@ -111,7 +120,7 @@ oper => dievceniecN snom ; => dievcaN snom ; - _ => Predef.error ("cannot infer declension type for" ++ snom ++ pgen) + _ => dubN ("??"+snom) ** {pgen = pgen} ---- Predef.error ("cannot infer declension type for" ++ snom ++ pgen) } ** {pgen = pgen ; g = g} ; -- the "smartest" one-argument mkN @@ -131,7 +140,7 @@ oper _ + "e" => srdceN snom ; _ + "ä" => dievcaN snom ; - _ => Predef.error ("cannot guess declension type for" ++ snom) + _ => dubN ("??"+snom) ---- Predef.error ("cannot guess declension type for" ++ snom) } ; @@ -235,7 +244,8 @@ oper zien : Str = case zen of { z + "e" + c@? => z + "ie" + c ; _ => zen ---- TODO: many more rules - } + } ; + zenaa = addAccented zen "á" "a" ; in { snom = zena ; @@ -247,9 +257,9 @@ oper pnom = zen + "y" ; pgen = zien ; - pdat = zen + "ám" ; + pdat = zenaa + "m" ; pacc = zen + "y" ; - ploc = zen + "ách" ; + ploc = zenaa + "ch" ; pins = zen + "ami" ; g = Fem @@ -329,7 +339,8 @@ oper miest : Str = case mest of { m + "e" + c@(? | (? + ?)) => m + "ie" + c ; _ => mest ---- TODO: many more rules - } + } ; + mesta = addAccented mest "á" "a" in { @@ -340,11 +351,11 @@ oper sloc = mest + "e" ; sins = mest + "om" ; - pnom = mest + "á" ; + pnom = mesta ; pgen = miest ; - pdat = mest + "ám" ; - pacc = mest + "á" ; - ploc = mest + "ách" ; + pdat = mesta + "m" ; + pacc = mesta ; + ploc = mesta + "ch" ; pins = mest + "ami" ; g = Neutr @@ -485,8 +496,8 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> { _ + "y" => krasnyA s ; _ + "í" => cudziA s ; _ + "i" => rydziA s ; - _ + "ov" => otcovA s ; - _ => Predef.error ("no mkA for" ++ s) + _ + ("ov"|"in") => otcovA s ; + _ => otcovA ("??"+s) ---- Predef.error ("no mkA for" ++ s) } ; From bdd8827423320ae6ef5be9f0d7014c02025e0aad Mon Sep 17 00:00:00 2001 From: aarneranta Date: Thu, 30 Apr 2020 07:58:23 +0200 Subject: [PATCH 84/84] Cze: prefix wildly guessed inflections with ?? --- src/czech/ParadigmsCze.gf | 2 +- src/czech/ResCze.gf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/czech/ParadigmsCze.gf b/src/czech/ParadigmsCze.gf index 2c850d5e3..a8cb96789 100644 --- a/src/czech/ParadigmsCze.gf +++ b/src/czech/ParadigmsCze.gf @@ -97,7 +97,7 @@ oper _ + "í" => jarniAdjForms s ; _ + "ův" => otcuvAdjForms s ; _ + "in" => matcinAdjForms s ; - _ => matcinAdjForms s -- Predef.error ("no mkA for" ++ s) + _ => matcinAdjForms ("??" + s) -- Predef.error ("no mkA for" ++ s) }) ; } ; diff --git a/src/czech/ResCze.gf b/src/czech/ResCze.gf index b065aaca1..1ff5c71d9 100644 --- a/src/czech/ResCze.gf +++ b/src/czech/ResCze.gf @@ -86,7 +86,7 @@ oper ul + "ice" => ul + "ic" ; koleg + "yně" => koleg + "yň" ; ruz + "e" => ruz + "í" ; - _ => s -- Predef.error ("shortFemPlGen does not apply to" ++ s) + _ => "??" + s -- Predef.error ("shortFemPlGen does not apply to" ++ s) } ; --------------- @@ -155,7 +155,7 @@ oper => declKURE ; => declMORE ; => declSTAVENI ; - _ => declSTAVENI -- Predef.error ("cannot infer declension type for" ++ nom ++ gen) + _ => (\s -> declSTROJ ("??" + s)) -- Predef.error ("cannot infer declension type for" ++ nom ++ gen) } in decl nom ; @@ -172,7 +172,7 @@ oper _ + "ce" => declSOUDCE s ; _ + "e" => declMORE s ; _ + "í" => declSTAVENI s ; - _ => declSTAVENI s -- Predef.error ("cannot guess declension type for" ++ s) + _ => declSTROJ ("??" + s) -- Predef.error ("cannot guess declension type for" ++ s) } ; -- the traditional declensions, in both CEG and Wiki