From 6045ddae1935fe6f06a8b135fe75970d8bcdee45 Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 13 Mar 2013 15:56:03 +0000 Subject: [PATCH] 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. --- src/server/PGFService.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs index ca7d8d310..c537fc0f8 100644 --- a/src/server/PGFService.hs +++ b/src/server/PGFService.hs @@ -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