diff options
| author | krasimir <krasimir@chalmers.se> | 2010-10-12 13:36:37 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-10-12 13:36:37 +0000 |
| commit | 8970184578da853095be849403d41608d3149cb6 (patch) | |
| tree | 64a8349251fc49043bae86ca58a25b7ca4baf43d /src | |
| parent | de0354f991acd4cf559aa432cb60c8fcee682ef0 (diff) | |
added option -depth to command gr
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiler/GF/Command/Commands.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs index 10322715b..d27bea37e 100644 --- a/src/compiler/GF/Command/Commands.hs +++ b/src/compiler/GF/Command/Commands.hs @@ -306,14 +306,16 @@ allCommands env@(pgf, mos) = Map.fromList [ ("cat","generation category"), ("lang","uses only functions that have linearizations in all these languages"), ("number","number of trees generated"), + ("depth","the maximum generation depth"), ("probs", "file with biased probabilities (format 'f 0.4' one by line)") ], exec = \opts xs -> do pgf <- optProbs opts (optRestricted opts) gen <- newStdGen + let dp = valIntOpts "depth" 4 opts let ts = case mexp xs of - Just ex -> generateRandomFrom gen pgf ex - Nothing -> generateRandom gen pgf (optType opts) + Just ex -> generateRandomFromDepth gen pgf ex (Just dp) + Nothing -> generateRandomDepth gen pgf (optType opts) (Just dp) returnFromExprs $ take (optNum opts) ts }), ("gt", emptyCommandInfo { |
