Add 1-tree treebank for Phrasebook in a few languages

This commit is contained in:
John J. Camilleri
2021-02-28 00:34:46 +01:00
parent 83bc3c9c6e
commit 33e0e98aec
4 changed files with 16 additions and 7 deletions

View File

@@ -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')