mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
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".
This commit is contained in:
@@ -551,7 +551,7 @@ pgfCommands = Map.fromList [
|
||||
let outp = valStrOpts "output" "dot" opts
|
||||
mlab <- case file of
|
||||
"" -> return Nothing
|
||||
_ -> (Just . getDepLabels . lines) `fmap` restricted (readFile file)
|
||||
_ -> (Just . getDepLabels) `fmap` restricted (readFile file)
|
||||
let lang = optLang pgf opts
|
||||
let grphs = map (graphvizDependencyTree outp debug mlab Nothing pgf lang) es
|
||||
if isOpt "conll2latex" opts
|
||||
@@ -616,7 +616,7 @@ pgfCommands = Map.fromList [
|
||||
let depfile = valStrOpts "file" "" opts
|
||||
mlab <- case depfile of
|
||||
"" -> return Nothing
|
||||
_ -> (Just . getDepLabels . lines) `fmap` restricted (readFile depfile)
|
||||
_ -> (Just . getDepLabels) `fmap` restricted (readFile depfile)
|
||||
let grphs = map (graphvizParseTreeDep mlab pgf lang gvOptions) es
|
||||
if isFlag "view" opts || isFlag "format" opts
|
||||
then do
|
||||
|
||||
Reference in New Issue
Block a user