mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-20 10:19:32 -06:00
Add 1-tree treebank for Phrasebook in a few languages
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user