From 405dc75016adcd9e7af57fb75d78c90235d6be11 Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 14 Oct 2007 14:08:41 +0000 Subject: [PATCH] adjusting parameter types in Romance and fixing some compilation bugs --- lib/resource-1.0/french/DiffFre.gf | 13 +++++++------ lib/resource-1.0/italian/DiffIta.gf | 4 ++-- lib/resource-1.0/romance/CommonRomance.gf | 3 ++- lib/resource-1.0/romance/ResRomance.gf | 5 +++-- lib/resource-1.0/spanish/DiffSpa.gf | 4 ++-- src/GF/Grammar/Compute.hs | 1 + 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/resource-1.0/french/DiffFre.gf b/lib/resource-1.0/french/DiffFre.gf index 6d4853ffe..00a93935d 100644 --- a/lib/resource-1.0/french/DiffFre.gf +++ b/lib/resource-1.0/french/DiffFre.gf @@ -74,12 +74,12 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in { P3 => elision "s" ; --- use of reflPron incred. expensive _ => argPron Fem n p Acc },True> ; - CPron a => ; + CPron ag an ap => ; _ => <[],False> } ; in case dat of { - CPron a => let pdat = argPron a.g a.n a.p dative in case a.p of { + CPron ag an ap => let pdat = argPron ag an ap dative in case ap of { P3 => ; _ => } ; @@ -90,7 +90,8 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in { -- Positive polarity is used in the imperative: stressed for 1st and -- 2nd persons. - pronArgGen : Polarity -> Number -> Person -> CAgr -> CAgr -> Str * Str = \b,n,p,acc,dat -> + pronArgGen : Polarity -> Number -> Person -> CAgr -> CAgr -> Str * Str = + \b,n,p,acc,dat -> let cas : Person -> Case -> Case = \pr,c -> case of { => CPrep P_de ; --- encoding in argPron @@ -101,16 +102,16 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in { P3 => elision "s" ; --- use of reflPron incred. expensive _ => argPron Fem n p (cas p Acc) } ; - CPron a => argPron a.g a.n a.p (cas a.p Acc) ; + CPron ag an ap => argPron ag an ap (cas ap Acc) ; _ => [] } ; pdat = case dat of { - CPron a => argPron a.g a.n a.p (cas a.p dative) ; + CPron ag an ap => argPron ag an ap (cas ap dative) ; _ => [] } ; in case dat of { - CPron {p = P3} => ; + CPron _ _ P3 => ; _ => } ; diff --git a/lib/resource-1.0/italian/DiffIta.gf b/lib/resource-1.0/italian/DiffIta.gf index db06322b3..c1996398a 100644 --- a/lib/resource-1.0/italian/DiffIta.gf +++ b/lib/resource-1.0/italian/DiffIta.gf @@ -87,7 +87,7 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud P3 => "si" ; _ => argPron Fem n p Acc False --- no clitic after acc } ; - CPron a => argPron a.g a.n a.p Acc False ; + CPron ag an ap => argPron ag an ap Acc False ; _ => [] } ; hasAcc = case acc of { @@ -99,7 +99,7 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud _ => True } ; pdat = case dat of { - CPron a => argPron a.g a.n a.p dative hasAcc ; + CPron ag an ap => argPron ag an ap dative hasAcc ; _ => [] } ; in diff --git a/lib/resource-1.0/romance/CommonRomance.gf b/lib/resource-1.0/romance/CommonRomance.gf index 50574168a..9224e1204 100644 --- a/lib/resource-1.0/romance/CommonRomance.gf +++ b/lib/resource-1.0/romance/CommonRomance.gf @@ -129,7 +129,8 @@ param -- Clitic slots. - CAgr = CPron {g : Gender ; n : Number ; p : Person} | CRefl | CNone ; --- Agr + CAgr = CPron Gender Number Person | CRefl | CNone ; --- Agr +--- CAgr = CPron {g : Gender ; n : Number ; p : Person} | CRefl | CNone ; --- Agr oper aagr : Gender -> Number -> AAgr = \g,n -> diff --git a/lib/resource-1.0/romance/ResRomance.gf b/lib/resource-1.0/romance/ResRomance.gf index 1bd0c95e1..723cd4745 100644 --- a/lib/resource-1.0/romance/ResRomance.gf +++ b/lib/resource-1.0/romance/ResRomance.gf @@ -104,12 +104,13 @@ oper vpdat = vp.clDat ; vpagr = vp.agr ; npa = np.a ; + cpron = CPron npa.g npa.n npa.p ; noNewClit = ; cc : CAgr * CAgr * Str * VPAgr = case of { => case c.c of { - Acc => ; - _ => -- must be dat + Acc => ; + _ => -- must be dat } ; _ => noNewClit } ; diff --git a/lib/resource-1.0/spanish/DiffSpa.gf b/lib/resource-1.0/spanish/DiffSpa.gf index e7c09c115..603bb064c 100644 --- a/lib/resource-1.0/spanish/DiffSpa.gf +++ b/lib/resource-1.0/spanish/DiffSpa.gf @@ -63,11 +63,11 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud let paccp = case acc of { CRefl => ; - CPron a => ; + CPron ag an ap => ; _ => <[],P2,False> } ; pdatp = case dat of { - CPron a => ; + CPron ag an ap => ; _ => <[],P2,False> } in case of { diff --git a/src/GF/Grammar/Compute.hs b/src/GF/Grammar/Compute.hs index 5970d96ef..043c2bd7e 100644 --- a/src/GF/Grammar/Compute.hs +++ b/src/GF/Grammar/Compute.hs @@ -235,6 +235,7 @@ computeTermOpt rec gr = comp where ---- foldr1 C (map K (str2strings (glueStr v (str a)))) | v <- x'] ,return $ Glue x y ] + (C u v,_) -> comp g $ C u (Glue v y) _ -> do mapM_ checkNoArgVars [x,y]