summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorodanoburu <bcclaro@gmail.com>2018-12-19 12:13:31 -0200
committerodanoburu <bcclaro@gmail.com>2018-12-19 12:13:31 -0200
commitf7c2fb8a7d4f37e3122bc8fb8970f848b3ab3c35 (patch)
tree2678a133286f55e7f36df5dfeb38924b5530ad15
parent4bda53acb7b618687df4e9654346874ae8bdcb3d (diff)
(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).
-rw-r--r--src/runtime/haskell/PGF/VisualizeTree.hs2
1 files changed, 1 insertions, 1 deletions
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 {" $$