diff options
| author | aarne <aarne@chalmers.se> | 2010-01-31 16:05:23 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2010-01-31 16:05:23 +0000 |
| commit | 26236652a6cf4ef9c303a57e5251cc51fba8a27b (patch) | |
| tree | c6c993fb46f44d75efbb4d3939d186667dcda14a /src/compiler/GF/Command/Commands.hs | |
| parent | be6465a2ebb1aba43433cff29bf5bad6e2065e26 (diff) | |
command l -list ; fixed mq to work with the new tabularLinearizes
Diffstat (limited to 'src/compiler/GF/Command/Commands.hs')
| -rw-r--r-- | src/compiler/GF/Command/Commands.hs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs index c282ed45f..0ca911031 100644 --- a/src/compiler/GF/Command/Commands.hs +++ b/src/compiler/GF/Command/Commands.hs @@ -392,8 +392,9 @@ allCommands cod env@(pgf, mos) = Map.fromList [ ], exec = \opts -> return . fromStrings . map (optLin opts), options = [ - ("all","show all forms and variants"), + ("all","show all forms and variants, one by line (cf. l -list)"), ("bracket","show tree structure with brackets and paths to nodes"), + ("list","show all forms and variants, comma-separated on one line (cf. l -all)"), ("multi","linearize to all languages (default)"), ("table","show all forms labelled by parameters"), ("treebank","show the tree and tag linearizations with language names") @@ -870,8 +871,12 @@ allCommands cod env@(pgf, mos) = Map.fromList [ linear :: [Option] -> CId -> Expr -> String linear opts lang = let unl = unlex opts lang in case opts of - _ | isOpt "all" opts -> unlines . concat . intersperse [[]] . map (map (unl . snd)) . tabularLinearizes pgf lang - _ | isOpt "table" opts -> unlines . concat . intersperse [[]] . map (map (\(p,v) -> p+++":"+++unl v)) . tabularLinearizes pgf lang + _ | isOpt "all" opts -> unlines . concat . intersperse [[]] . + map (map (unl . snd)) . tabularLinearizes pgf lang + _ | isOpt "list" opts -> commaList . concat . intersperse [[]] . + map (map (unl . snd)) . tabularLinearizes pgf lang + _ | isOpt "table" opts -> unlines . concat . intersperse [[]] . + map (map (\(p,v) -> p+++":"+++unl v)) . tabularLinearizes pgf lang _ | isOpt "bracket" opts -> unlines . markLinearizes pgf lang _ -> unl . linearize pgf lang @@ -883,6 +888,9 @@ allCommands cod env@(pgf, mos) = Map.fromList [ Just le -> chunks ',' le _ -> [] + commaList [] = [] + commaList ws = concat $ head ws : map (", " ++) (tail ws) + -- Proposed logic of coding in unlexing: -- - If lang has no coding flag, or -to_utf8 is not in opts, just opts are used. -- - If lang has flag coding=utf8, -to_utf8 is ignored. |
