From f7c2fb8a7d4f37e3122bc8fb8970f848b3ab3c35 Mon Sep 17 00:00:00 2001 From: odanoburu Date: Wed, 19 Dec 2018 12:13:31 -0200 Subject: [PATCH] (gf2ud) add comments to CoNLL-U output when debbuging labels, I find it useful to have comments saying what's the original sentence (lazy, I know) and the original tree (depending on the treebank, the trees can be similar). I know this is not the goal exactly, but UDv2 treebanks (http://universaldependencies.org/format.html) should always have a 'text =' comment, and a 'sent_id =' comment (which would be easy to implement too, but not that useful). --- src/runtime/haskell/PGF/VisualizeTree.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/haskell/PGF/VisualizeTree.hs b/src/runtime/haskell/PGF/VisualizeTree.hs index ee691fc7a..0d7751297 100644 --- a/src/runtime/haskell/PGF/VisualizeTree.hs +++ b/src/runtime/haskell/PGF/VisualizeTree.hs @@ -132,7 +132,7 @@ graphvizDependencyTree format debug mlab mclab pgf lang t = case format of "latex" -> render . ppLaTeX $ conll2latex' conll "svg" -> render . ppSVG . toSVG $ conll2latex' conll - "conll" -> printCoNLL conll + "conll" -> printCoNLL ([["# text = " ++ linearize pgf lang t], ["# tree = " ++ showExpr [] t]] ++ conll) "malt_tab" -> render $ vcat (map (hcat . intersperse (char '\t') . (\ws -> [ws !! 0,ws !! 1,ws !! 3,ws !! 6,ws !! 7])) wnodes) "malt_input" -> render $ vcat (map (hcat . intersperse (char '\t') . take 6) wnodes) _ -> render $ text "digraph {" $$