mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
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:
@@ -69,7 +69,7 @@ pgfMain command pgf =
|
|||||||
"translategroup" -> out =<< doTranslateGroup pgf # text % cat % from % to % limit
|
"translategroup" -> out =<< doTranslateGroup pgf # text % cat % from % to % limit
|
||||||
"grammar" -> out =<< doGrammar pgf # requestAcceptLanguage
|
"grammar" -> out =<< doGrammar pgf # requestAcceptLanguage
|
||||||
"abstrtree" -> outputGraphviz . abstrTree pgf =<< tree
|
"abstrtree" -> outputGraphviz . abstrTree pgf =<< tree
|
||||||
"alignment" -> outputGraphviz . alignment pgf =<< tree
|
"alignment" -> outputGraphviz =<< alignment pgf # tree % to
|
||||||
"parsetree" -> do t <- tree
|
"parsetree" -> do t <- tree
|
||||||
Just l <- from
|
Just l <- from
|
||||||
outputGraphviz (parseTree pgf l t)
|
outputGraphviz (parseTree pgf l t)
|
||||||
@@ -344,7 +344,8 @@ outputGraphviz code =
|
|||||||
|
|
||||||
abstrTree pgf tree = PGF.graphvizAbstractTree pgf (True,True) tree
|
abstrTree pgf tree = PGF.graphvizAbstractTree pgf (True,True) tree
|
||||||
parseTree pgf lang tree = PGF.graphvizParseTree pgf lang PGF.graphvizDefaults 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 :: String -> String -> IO BS.ByteString
|
||||||
pipeIt2graphviz fmt code = do
|
pipeIt2graphviz fmt code = do
|
||||||
|
|||||||
Reference in New Issue
Block a user