summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-03-13 15:56:03 +0000
committerhallgren <hallgren@chalmers.se>2013-03-13 15:56:03 +0000
commit07f958a9b707b9a667634a34b2f999377770fc08 (patch)
treec6a11cf8dfd05a358ff0e2804681b6bd08a16ad0 /src/server
parentd4fc60f26057a73e84d44311948f34411ed0c9d8 (diff)
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.
Diffstat (limited to 'src/server')
-rw-r--r--src/server/PGFService.hs5
1 files 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