diff --git a/lib/src/catalan/DiffCat.gf b/lib/src/catalan/DiffCat.gf index 7b42949fc..28b26ee65 100644 --- a/lib/src/catalan/DiffCat.gf +++ b/lib/src/catalan/DiffCat.gf @@ -1,9 +1,17 @@ --# -path=.:../romance:../abstract:../common:prelude -instance DiffCat of DiffRomance = open CommonRomance, PhonoCat, BeschCat, Prelude in { +instance DiffCat of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRomance, PhonoCat, BeschCat, Prelude in { flags optimize=noexpand ; coding=utf8 ; +---- exceptions ---------------- + oper + partAgr : VType -> Bool = \vtyp -> False ; + vpAgrSubj : Verb -> VPAgrType = \v -> ; + vpAgrClits : Verb -> AAgr -> VPAgrType = \v,a -> ; + +-------------------------------- + param Prepos = P_de | P_a ; VType = VHabere | VRefl ; @@ -66,8 +74,6 @@ oper auxVerb : VType -> (VF => Str) = \_ -> haver_V.s ; - partAgr : VType -> VPAgr = \vtyp -> vpAgrNone ; - vpAgrClit : Agr -> VPAgr = \a -> vpAgrNone ; diff --git a/lib/src/french/DiffFre.gf b/lib/src/french/DiffFre.gf index f85bd6532..0651e40d6 100644 --- a/lib/src/french/DiffFre.gf +++ b/lib/src/french/DiffFre.gf @@ -61,15 +61,15 @@ instance DiffFre of DiffRomance - [ _ => copula.s } ; - partAgr : VType -> VPAgr = \vtyp -> case vtyp of { - VTyp VHabere _ => vpAgrNone ; - _ => VPAgrSubj - } ; - vpAgrClit : Agr -> VPAgr = \a0 -> let a = complAgr a0 in VPAgrClit a.g a.n ; + partAgr : VType -> Bool = \vtyp -> case vtyp of { -- works for all except Spa + VTyp VHabere _ => False ; + _ => True + } ; + ---- pronArg = pronArgGen Neg ; --- takes more space and time pronArg : Number -> Person -> CAgr -> CAgr -> Str * Str * Bool = diff --git a/lib/src/italian/DiffIta.gf b/lib/src/italian/DiffIta.gf index 694ad03bc..5cbec5569 100644 --- a/lib/src/italian/DiffIta.gf +++ b/lib/src/italian/DiffIta.gf @@ -88,15 +88,15 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, _ => copula.s } ; - partAgr : VType -> VPAgr = \vtyp -> case vtyp of { - VHabere => vpAgrNone ; - _ => VPAgrSubj - } ; - vpAgrClit : Agr -> VPAgr = \a0 -> let a = complAgr a0 in VPAgrClit a.g a.n ; + partAgr : VType -> Bool = \vtyp -> case vtyp of { -- works for all except Spa + VHabere => False ; + _ => True + } ; + pronArg = \n,p,acc,dat -> let pacc = case acc of { --- only accusative refl handled diff --git a/lib/src/romance/DiffRomance.gf b/lib/src/romance/DiffRomance.gf index 8b2380397..94a625501 100644 --- a/lib/src/romance/DiffRomance.gf +++ b/lib/src/romance/DiffRomance.gf @@ -25,7 +25,7 @@ interface DiffRomance = open CommonRomance, Prelude in { -- Derivatively, if/when the participle agrees to the subject. -- (Fre "elle est partie", Ita "lei è partita", Spa not) - oper partAgr : VType -> VPAgr ; + oper partAgr : VType -> Bool ; -- Whether participle agrees to foregoing clitic. -- (Fre "je l'ai vue", Spa "yo la he visto") @@ -105,9 +105,16 @@ param oper Verb = {s : VF => Str ; vtyp : VType ; p : Str} ; + VPAgrType : Type = Str * Bool ; ---- originally VPAgr, expensive + getVPAgr : Verb -> VPAgrType = \v -> ; -- str may be used + vpAgrSubj : Verb -> VPAgrType = \v -> ; -- str not used but subject instead ---- VPAgrSubj + vpAgrClits : Verb -> AAgr -> VPAgrType = \v,a -> ; -- str used from clitic ---- vpAgrClit + verbDefaultPart : Verb -> Str = \v -> v.s ! (VPart Masc Sg) ; + + VP : Type = { s : Verb ; - agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic + agr : VPAgrType ; -- dit/dite dep. on verb, subj, and clitic neg : RPolarity => (Str * Str) ; -- ne-pas clit1 : Str ; -- le/se clit2 : Str ; -- lui diff --git a/lib/src/romance/ResRomance.gf b/lib/src/romance/ResRomance.gf index 021fe0e94..214765475 100644 --- a/lib/src/romance/ResRomance.gf +++ b/lib/src/romance/ResRomance.gf @@ -82,7 +82,7 @@ oper typ = verb.vtyp ; in { s = verb ; - agr = partAgr typ ; + agr = getVPAgr verb ; neg = negation ; clit1 = [] ; clit2 = [] ; @@ -98,7 +98,7 @@ oper in { s = vp.s ; agr = case of { - => vpAgrClit np.a ; + => vpAgrClits vp.s np.a ; _ => vp.agr -- must be dat } ; clit1 = vp.clit1 ++ obj.c1 ; @@ -126,40 +126,18 @@ oper -- Agreement with preceding relative or interrogative: -- "les femmes que j'ai aimées" - insertAgr : AAgr -> VP -> VP = \ag,vp -> { - s = vp.s ; - agr = vpAgrClit (agrP3 ag.g ag.n) ; - clit1 = vp.clit1 ; - clit2 = vp.clit2 ; - clit3 = vp.clit3 ; - isNeg = vp.isNeg ; - neg = vp.neg ; - comp = vp.comp ; - ext = vp.ext ; + insertAgr : AAgr -> VP -> VP = \ag,vp -> vp ** { + agr = vpAgrClits vp.s ag ; } ; - insertRefl : VP -> VP = \vp -> { + insertRefl : VP -> VP = \vp -> vp ** { s = vp.s ** {vtyp = vRefl vp.s.vtyp} ; - agr = VPAgrSubj ; - clit1 = vp.clit1 ; - clit2 = vp.clit2 ; - clit3 = vp.clit3 ; - isNeg = vp.isNeg ; - neg = vp.neg ; - comp = vp.comp ; - ext = vp.ext ; + agr = vpAgrSubj vp.s ; } ; - insertAdv : Str -> VP -> VP = \co,vp -> { - s = vp.s ; - agr = vp.agr ; - clit1 = vp.clit1 ; - clit2 = vp.clit2 ; - clit3 = vp.clit3 ; + insertAdv : Str -> VP -> VP = \co,vp -> vp ** { isNeg = vp.isNeg ; --- adv could be neg - neg = vp.neg ; comp = \\a => vp.comp ! a ++ co ; - ext = vp.ext ; } ; insertAdV : Str -> VP -> VP = \co,vp -> { @@ -242,10 +220,16 @@ oper verb = vp.s.s ; vaux = auxVerb vp.s.vtyp ; - part = case vp.agr of { - VPAgrSubj => verb ! VPart agr.g agr.n ; - VPAgrClit g n => verb ! VPart g n +---- VPAgr : this is where it really matters + part = case vp.agr.p2 of { + False => vp.agr.p1 ; + True => verb ! VPart agr.g agr.n } ; +---- part = case vp.agr of { +---- VPAgrSubj => verb ! VPart agr.g agr.n ; +---- VPAgrClit g n => verb ! VPart g n +---- } ; + vps : Str * Str = case of { => ; --# notpresent diff --git a/lib/src/romance/SentenceRomance.gf b/lib/src/romance/SentenceRomance.gf index 12d33429f..8ade9cc91 100644 --- a/lib/src/romance/SentenceRomance.gf +++ b/lib/src/romance/SentenceRomance.gf @@ -103,10 +103,15 @@ incomplete concrete SentenceRomance of Sentence = ext = vp.ext ! b ; - part = case vp.agr of { - VPAgrSubj => verb ! VPart agr.g agr.n ; - VPAgrClit g n => verb ! VPart g n +---- VPAgr : this is where it really matters + part = case vp.agr.p2 of { + False => vp.agr.p1 ; + True => verb ! VPart agr.g agr.n } ; +---- part = case vp.agr of { +---- VPAgrSubj => verb ! VPart agr.g agr.n ; +---- VPAgrClit g n => verb ! VPart g n +---- } ; vpss : Str * Str = case of { diff --git a/lib/src/romance/VerbRomance.gf b/lib/src/romance/VerbRomance.gf index 9de658fa5..5784ed4ae 100644 --- a/lib/src/romance/VerbRomance.gf +++ b/lib/src/romance/VerbRomance.gf @@ -67,7 +67,7 @@ incomplete concrete VerbRomance of Verb = SlashV2VNP v np vps = let obj = np.s ! v.c2.c in { s = v ; - agr = partAgr v.vtyp ; + agr = getVPAgr v ; clit1 = obj.c1 ; clit2 = obj.c2 ; clit3 = {s,imp = [] ; hasClit = False} ; ---- shortcut from insertObject, to check AR 20/11/2013 diff --git a/lib/src/romance/exper/ResRomance.gf b/lib/src/romance/exper/ResRomance.gf index 48204d590..7eca9c02b 100644 --- a/lib/src/romance/exper/ResRomance.gf +++ b/lib/src/romance/exper/ResRomance.gf @@ -432,6 +432,17 @@ v0.2 876660 french/RelativeFre.gfo 8114329 total +v03 195227 msec (old with VPAgr changed to Str; not yet correct) + 5084845 french/SentenceFre.gfo + 131929 french/QuestionFre.gfo + 333884 french/RelativeFre.gfo + 5550658 total +v04 242696 msec (this correct, Str * Bool) + 6091544 french/SentenceFre.gfo + 156000 french/QuestionFre.gfo + 511900 french/RelativeFre.gfo + 6759444 total + v2 23476139 french/SentenceFre.gfo 1150969 french/QuestionFre.gfo @@ -455,6 +466,13 @@ Ita 606895 italian/RelativeIta.gfo 3408954 total +Ita v03: +253879 msec + 2169173 italian/SentenceIta.gfo + 95021 italian/QuestionIta.gfo + 347063 italian/RelativeIta.gfo + 2611257 total + Spa 112362 msec 1541743 spanish/SentenceSpa.gfo @@ -462,6 +480,21 @@ Spa 430675 spanish/RelativeSpa.gfo 2061979 total +Spa v03: +91598 msec + 1086758 spanish/SentenceSpa.gfo + 66345 spanish/QuestionSpa.gfo + 250267 spanish/RelativeSpa.gfo + 1403370 total + +Cat v03 +83132 msec + 1078970 catalan/SentenceCat.gfo + 66225 catalan/QuestionCat.gfo + 249211 catalan/RelativeCat.gfo + 1394406 total + + VType = VTyp VAux Bool diff --git a/lib/src/spanish/DiffSpa.gf b/lib/src/spanish/DiffSpa.gf index 709550988..e4a7954ab 100644 --- a/lib/src/spanish/DiffSpa.gf +++ b/lib/src/spanish/DiffSpa.gf @@ -1,10 +1,18 @@ --# -path=.:../romance:../abstract:../common:prelude -instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelude in { +instance DiffSpa of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRomance, PhonoSpa, BeschSpa, Prelude in { flags optimize=noexpand ; coding=utf8 ; +---- exceptions ---------------- + oper + partAgr : VType -> Bool = \vtyp -> False ; + vpAgrSubj : Verb -> VPAgrType = \v -> ; + vpAgrClits : Verb -> AAgr -> VPAgrType = \v,a -> ; + +-------------------------------- + param Prepos = P_de | P_a ; VType = VHabere | VRefl ; @@ -72,8 +80,6 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud auxVerb : VType -> (VF => Str) = \_ -> haber_V.s ; - partAgr : VType -> VPAgr = \vtyp -> vpAgrNone ; - vpAgrClit : Agr -> VPAgr = \a -> vpAgrNone ;