Skip to content

Conversation

@inariksit
Copy link
Member

As requested by Michal:

Define in CommonCommands

default_depth :: Int
default_depth = 5

and use that value in documentation + giving default values to GF shell commands. Typing help gr in the GF shell gives the following output:

Lang> help gr
gr, generate_random
generate random trees in the current abstract syntax

syntax:
  gr [-cat=CAT] [-number=INT]

Generates a list of random trees, by default one tree up to depth 5.
If a tree argument is given, the command completes the Tree with values to
all metavariables in the tree. The generation can be biased by probabilities,
given in a file in the -probs flag.


flags:
 -cat   generation category
 -lang  uses only functions that have linearizations in all these languages
 -number        number of trees generated
 -depth the maximum generation depth (default: 5)
 -probs file with biased probabilities (format 'f 0.4' one by line)

examples:
  gr    --one tree in the startcat of the current grammar, up to depth 5
  gr -cat=NP -number=16 --16 trees in the category NP
  gr -cat=NP -depth=2   --one tree in the category NP, up to depth 2
  gr -lang=LangHin,LangTha -cat=Cl      --Cl, both in LangHin and LangTha
  gr -probs=FILE        --generate with bias
  gr (AdjCN ? (UseN ?)) --generate trees of form (AdjCN ? (UseN ?))

I did not change the default depth for server from 4, but I put it in a variable.

@inariksit inariksit force-pushed the update-depth-documentation branch from e6fe227 to 183e421 Compare August 2, 2025 20:04
@inariksit inariksit merged commit c23a03a into GrammaticalFramework:master Aug 2, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant