From ed08ae83d07796a6f25ef8de326431f0f719f555 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sat, 2 Jun 2018 20:48:00 +0200 Subject: [PATCH] more functions in ExtendBul & ExtendSwe --- src/bulgarian/ExtendBul.gf | 58 +++++++++++++++++++++++++++++++++++++- src/bulgarian/ExtraBul.gf | 14 --------- src/bulgarian/ResBul.gf | 13 +++++++++ src/swedish/ExtendSwe.gf | 13 +++++++-- 4 files changed, 80 insertions(+), 18 deletions(-) diff --git a/src/bulgarian/ExtendBul.gf b/src/bulgarian/ExtendBul.gf index 7cb8eabf8..6aa3fb4a4 100644 --- a/src/bulgarian/ExtendBul.gf +++ b/src/bulgarian/ExtendBul.gf @@ -1,7 +1,9 @@ --# -path=.:../abstract:../common:prelude -concrete ExtendBul of Extend = CatBul ** open Prelude, Predef, ResBul, StructuralBul in { +concrete ExtendBul of Extend = CatBul ** open Prelude, Predef, ResBul, GrammarBul in { lin + GenModNP num np cn = DetCN (DetQuant DefArt num) (AdvCN cn (PrepNP possess_Prep np)) ; -- this man's car(s) ; DEFAULT the car of this man + AdAdV = cc2 ; EmptyRelSlash slash = { @@ -54,6 +56,13 @@ lin "от" ++ np.s ! RObj Acc in {s = ap; adv = ap ! ASg Neut Indef ! P3; isPre = False} ; + GerundCN vp = { + s = \\nform => vp.ad.s ++ + vp.s ! Imperf ! VNoun nform ++ + vp.compl ! {gn=GSg Neut; p=P3} ; + g = ANeut + } ; + GerundNP vp = { s = \\_ => daComplex Simul Pos vp ! Imperf ! {gn=GSg Neut; p=P1}; a = {gn=GSg Neut; p=P3}; @@ -95,5 +104,52 @@ lin s = \\a => conj.s++(linCoordSep [])!conj.distr!conj.conj++vps.s!conj.distr!conj.conj!a; } ; +lincat + RNP = {s : Agr => Role => Str; a : Agr; p : Polarity} ; + +lin + ReflRNP slash rnp = { + s = slash.s ; + ad = slash.ad ; + compl = \\a => slash.compl1 ! a ++ slash.c2.s ++ rnp.s ! a ! RObj slash.c2.c ++ slash.compl2 ! rnp.a ; + vtype = slash.vtype ; + p = orPol rnp.p slash.p ; + isSimple = False + } ; + + ReflPron = + { s = \\agr,role => "себе си"; + a = {gn = GSg Masc; p = P3} ; + p = Pos + } ; + + ReflPoss num cn = + { s = \\agr,role => + let nf = case num.nn of { + NNum Sg => case role of { + RVoc => NFVocative ; + _ => NF Sg Indef + } ; + NNum Pl => NF Pl Indef; + NCountable => case cn.g of { + AMasc Human => NF Pl Indef; + _ => NFPlCount + } + } ; + s = reflPron ! aform (gennum cn.g (numnnum num.nn)) Def (RObj Acc) ++ num.s ! dgenderSpecies cn.g Indef role ++ cn.s ! nf + in case role of { + RObj Dat => "на" ++ s; + _ => s + } ; + a = {gn = gennum cn.g (numnnum num.nn); p = P3} ; + p = Pos + } ; + + PredetRNP pred rnp = { + s = \\a,c => pred.s ! rnp.a.gn ++ rnp.s ! a ! c ; + a = rnp.a ; + p = rnp.p + } ; + } diff --git a/src/bulgarian/ExtraBul.gf b/src/bulgarian/ExtraBul.gf index f98c20d72..bc02a6857 100644 --- a/src/bulgarian/ExtraBul.gf +++ b/src/bulgarian/ExtraBul.gf @@ -56,20 +56,6 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** IAdvAdv adv = {s = \\qf => (mkIAdv "").s ! qf ++ adv.s} ; - oper - reflPron : AForm => Str = - table { - ASg Masc Indef => "" ; - ASg Masc Def => "" ; - ASgMascDefNom => "" ; - ASg Fem Indef => "" ; - ASg Fem Def => "" ; - ASg Neut Indef => "" ; - ASg Neut Def => "" ; - APl Indef => "" ; - APl Def => "" - } ; - lincat VPI = {s : Agr => Str} ; [VPI] = {s : Bool => Ints 2 => Agr => Str} ; diff --git a/src/bulgarian/ResBul.gf b/src/bulgarian/ResBul.gf index 9000c7ae2..c12e7eb12 100644 --- a/src/bulgarian/ResBul.gf +++ b/src/bulgarian/ResBul.gf @@ -750,4 +750,17 @@ resource ResBul = ParamX ** open Prelude, Predef in { comma : Str = SOFT_BIND ++ "," ; hyphen : Str = SOFT_BIND ++ "-" ++ SOFT_BIND ; + + reflPron : AForm => Str = + table { + ASg Masc Indef => "" ; + ASg Masc Def => "" ; + ASgMascDefNom => "" ; + ASg Fem Indef => "" ; + ASg Fem Def => "" ; + ASg Neut Indef => "" ; + ASg Neut Def => "" ; + APl Indef => "" ; + APl Def => "" + } ; } diff --git a/src/swedish/ExtendSwe.gf b/src/swedish/ExtendSwe.gf index f579d5f37..86554dcb2 100644 --- a/src/swedish/ExtendSwe.gf +++ b/src/swedish/ExtendSwe.gf @@ -2,12 +2,12 @@ concrete ExtendSwe of Extend = CatSwe ** ExtendFunctor - [ - GenNP, ComplBareVS, CompBareCN, + GenNP, GenModNP, ComplBareVS, CompBareCN, StrandRelSlash, EmptyRelSlash, StrandQuestSlash, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, ICompAP, - AdAdV, PositAdVAdj, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP, + AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP, RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, CompoundN @@ -25,6 +25,7 @@ concrete ExtendSwe of Extend = CatSwe ** det = DDef Indef } ; + GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ; ComplBareVS v s = insertObj (\\_ => s.s ! Sub) (predV v) ; @@ -176,7 +177,13 @@ concrete ExtendSwe of Extend = CatSwe ** s = \\af => partVPPlusPost vp (PartPret af Nom) (aformpos2agr af) Pos ++ "av" ++ np.s ! accusative ; isPre = False } ; - + + GerundCN vp = { -- infinitive: att dricka öl, att vara glad + s = \\_,_,_ => "att" ++ infVP vp {g = Utr ; n = Sg ; p = P3} ; + g = Neutr ; + isMod = False + } ; + GerundNP vp = { -- infinitive: att dricka öl, att vara glad s = \\_ => "att" ++ infVP vp {g = Utr ; n = Sg ; p = P3} ; a = {g = Neutr ; n = Sg ; p = P3} ;