summaryrefslogtreecommitdiff
path: root/src/PGF/VisualizeTree.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/PGF/VisualizeTree.hs')
-rw-r--r--src/PGF/VisualizeTree.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/PGF/VisualizeTree.hs b/src/PGF/VisualizeTree.hs
index 8db2cb3e4..809472da5 100644
--- a/src/PGF/VisualizeTree.hs
+++ b/src/PGF/VisualizeTree.hs
@@ -63,12 +63,14 @@ prGraph digr ns = concat $ map (++"\n") $ [graph ++ "{\n"] ++ ns ++ ["}"] where
dependencyTree :: String -> Bool -> Maybe Labels -> Maybe String -> PGF -> CId -> Expr -> String
dependencyTree format debug mlab ms pgf lang exp = case format of
"malt" -> unlines (lin2dep format)
+ "malt_input" -> unlines (lin2dep format)
_ -> prGraph True (lin2dep format)
where
lin2dep format = trace (ifd (show sortedNodes ++ show nodeWords)) $ case format of
"malt" -> map (concat . intersperse "\t") wnodes
+ "malt_input" -> map (concat . intersperse "\t" . take 6) wnodes
_ -> prelude ++ nodes ++ links
ifd s = if debug then s else []
@@ -134,8 +136,8 @@ dependencyTree format debug mlab ms pgf lang exp = case format of
arcMap = Map.fromList [(y,(x,l)) | (x,y,l) <- thelinks]
lookDomLab p = case Map.lookup p arcMap of
- Just (q,l) -> (maybe 0 id (Map.lookup q nodeMap), if null l then "_" else l)
- _ -> (0,unspec)
+ Just (q,l) -> (maybe 0 id (Map.lookup q nodeMap), if null l then rootlabel else l)
+ _ -> (0,rootlabel)
wnodes = [[show i, unwords ws, showCId fun, pos, pos, morph, show dom, lab, unspec, unspec] |
(i, ((fun,p),ws)) <- tail nodeWords,
@@ -145,6 +147,7 @@ dependencyTree format debug mlab ms pgf lang exp = case format of
]
unspec = "_"
+ rootlabel = "ROOT"
type Labels = Map.Map CId [String]