diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index b525638b..4970a21a 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 e0d596c2..9fc6d33e 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 f870e38a..8969ea58 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 dbcf51f8..2c07f4e7 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 9cc252f2..5e27da75 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 d0207fcf..3ace6414 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 433864de..b3fbb51d 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.