From 1f8a0f0876cb4bb8f5d43fda5cb445bcaa602f3a Mon Sep 17 00:00:00 2001 From: "ramona.enache" Date: Sun, 31 Oct 2010 13:39:01 +0000 Subject: added giza Alignments with command ga and merged the rendering algorithm for graphviz and giza alignments --- src/compiler/GF/Command/Commands.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/compiler/GF/Command') 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", -- cgit v1.2.3