diff --git a/src/compiler/GF/Compile/GrammarToLPGF.hs b/src/compiler/GF/Compile/GrammarToLPGF.hs index d22fbb21e..21c160943 100644 --- a/src/compiler/GF/Compile/GrammarToLPGF.hs +++ b/src/compiler/GF/Compile/GrammarToLPGF.hs @@ -239,13 +239,13 @@ mkParamTuples defs = map (addIndexes . mk') pdefs let Just def = L.find (\(C.ParamDef p _) -> pid == p) pdefs in mk' def - mk'' x@(C.Param p0 [pid1,pid2]) = - let - Just def1 = L.find (\(C.ParamDef p _) -> pid1 == p) pdefs - Just def2 = L.find (\(C.ParamDef p _) -> pid2 == p) pdefs - lf1 = mk' def1 - lf2 = mk' def2 - in replaceEmpty lf2 lf1 + -- mk'' x@(C.Param p0 [pid1,pid2]) = + -- let + -- Just def1 = L.find (\(C.ParamDef p _) -> pid1 == p) pdefs + -- Just def2 = L.find (\(C.ParamDef p _) -> pid2 == p) pdefs + -- lf1 = mk' def1 + -- lf2 = mk' def2 + -- in replaceEmpty lf2 lf1 mk'' x@(C.Param p0 (pid:pids)) = let diff --git a/src/runtime/haskell/LPGF.hs b/src/runtime/haskell/LPGF.hs index ea0122d2e..70f8e0c3d 100644 --- a/src/runtime/haskell/LPGF.hs +++ b/src/runtime/haskell/LPGF.hs @@ -191,6 +191,7 @@ eval cxt t = case t of LFProjection t u -> case (eval cxt t, eval cxt u) of (LFMissing f, _) -> LFMissing f + (_, LFMissing f) -> LFMissing f (LFTuple vs, LFInt i) -> vs !! (i-1) (tp@(LFTuple _), LFTuple is) | all isInt is -> foldl (\(LFTuple vs) (LFInt i) -> vs !! (i-1)) tp is (t',u') -> error $ printf "Incompatible projection:\n- %s ~> %s\n- %s ~> %s" (show t) (show t') (show u) (show u') diff --git a/testsuite/lpgf/phrasebook/Phrasebook.treebank b/testsuite/lpgf/phrasebook/Phrasebook.treebank new file mode 100644 index 000000000..ba33e93db --- /dev/null +++ b/testsuite/lpgf/phrasebook/Phrasebook.treebank @@ -0,0 +1,7 @@ +Phrasebook: PQuestion (HowFarFrom (APlace (CitRestaurant Indian)) (ThePlace Bank)) +PhrasebookDan: hvor langt er en [Indian] restaurant fra banken? +PhrasebookFin: kuinka kaukana pankki on [Indian] ravintolasta? +PhrasebookFre: quelle est la distance d'un restaurant [Indian] à la banque? +PhrasebookGer: wie weit ist die Bank von einem [Indian] Restaurant entfernt? +PhrasebookNor: hvor langt er det til banken fra en [Indian] restaurant? +PhrasebookSwe: hur långt är det till banken från en indisk restaurang? diff --git a/testsuite/lpgf/phrasebook/Phrasebook.trees b/testsuite/lpgf/phrasebook/Phrasebook.trees new file mode 100644 index 000000000..1cf6d6847 --- /dev/null +++ b/testsuite/lpgf/phrasebook/Phrasebook.trees @@ -0,0 +1 @@ +PQuestion (HowFarFrom (APlace (CitRestaurant Indian)) (ThePlace Bank))