summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-08-15 20:28:37 +0000
committeraarne <aarne@cs.chalmers.se>2006-08-15 20:28:37 +0000
commit6bf419c50c719ac1b2d2808c84760eb0d1258d1d (patch)
treea92b346d15ccf5d7d6faf63bf0cb5a9a37c9ebea /src/GF
parent28245481a73246ff9fa4e1bcf719019c2a00b6d3 (diff)
help for gt
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Shell/HelpFile.hs5
-rw-r--r--src/GF/UseGrammar/Generate.hs3
2 files changed, 6 insertions, 2 deletions
diff --git a/src/GF/Shell/HelpFile.hs b/src/GF/Shell/HelpFile.hs
index 9a4daa282..e989d5104 100644
--- a/src/GF/Shell/HelpFile.hs
+++ b/src/GF/Shell/HelpFile.hs
@@ -349,13 +349,16 @@ txtHelpFile =
"\n the tree." ++
"\n options:" ++
"\n -metas also return trees that include metavariables" ++
+ "\n -all generate all (lazily)" ++
+ "\n -lin linearize result of -all (otherwise, use pipe to linearize)" ++
"\n flags:" ++
"\n -depth generate to this depth (default 3)" ++
"\n -atoms take this number of atomic rules of each category (default unlimited)" ++
"\n -alts take this number of alternatives at each branch (default unlimited)" ++
"\n -cat generate in this category" ++
+ "\n -old use an older algorithm (usually more memory-consuming)" ++
"\n -lang use the abstract syntax of this grammar" ++
- "\n -number generate (at most) this number of trees" ++
+ "\n -number generate (at most) this number of trees (also works with -all)" ++
"\n -noexpand don't expand these categories (comma-separated, e.g. -noexpand=V,CN)" ++
"\n -doexpand only expand these categories (comma-separated, e.g. -doexpand=V,CN)" ++
"\n examples:" ++
diff --git a/src/GF/UseGrammar/Generate.hs b/src/GF/UseGrammar/Generate.hs
index d0697b8dd..25e27df1c 100644
--- a/src/GF/UseGrammar/Generate.hs
+++ b/src/GF/UseGrammar/Generate.hs
@@ -50,8 +50,9 @@ generateTrees opts gr cat n mn mt = map str2tr $ generate gr' ifm cat' n mn mt'
ifm = oElem showOld opts
generateAll :: Options -> (Exp -> IO ()) -> GFCGrammar -> Cat -> IO ()
-generateAll opts io gr cat = mapM_ (io . str2tr) $ gen cat'
+generateAll opts io gr cat = mapM_ (io . str2tr) $ num $ gen cat'
where
+ num = optIntOrAll opts flagNumber
gr' = gr2sgr opts emptyProbs gr
cat' = prt $ snd cat
gen c = generate gr' False c 10 Nothing Nothing