From bff100b75b63361d55b1e96595c4a1c1b5acd452 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 Apr 2020 18:05:44 +0200 Subject: [PATCH] (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