summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-03-04 15:24:03 +0000
committeraarne <aarne@cs.chalmers.se>2006-03-04 15:24:03 +0000
commit84e01c303dc161c3a811a045cc0c45f3f13e33d6 (patch)
treebe720bec157ded463f5984c510f0d08cf8e80cda
parent3589e352cc49c99e9335a97a476fd827b382db2f (diff)
proper place of -treebank option
-rw-r--r--src/GF/API/IOGrammar.hs4
-rw-r--r--src/GF/Shell.hs3
-rw-r--r--src/GF/Shell/ShellCommands.hs1
3 files changed, 5 insertions, 3 deletions
diff --git a/src/GF/API/IOGrammar.hs b/src/GF/API/IOGrammar.hs
index cb84d9bf7..335757cf4 100644
--- a/src/GF/API/IOGrammar.hs
+++ b/src/GF/API/IOGrammar.hs
@@ -23,6 +23,7 @@ import GF.Compile.Compile
import GF.Compile.ShellState
import GF.Compile.NoParse
import GF.Probabilistic.Probabilistic
+import GF.UseGrammar.Treebank
import GF.Infra.Modules
import GF.Infra.ReadFiles (isOldFile)
@@ -68,6 +69,9 @@ shellStateFromFiles opts st file = do
let osb = addOptions (options []) opts
grts <- compileModule osb st file
ioeErr $ updateShellState opts ign Nothing st grts
+ s | oElem (iOpt "treebank") opts -> do
+ tbs <- ioeIO $ readUniTreebanks file
+ return $ addTreebanks tbs st
_ -> do
b <- ioeIO $ isOldFile file
let opts' = if b then (addOption showOld opts) else opts
diff --git a/src/GF/Shell.hs b/src/GF/Shell.hs
index cde5ff743..d713bcc42 100644
--- a/src/GF/Shell.hs
+++ b/src/GF/Shell.hs
@@ -181,9 +181,6 @@ execLine put (c@(co, os), arg, cs) (outps,st) = do
execC :: CommandOpt -> ShellIO
execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case comm of
- CImport file | oElem (iOpt "treebank") opts -> do
- tbs <- readUniTreebanks file
- changeState (addTreebanks tbs) sa
CImport file | oElem fromExamples opts -> do
es <- liftM nub $ getGFEFiles opts file
system $ "gf -examples" +++ unlines es
diff --git a/src/GF/Shell/ShellCommands.hs b/src/GF/Shell/ShellCommands.hs
index bf27016a5..0b08f3f9d 100644
--- a/src/GF/Shell/ShellCommands.hs
+++ b/src/GF/Shell/ShellCommands.hs
@@ -187,6 +187,7 @@ optionsOfCommand co = case co of
CGenerateTrees -> both "metas" "atoms depth alts cat lang number"
CPutTerm -> flags "transform number"
CTreeBank -> opts "c xml trees"
+ CLookupTreebank -> both "assocs raw strings" "treebank"
CWrapTerm _ -> opts "c"
CApplyTransfer _ -> flags "lang transfer"
CMorphoAnalyse -> both "short" "lang"