summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorInari Listenmaa <inari.listenmaa@gmail.com>2025-08-02 22:05:29 +0200
committerGitHub <noreply@github.com>2025-08-02 22:05:29 +0200
commitc23a03a2d11a781998dc1c3de04a8abf2ff7d330 (patch)
tree348ea475860f12439d5cdb10323812fd19ba8d88 /doc
parentaf09351b66802590073773c4de1022eb8db60adf (diff)
parent183e421a0fe598d1e698015fce026fdef7f641a3 (diff)
Merge pull request #184 from inariksit/update-depth-documentation
Update default depth to 5 + less hardcoding in documentation
Diffstat (limited to 'doc')
-rw-r--r--doc/gf-help-full.txt17
-rw-r--r--doc/tutorial/gf-tutorial.t2t12
2 files changed, 15 insertions, 14 deletions
diff --git a/doc/gf-help-full.txt b/doc/gf-help-full.txt
index 1b9c31705..3444a1c1a 100644
--- a/doc/gf-help-full.txt
+++ b/doc/gf-help-full.txt
@@ -46,7 +46,7 @@
#TINY
The command has one argument which is either function, expression or
-a category defined in the abstract syntax of the current grammar.
+a category defined in the abstract syntax of the current grammar.
If the argument is a function then ?its type is printed out.
If it is a category then the category definition is printed.
If a whole expression is given it prints the expression with refined
@@ -303,7 +303,7 @@ but the resulting .gf file must be imported separately.
#TINY
-Generates a list of random trees, by default one tree.
+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.
@@ -315,13 +315,14 @@ given in a file in the -probs flag.
| ``-cat`` | generation category
| ``-lang`` | uses only functions that have linearizations in all these languages
| ``-number`` | number of trees generated
- | ``-depth`` | the maximum generation depth
+ | ``-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
| ``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 ?))
@@ -338,8 +339,8 @@ given in a file in the -probs flag.
#TINY
-Generates all trees of a given category. By default,
-the depth is limited to 4, but this can be changed by a flag.
+Generates all trees of a given category. By default,
+the depth is limited to 5, but this can be changed by a flag.
If a Tree argument is given, the command completes the Tree with values
to all metavariables in the tree.
@@ -353,7 +354,7 @@ to all metavariables in the tree.
- Examples:
- | ``gt`` | all trees in the startcat, to depth 4
+ | ``gt`` | all trees in the startcat, to depth 5
| ``gt -cat=NP -number=16`` | 16 trees in the category NP
| ``gt -cat=NP -depth=2`` | trees in the category NP to depth 2
| ``gt (AdjCN ? (UseN ?))`` | trees of form (AdjCN ? (UseN ?))
@@ -582,7 +583,7 @@ trees where a function node is a metavariable.
- Examples:
- | ``l -lang=LangSwe,LangNor -chunks ? a b (? c d)`` |
+ | ``l -lang=LangSwe,LangNor -chunks ? a b (? c d)`` |
#NORMAL
@@ -647,7 +648,7 @@ The -lang flag can be used to restrict this to fewer languages.
The default start category can be overridden by the -cat flag.
See also the ps command for lexing and character encoding.
-The -openclass flag is experimental and allows some robustness in
+The -openclass flag is experimental and allows some robustness in
the parser. For example if -openclass="A,N,V" is given, the parser
will accept unknown adjectives, nouns and verbs with the resource grammar.
diff --git a/doc/tutorial/gf-tutorial.t2t b/doc/tutorial/gf-tutorial.t2t
index c4ccb6aab..d58b93f16 100644
--- a/doc/tutorial/gf-tutorial.t2t
+++ b/doc/tutorial/gf-tutorial.t2t
@@ -1188,7 +1188,7 @@ use ``generate_trees = gt``.
this wine is fresh
this wine is warm
```
-The default **depth** is 3; the depth can be
+The default **depth** is 5; the depth can be
set by using the ``depth`` flag:
```
> generate_trees -depth=2 | l
@@ -1739,9 +1739,9 @@ A new module can **extend** an old one:
Pizza : Kind ;
}
```
-Note that the extended grammar doesn't inherit the start
-category from the grammar it extends, so if you want to
-generate sentences with this grammar, you'll have to either
+Note that the extended grammar doesn't inherit the start
+category from the grammar it extends, so if you want to
+generate sentences with this grammar, you'll have to either
add a startcat (e.g. ``flags startcat = Question ;``),
or in the GF shell, specify the category to ``generate_random`` or ``geneate_trees``
(e.g. ``gr -cat=Comment`` or ``gt -cat=Question``).
@@ -3746,7 +3746,7 @@ However, type-incorrect commands are rejected by the typecheck:
The parsing is successful but the type checking failed with error(s):
Couldn't match expected type Device light
against the interred type Device fan
- In the expression: DKindOne fan
+ In the expression: DKindOne fan
```
#NEW
@@ -4184,7 +4184,7 @@ division of integers.
```
abstract Calculator = {
flags startcat = Exp ;
-
+
cat Exp ;
fun