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"