summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Command/Commands.hs
diff options
context:
space:
mode:
authorramona.enache <ramona.enache@chalmers.se>2010-10-31 13:39:01 +0000
committerramona.enache <ramona.enache@chalmers.se>2010-10-31 13:39:01 +0000
commit1f8a0f0876cb4bb8f5d43fda5cb445bcaa602f3a (patch)
tree2f822fbea01dadc6bb4f7661c5c813128ef3aa8b /src/compiler/GF/Command/Commands.hs
parent524fb1a6bca49b280ccebe4092e9b39a10cf98fe (diff)
added giza Alignments with command ga and merged the rendering algorithm for graphviz and giza alignments
Diffstat (limited to 'src/compiler/GF/Command/Commands.hs')
-rw-r--r--src/compiler/GF/Command/Commands.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index b10d35ec7..7989078c2 100644
--- a/src/compiler/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
@@ -172,6 +172,28 @@ allCommands env@(pgf, mos) = Map.fromList [
("view","program to open the resulting file (default \"open\")")
]
}),
+ ("ga", emptyCommandInfo {
+ longname = "giza_alignment",
+ synopsis = "show the giza alignment between 2 languages",
+ explanation = unlines [
+ "Prints a set of alignments in the .txt format.",
+ "The graph can be saved in a file by the wf command as usual."
+ ],
+ exec = \opts es -> do
+ let giz = map (gizaAlignment pgf (head $ languages pgf, head $ tail $ languages pgf)) es
+ let lsrc = unlines $ map (\(x,_,_) -> x) giz
+ let ltrg = unlines $ map (\(_,x,_) -> x) giz
+ let align = unlines $ map (\(_,_,x) -> x) giz
+ let grph = if null es then [] else lsrc ++ "\n--end_source--\n\n"++ltrg++"\n-end_target--\n\n"++align
+ return $ fromString grph,
+ examples = [
+ "gr | ga -- generate a tree and show giza alignments"
+ ],
+ options = [
+ ],
+ flags = [
+ ]
+ }),
("cc", emptyCommandInfo {
longname = "compute_concrete",