mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-12 22:39:31 -06:00
(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).
This commit is contained in:
@@ -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 {" $$
|
||||
|
||||
Reference in New Issue
Block a user