The template is a kind of query which simplifies repeated queries of the same type. This means that a complicated query is created only once as a template. During various executions only values for the template need to be changed.
A template consists of a name, a template text and an optional description. A name is a unique identifier of a template and is used when a query is invoked. All the three items are entered in ->Query->New query. The template text and the description can be later modified in the list of templates (->Query->List of templates).
In the template, text variables can be used. When the template is used,
variables are substituted with real parameters. These variables
consist of $
character followed by a number. The first parameter will
be then substituted for all occurrences of variable $1
, the second
parameter for all occurrences of variable $2
, etc.
For example, a template for all word forms of a regular English verb could look like this:
[word="$1" | word="$1s" | word="$1ing" | word="$1ed"]
When a template is invoked, it is written into the same row as a usual
query. It differs from a usual query in this way: the first character
from the left is an exclamation mark (!
), the template name
follows, then a colon (:
) and parameters divided by a
space. If the name of the above template was verb, the
query assignment would look like this:
!verb: help