summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Command/Commands.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-01-17 17:05:21 +0000
committerkrasimir <krasimir@chalmers.se>2010-01-17 17:05:21 +0000
commitaf13bae2dfb9adaa7c4aa273961fc09cc7ba1b7a (patch)
tree74ba570e4d202dff02f330b50e11a0fa09b068a6 /src/compiler/GF/Command/Commands.hs
parent9e3d4c74dc807cb26bb36303d2157c70c0668a8e (diff)
now the linearization is completely based on PMCFG
Diffstat (limited to 'src/compiler/GF/Command/Commands.hs')
-rw-r--r--src/compiler/GF/Command/Commands.hs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index 3647d2e14..addf9b94a 100644
--- a/src/compiler/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
@@ -14,7 +14,7 @@ module GF.Command.Commands (
import PGF
import PGF.CId
-import PGF.ShowLinearize
+import PGF.Linearize
import PGF.VisualizeTree
import PGF.Macros
import PGF.Data ----
@@ -344,9 +344,7 @@ allCommands cod env@(pgf, mos) = Map.fromList [
("all","show all forms and variants"),
("bracket","show tree structure with brackets and paths to nodes"),
("multi","linearize to all languages (default)"),
- ("record","show source-code-like record"),
("table","show all forms labelled by parameters"),
- ("term", "show PGF term"),
("treebank","show the tree and tag linearizations with language names")
] ++ stringOpOptions,
flags = [
@@ -797,11 +795,9 @@ 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 -> allLinearize unl pgf lang
- _ | isOpt "table" opts -> tableLinearize unl pgf lang
- _ | isOpt "term" opts -> termLinearize pgf lang
- _ | isOpt "record" opts -> recordLinearize pgf lang
- _ | isOpt "bracket" opts -> markLinearize pgf lang
+ _ | 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 "bracket" opts -> unlines . markLinearizes pgf lang
_ -> unl . linearize pgf lang
unlex opts lang = stringOps Nothing (getUnlex opts lang ++ map prOpt opts) ----
@@ -957,4 +953,3 @@ prMorphoAnalysis (w,lps) =
morphoMissing :: Morpho -> [String] -> [String]
morphoMissing mo ws = [w | w <- ws, null (lookupMorpho mo w)]
-