From 29c044a31564812d1ed4537ad65a786b1dc5d5e6 Mon Sep 17 00:00:00 2001 From: odanoburu Date: Tue, 26 Jun 2018 17:35:37 -0300 Subject: [PATCH] (Romance) add lins - add AdVVPSlash, AdvVPSlash, CountNP, PartNP - simplify opers using record extension - rm CountNP from NounPor --- src/portuguese/NounPor.gf | 7 ------- src/romance/NounRomance.gf | 9 ++++++++- src/romance/ResRomance.gf | 26 ++++++-------------------- src/romance/VerbRomance.gf | 4 ++++ 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/portuguese/NounPor.gf b/src/portuguese/NounPor.gf index ce18a6803..2ca4f1875 100644 --- a/src/portuguese/NounPor.gf +++ b/src/portuguese/NounPor.gf @@ -1,11 +1,4 @@ concrete NounPor of Noun = CatPor ** NounRomance with (ResRomance = ResPor) ** open Prelude, PhonoPor in { - lin - -- not implemented for romance languages, maybe because it can't - -- be done elegantly? - CountNP det np = heavyNPpol np.isNeg - {s = \\c => det.s ! np.a.g ! c ++ (np.s ! c).ton ; - a = np.a ** {n = det.n} } ; - } ; diff --git a/src/romance/NounRomance.gf b/src/romance/NounRomance.gf index b0e94ae09..465d8e7a3 100644 --- a/src/romance/NounRomance.gf +++ b/src/romance/NounRomance.gf @@ -180,8 +180,15 @@ incomplete concrete NounRomance of Noun = g = cn.g ; } ; - -- PartNP and CounNP missing: how to define 'of' in the functor? + PartNP cn np = { + s = \\n => cn.s ! n ++ appCompl {s = [] ; c = genitive ; isDir = False} np ; + g = cn.g ; + } ; + CountNP det np = heavyNPpol np.isNeg + {s = \\c => det.s ! np.a.g ! c ++ (np.s ! genitive).ton ; + a = np.a ** {n = det.n} } ; + AdjDAP det ap = { s = \\g => det.s ! g ++ ap.s ! AF g det.n ; n = det.n ; diff --git a/src/romance/ResRomance.gf b/src/romance/ResRomance.gf index 9d08d4947..bd0ab912b 100644 --- a/src/romance/ResRomance.gf +++ b/src/romance/ResRomance.gf @@ -77,7 +77,6 @@ oper oper - predV : Verb -> VP = \verb -> let typ = verb.vtyp ; @@ -111,16 +110,9 @@ oper ext = vp.ext ; } ; - insertComplement : (Agr => Str) -> VP -> VP = \co,vp -> { - s = vp.s ; - agr = vp.agr ; - clit1 = vp.clit1 ; - clit2 = vp.clit2 ; - clit3 = vp.clit3 ; - isNeg = vp.isNeg ; --- can be in compl as well - neg = vp.neg ; + insertComplement : (Agr => Str) -> VP -> VP ; + insertComplement co vp = vp ** { comp = \\a => vp.comp ! a ++ co ! a ; - ext = vp.ext ; } ; @@ -141,16 +133,10 @@ oper comp = \\a => vp.comp ! a ++ co ; } ; - insertAdV : Str -> VP -> VP = \co,vp -> { - s = vp.s ; - agr = vp.agr ; - clit1 = vp.clit1 ; - clit2 = vp.clit2 ; - clit3 = vp.clit3 ; - isNeg = vp.isNeg ; - neg = \\b => let vpn = vp.neg ! b in {p1 = vpn.p1 ; p2 = vpn.p2 ++ co} ; - comp = vp.comp ; - ext = vp.ext ; + insertAdV : Str -> VP -> VP ; + insertAdV co vp = vp ** { + neg = \\b => let vpn = vp.neg ! b + in {p1 = vpn.p1 ; p2 = vpn.p2 ++ co} } ; insertClit3 : Str -> VP -> VP = \co,vp -> { diff --git a/src/romance/VerbRomance.gf b/src/romance/VerbRomance.gf index dcdabb026..a5bfa4e51 100644 --- a/src/romance/VerbRomance.gf +++ b/src/romance/VerbRomance.gf @@ -105,6 +105,10 @@ incomplete concrete VerbRomance of Verb = AdVVP adv vp = insertAdV adv.s vp ; + AdvVPSlash vps adv = vps ** insertAdv adv.s vps ; + + AdVVPSlash adv vps = vps ** insertAdV adv.s vps ; + PassV2 v = insertComplement (\\a => let agr = complAgr a in v.s ! VPart agr.g agr.n) (predV auxPassive) ;