PGF web API: add 'to' parameter to the 'alignment' command

Word alignment diagrams can now be restricted to a subset of the languages
supported by the grammar.
This commit is contained in:
hallgren
2013-03-13 15:56:03 +00:00
parent e2bb437943
commit 6045ddae19

View File

@@ -69,7 +69,7 @@ pgfMain command pgf =
"translategroup" -> out =<< doTranslateGroup pgf # text % cat % from % to % limit
"grammar" -> out =<< doGrammar pgf # requestAcceptLanguage
"abstrtree" -> outputGraphviz . abstrTree pgf =<< tree
"alignment" -> outputGraphviz . alignment pgf =<< tree
"alignment" -> outputGraphviz =<< alignment pgf # tree % to
"parsetree" -> do t <- tree
Just l <- from
outputGraphviz (parseTree pgf l t)
@@ -344,7 +344,8 @@ outputGraphviz code =
abstrTree pgf tree = PGF.graphvizAbstractTree pgf (True,True) tree
parseTree pgf lang tree = PGF.graphvizParseTree pgf lang PGF.graphvizDefaults tree
alignment pgf tree = PGF.graphvizAlignment pgf (PGF.languages pgf) tree
alignment pgf tree tos = PGF.graphvizAlignment pgf tos' tree
where tos' = if null tos then PGF.languages pgf else tos
pipeIt2graphviz :: String -> String -> IO BS.ByteString
pipeIt2graphviz fmt code = do