From a57a74608c809e741e7477b0eabef527bad88cc2 Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 24 May 2008 07:18:34 +0000 Subject: [PATCH] temporary work-around of gfcc generation bug in resource-1.4 grammars --- lib/resource-1.4/hindi/ResHin.gf | 14 +++++++++++++- lib/resource/common/ParamX.gf | 9 +++++++++ src-3.0/GF/Compile/GrammarToGFCC.hs | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/resource-1.4/hindi/ResHin.gf b/lib/resource-1.4/hindi/ResHin.gf index b8ed909d4..f1d948332 100644 --- a/lib/resource-1.4/hindi/ResHin.gf +++ b/lib/resource-1.4/hindi/ResHin.gf @@ -75,7 +75,8 @@ resource ResHin = ParamX ** open Prelude in { mkVerb : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Verb = \inf,stem,ims,imp,ifs,ifp,pms,pmp,pfs,pfp,ss1,ss2,sp2,sp3,r -> { s = - let ga : Number -> Gender -> Str = \n,g -> (regAdjective "ga:").s ! g ! n ! Dir + let ga : Number -> Gender -> Str = \n,g -> + (regAdjective "ga:").s ! g ! n ! Dir in table { VInf => inf ; VStem => stem ; @@ -273,11 +274,22 @@ resource ResHin = ParamX ** open Prelude in { mkClause : NP -> VPH -> Clause = \np,vp -> { s = \\vt,b => let + subjagr : NPCase * Agr = case vt of { + VPPerf => case vp.subj of { + VTrans => ; + VTransPost => ; + _ => + } ; + _ => + } ; + +{- ----- this provokes a bug in gfcc AR 24/5/2008 subjagr : NPCase * Agr = case of { => ; => ; _ => } ; +-} subj = subjagr.p1 ; agr = subjagr.p2 ; vps = vp.s ! b ! VPTense vt agr ; diff --git a/lib/resource/common/ParamX.gf b/lib/resource/common/ParamX.gf index 5e55d4958..b08755a70 100644 --- a/lib/resource/common/ParamX.gf +++ b/lib/resource/common/ParamX.gf @@ -33,10 +33,19 @@ resource ParamX = open Prelude in { } ; conjNumber : Number -> Number -> Number = \m,n -> + case m of { + Sg => n ; + _ => Pl + } ; + +{- ----- this provokes a bug in gfcc AR 24/5/2008 + + conjjNumber : Number -> Number -> Number = \m,n -> case of { => Sg ; _ => Pl } ; +-} -- For persons, we let the latter argument win ("either you or I am absent" -- but "either I or you are absent"). This is not quite clear. diff --git a/src-3.0/GF/Compile/GrammarToGFCC.hs b/src-3.0/GF/Compile/GrammarToGFCC.hs index 541614eff..928180973 100644 --- a/src-3.0/GF/Compile/GrammarToGFCC.hs +++ b/src-3.0/GF/Compile/GrammarToGFCC.hs @@ -271,7 +271,7 @@ canon2canon abs = (c, M.ModMod $ M.replaceJudgements mo $ mapTree f2 js) _ -> (c,m) j2j cg (f,j) = case j of - CncFun x (Yes tr) z -> (f,CncFun x (Yes (trace ("\n" ++ prt f) (t2t tr))) z) + CncFun x (Yes tr) z -> (f,CncFun x (Yes (trace ("+ " ++ prt f) (t2t tr))) z) CncCat (Yes ty) (Yes x) y -> (f,CncCat (Yes (ty2ty ty)) (Yes (t2t x)) y) _ -> (f,j) where @@ -493,7 +493,7 @@ term2term cgr env@(labels,untyps,typs) tr = case tr of (FV ts,_) -> ts _ -> [tr] valNumFV ts = case ts of - [tr] -> error (prt tr) ----- prtTrace tr $ K "66667" + [tr] -> error ("valNum" +++ prt tr) ----- prtTrace tr $ K "66667" _ -> FV $ map valNum ts mkCurry trm = case trm of