summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GF/Compile/MkConcrete.hs5
-rw-r--r--src/GF/Shell.hs4
-rw-r--r--src/GF/Shell/HelpFile.hs3
-rw-r--r--src/GF/Shell/ShellCommands.hs2
-rw-r--r--src/HelpFile3
5 files changed, 13 insertions, 4 deletions
diff --git a/src/GF/Compile/MkConcrete.hs b/src/GF/Compile/MkConcrete.hs
index 0355cdaf0..da9fada00 100644
--- a/src/GF/Compile/MkConcrete.hs
+++ b/src/GF/Compile/MkConcrete.hs
@@ -65,7 +65,10 @@ mkCncGroups opts0 ((res,path),files) = do
putStrLn $ "Compiling resource " ++ res
let opts = addOptions (options [beSilent,pathList path]) opts0
let treebank = oElem (iOpt "treebank") opts
- egr <- appIOE $ shellStateFromFiles opts emptyShellState res
+ resf <- useIOE res $ do
+ (fp,_) <- readFileLibraryIOE gfLibraryPath res
+ return fp
+ egr <- appIOE $ shellStateFromFiles opts emptyShellState resf
(parser,morpho) <- if treebank then do
tb <- err (\_ -> error $ "no treebank of name" +++ path)
return
diff --git a/src/GF/Shell.hs b/src/GF/Shell.hs
index d713bcc42..062946649 100644
--- a/src/GF/Shell.hs
+++ b/src/GF/Shell.hs
@@ -319,6 +319,8 @@ execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case com
returnArg (AString $ unlines $ lookupTreebank tb s) sa
_ | oElem (iOpt "assocs") opts -> do
returnArg (AString $ unlines $ map printAssoc $ assocsTreebank tb) sa
+ _ | oElem (iOpt "trees") opts -> do
+ returnArg (ATrms $ str2trees $ concatMap snd $ assocsTreebank tb) sa
_ -> do
let tes = map (string2treeErr gro) $ lookupTreebank tb s
terms = [t | Ok t <- tes]
@@ -442,6 +444,8 @@ execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case com
AString s -> err AError (ATrms . return) $ string2treeErr gro s
_ -> a
+ str2trees ts = [t | Ok t <- map (string2treeErr gro) ts]
+
strees a = case a of
ATrms ts -> ts
_ -> []
diff --git a/src/GF/Shell/HelpFile.hs b/src/GF/Shell/HelpFile.hs
index ca795d01c..7c9133417 100644
--- a/src/GF/Shell/HelpFile.hs
+++ b/src/GF/Shell/HelpFile.hs
@@ -252,7 +252,8 @@ txtHelpFile =
"\n options:" ++
"\n -assocs show all string-trees associations in the treebank" ++
"\n -strings show all strings in the treebank" ++
- "\n -raw return result as string, without typechecking it" ++
+ "\n -trees show all trees in the treebank" ++
+ "\n -raw return the lookup result as string, without typechecking it" ++
"\n flags:" ++
"\n -treebank use this treebank (instead of the latest introduced one)" ++
"\n examples:" ++
diff --git a/src/GF/Shell/ShellCommands.hs b/src/GF/Shell/ShellCommands.hs
index 160f7bc22..b62f2119d 100644
--- a/src/GF/Shell/ShellCommands.hs
+++ b/src/GF/Shell/ShellCommands.hs
@@ -187,7 +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"
+ CLookupTreebank -> both "assocs raw strings trees" "treebank"
CWrapTerm _ -> opts "c"
CApplyTransfer _ -> flags "lang transfer"
CMorphoAnalyse -> both "short" "lang"
diff --git a/src/HelpFile b/src/HelpFile
index bea9a7b9a..58c4c1262 100644
--- a/src/HelpFile
+++ b/src/HelpFile
@@ -223,7 +223,8 @@ ut, use_treebank: ut String
options:
-assocs show all string-trees associations in the treebank
-strings show all strings in the treebank
- -raw return result as string, without typechecking it
+ -trees show all trees in the treebank
+ -raw return the lookup result as string, without typechecking it
flags:
-treebank use this treebank (instead of the latest introduced one)
examples: