one missing case in dep trees

This commit is contained in:
aarne
2009-10-19 12:47:31 +00:00
parent 4cacaf6097
commit dd57104d1c

View File

@@ -90,6 +90,7 @@ dependencyTree ms pgf lang exp = prGraph True lin2dep where
hx = headArg (init x) tr x
headArg x0 tr x = case (tr,x) of
(Fun f [],[_]) -> x0 ---- ??
(Fun f ts,[_]) -> x0 ++ [length ts - 1] ---- TODO: head as other than last arg
(Fun f ts,i:y) -> headArg x0 (ts !! i) y
@@ -98,10 +99,6 @@ dependencyTree ms pgf lang exp = prGraph True lin2dep where
(Fun f ts,[_]) -> showCId f ++ "#" ++ show (last (0:x)) ----
(Fun f ts,i:y) -> label (ts !! i) y x
word x = if elem x sortedNodes then x else
let x' = headArg x tr (x ++[0]) in
if x' == x then [] else word x'