mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
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.ShellState
|
||||||
import GF.Compile.NoParse
|
import GF.Compile.NoParse
|
||||||
import GF.Probabilistic.Probabilistic
|
import GF.Probabilistic.Probabilistic
|
||||||
|
import GF.UseGrammar.Treebank
|
||||||
|
|
||||||
import GF.Infra.Modules
|
import GF.Infra.Modules
|
||||||
import GF.Infra.ReadFiles (isOldFile)
|
import GF.Infra.ReadFiles (isOldFile)
|
||||||
@@ -68,6 +69,9 @@ shellStateFromFiles opts st file = do
|
|||||||
let osb = addOptions (options []) opts
|
let osb = addOptions (options []) opts
|
||||||
grts <- compileModule osb st file
|
grts <- compileModule osb st file
|
||||||
ioeErr $ updateShellState opts ign Nothing st grts
|
ioeErr $ updateShellState opts ign Nothing st grts
|
||||||
|
s | oElem (iOpt "treebank") opts -> do
|
||||||
|
tbs <- ioeIO $ readUniTreebanks file
|
||||||
|
return $ addTreebanks tbs st
|
||||||
_ -> do
|
_ -> do
|
||||||
b <- ioeIO $ isOldFile file
|
b <- ioeIO $ isOldFile file
|
||||||
let opts' = if b then (addOption showOld opts) else opts
|
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 :: CommandOpt -> ShellIO
|
||||||
execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case comm of
|
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
|
CImport file | oElem fromExamples opts -> do
|
||||||
es <- liftM nub $ getGFEFiles opts file
|
es <- liftM nub $ getGFEFiles opts file
|
||||||
system $ "gf -examples" +++ unlines es
|
system $ "gf -examples" +++ unlines es
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ optionsOfCommand co = case co of
|
|||||||
CGenerateTrees -> both "metas" "atoms depth alts cat lang number"
|
CGenerateTrees -> both "metas" "atoms depth alts cat lang number"
|
||||||
CPutTerm -> flags "transform number"
|
CPutTerm -> flags "transform number"
|
||||||
CTreeBank -> opts "c xml trees"
|
CTreeBank -> opts "c xml trees"
|
||||||
|
CLookupTreebank -> both "assocs raw strings" "treebank"
|
||||||
CWrapTerm _ -> opts "c"
|
CWrapTerm _ -> opts "c"
|
||||||
CApplyTransfer _ -> flags "lang transfer"
|
CApplyTransfer _ -> flags "lang transfer"
|
||||||
CMorphoAnalyse -> both "short" "lang"
|
CMorphoAnalyse -> both "short" "lang"
|
||||||
|
|||||||
Reference in New Issue
Block a user