forked from GitHub/gf-core
proper place of -treebank option
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user