From e2d79a72f64ba84ef853ed209d928b35f5cb26c9 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 25 Apr 2020 14:47:56 +0200 Subject: [PATCH] (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) ; ------------------