From 54870ec67838ae3c6866fff6db477e514d5e49c5 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 19 Jul 2019 10:22:07 +0300 Subject: [PATCH] (Est) Minor cleanup+formatting --- src/estonian/ConjunctionEst.gf | 99 ++++++++++++++++------------------ 1 file changed, 45 insertions(+), 54 deletions(-) diff --git a/src/estonian/ConjunctionEst.gf b/src/estonian/ConjunctionEst.gf index 05d8c44e8..330bb50b5 100644 --- a/src/estonian/ConjunctionEst.gf +++ b/src/estonian/ConjunctionEst.gf @@ -1,4 +1,4 @@ -concrete ConjunctionEst of Conjunction = +concrete ConjunctionEst of Conjunction = CatEst ** open ResEst, Coordination, Prelude in { flags optimize=all_subs ; coding=utf8; @@ -16,11 +16,7 @@ concrete ConjunctionEst of Conjunction = isPron = False } ; --- ConjAP conj ss = conjunctDistrTable2 Bool NForm conj ss ** { - ConjAP conj ss = conjunctDistrTableAdj conj ss ** { - infl = ss.s2.infl ; ---- was: True, which is of wrong type. AR 1/2/2014 - lock_AP = <> - } ; + ConjAP conj ss = conjunctDistrTableAdj conj ss ; ConjRS conj ss = conjunctDistrTable Agr conj ss ** { c = ss.c @@ -38,8 +34,6 @@ concrete ConjunctionEst of Conjunction = ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ; BaseAP x y = twoTableAdj x y ; ConsAP xs x = consrTableAdj comma x xs ; --- BaseAP x y = twoTable2 Bool NForm x y ; --- ConsAP xs x = consrTable2 Bool NForm comma xs x ; BaseRS x y = twoTable Agr x y ** {c = y.c} ; ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ; @@ -48,67 +42,64 @@ concrete ConjunctionEst of Conjunction = [Adv] = {s1,s2 : Str} ; [CN] = {s1,s2 : NForm => Str} ; [NP] = {s1,s2 : NPForm => Str ; a : Agr} ; - [AP] = {s1,s2 : {s : Bool => NForm => Str ; infl : Infl }} ; + [AP] = {s1,s2 : {s : Bool => NForm => Str ; infl : Infl }} ; [RS] = {s1,s2 : Agr => Str ; c : NPForm} ; - + oper --Modified from prelude/Coordination.gf generic functions twoTableAdj : (_,_ : AP) -> [AP] = \x,y -> lin ListAP { - s1 = x ; - s2 = y ; - lock_ListAP = <> - } ; - + s1 = x ; + s2 = y + } ; + consrTableAdj : Str -> [AP] -> {s : Bool => NForm => Str ; infl : Infl} -> [AP] = \c,xs,x -> let - ap1 = xs.s1 ; - ap2 = xs.s2 - in - lin ListAP {s1 = + ap1 = xs.s1 ; + ap2 = xs.s2 + in + lin ListAP {s1 = {s = \\isMod,nf => - case isMod of { - True => case of { - <(Participle|Invariable),(Participle|Invariable)> => - ap1.s ! isMod ! (NCase Sg Nom) ++ c ++ ap2.s ! isMod ! (NCase Sg Nom) ; --valmis ja täis kassid - <(Participle|Invariable),Regular> => - ap1.s ! isMod ! (NCase Sg Nom) ++ c++ ap2.s ! isMod ! nf ; --valmis ja suured kassid - => - ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! (NCase Sg Nom) ; --suured ja valmis kassid - _ => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --suured ja mustad kassid - } ; - False => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --kassid on valmid ja suured - } ; - infl = Regular ; - lock_AP = <> } ; + case isMod of { + True => case of { + <(Participle|Invariable),(Participle|Invariable)> => + ap1.s ! isMod ! (NCase Sg Nom) ++ c ++ ap2.s ! isMod ! (NCase Sg Nom) ; --valmis ja täis kassid + <(Participle|Invariable),Regular> => + ap1.s ! isMod ! (NCase Sg Nom) ++ c++ ap2.s ! isMod ! nf ; --valmis ja suured kassid + => + ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! (NCase Sg Nom) ; --suured ja valmis kassid + _ => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --suured ja mustad kassid + } ; + False => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --kassid on valmid ja suured + } ; + infl = Regular } ; s2 = x ; lock_ListAP = <> - } ; + } ; + - conjunctDistrTableAdj : ConjunctionDistr -> [AP] -> AP = \or,xs -> let ap1 = xs.s1 ; - ap2 = xs.s2 ; + ap2 = xs.s2 ; in lin AP {s = \\isMod,nf => - case isMod of { - True => case of { - <(Participle|Invariable),(Participle|Invariable)> => - or.s1 ++ ap1.s ! isMod ! (NCase Sg Nom) ++ - or.s2 ++ ap2.s ! isMod ! (NCase Sg Nom) ; - <(Participle|Invariable),Regular> => - or.s1 ++ ap1.s ! isMod ! (NCase Sg Nom) ++ - or.s2 ++ ap2.s ! isMod ! nf ; - => - or.s1 ++ ap1.s ! isMod ! nf ++ - or.s2 ++ ap2.s ! isMod ! (NCase Sg Nom) ; - _ => or.s1 ++ ap1.s ! isMod ! nf ++ or.s2 ++ ap2.s ! isMod ! nf - } ; - False => or.s1 ++ ap1.s ! isMod ! nf ++ or.s2 ++ ap2.s ! isMod ! nf - } ; - infl = Regular ; - lock_AP = <> - } ; + case isMod of { + True => case of { + <(Participle|Invariable),(Participle|Invariable)> => + or.s1 ++ ap1.s ! isMod ! (NCase Sg Nom) ++ + or.s2 ++ ap2.s ! isMod ! (NCase Sg Nom) ; + <(Participle|Invariable),Regular> => + or.s1 ++ ap1.s ! isMod ! (NCase Sg Nom) ++ + or.s2 ++ ap2.s ! isMod ! nf ; + => + or.s1 ++ ap1.s ! isMod ! nf ++ + or.s2 ++ ap2.s ! isMod ! (NCase Sg Nom) ; + _ => or.s1 ++ ap1.s ! isMod ! nf ++ or.s2 ++ ap2.s ! isMod ! nf + } ; + False => or.s1 ++ ap1.s ! isMod ! nf ++ or.s2 ++ ap2.s ! isMod ! nf + } ; + infl = Regular + } ; }