diff options
| author | hallgren <hallgren@chalmers.se> | 2016-06-09 13:12:14 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2016-06-09 13:12:14 +0000 |
| commit | 096b4cfceea03007ae1ac7d46080c2a5f8e99688 (patch) | |
| tree | 58ce3c746cc1782d6a69022781586cf9103c647d /src/runtime/haskell/PGF/VisualizeTree.hs | |
| parent | 617624e2a81ec00dd5484a7e0ee7ca8f21a3ffff (diff) | |
PGF service & minibar: only show dependency diagrams if the labels are known
+ The PGF service now reads and caches dependency label configuration files.
+ The grammar info returned by command=grammar has a new boolean field
'hasDependencyLabels' to indicate if dependency labels were found for
the grammar. Also, command=deptree will now fail if no labels are present.
+ The minibar only shows word dependency trees if labels are present.
+ Also changed the type of getDepLabels from [String] -> Labels to
String -> Labels, since all uses were in the form "getDepLabels . lines".
Diffstat (limited to 'src/runtime/haskell/PGF/VisualizeTree.hs')
| -rw-r--r-- | src/runtime/haskell/PGF/VisualizeTree.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/haskell/PGF/VisualizeTree.hs b/src/runtime/haskell/PGF/VisualizeTree.hs index 29e8d3de2..8257230e1 100644 --- a/src/runtime/haskell/PGF/VisualizeTree.hs +++ b/src/runtime/haskell/PGF/VisualizeTree.hs @@ -16,7 +16,7 @@ module PGF.VisualizeTree , graphvizParseTree , graphvizParseTreeDep , graphvizDependencyTree - , getDepLabels + , Labels, getDepLabels , graphvizBracketedString , graphvizAlignment , gizaAlignment @@ -232,8 +232,8 @@ graphvizDependencyTree format debug mlab ms pgf lang t = -- | Prepare lines obtained from a configuration file for labels for -- use with 'graphvizDependencyTree'. Format per line /fun/ /label/@*@. -getDepLabels :: [String] -> Labels -getDepLabels ss = Map.fromList [(mkCId f,ls) | f:ls <- map words ss] +getDepLabels :: String -> Labels +getDepLabels s = Map.fromList [(mkCId f,ls) | f:ls <- map words (lines s)] -- the old function, without dependencies graphvizParseTree :: PGF -> Language -> GraphvizOptions -> Tree -> String |
