pattern-name : = option1 | option2 | ... ;where where pattern-name is a sequence of letters beginning with a lower-case letter, and each optioni is a sequence of repeated-pattern-elements separated by spaces. A repeated pattern element has one of the forms
pattern-elementto indicate exactly one, zero or one, zero or more, one or more instances of pattern-element. Pattern-element in turn may be
pattern-element ?
pattern-element *
pattern-element +
a string: "quack"A string pattern element matches an annotation of type token spanning the specified string. An annotation pattern element matches an annotation which has the specified type and features (and may have additional features).
an annotation: [type feature=value feature=value ...]
the name of another pattern
an alternation: ( option1 | option2 | ... )
as assignment pattern element: variable = value
variable = valuebinds variable to value. At present, the only values allowed are integers. A parenthesized pattern may be followed by a colon (:) and variable name
(pattern ) : variableThis binds the variable to the span of the document matched by the pattern.
when pattern-name, action1, action2, ... ;At present, three actions are implemented: the add action, which adds an annotation, and print action, and the write action.
add [annotation-type feature=value feature=value ...]or
add [annotation-type feature=value feature=value ...] over variableIn the first form, the span of the new annotation is the text matched by the pattern. In the second form, the variable must have been bound to a span as part of the pattern matching; this is used as the span of the new annotation.
print stringExpressionwhere stringExpression can be a string (enclosed in double quotes), a variable, or a sequence of two or more strings and variables separated by plus signs (+). A variable in a stringExpression should have been bound to a span or an annotation as part of the pattern matching process; the print action prints the text subsumed by that span or annotation. If the stringExpression contains two or more items, they are concatenated and the result printed together on a single line. The output is sent to the Jet console.
write stringExpressionIt has the same semantics as the print action, except that the output is written to standard output.
pattern set name;indicates that all following when statements (until the next pattern set statment) belong to pattern set name. The basic 'top level' operation in Jet is the application of a pattern set to a sentence.
The process begins by matching all patterns in the pattern set (i.e., all patterns referenced by when statements in the pattern set) starting at the first token of the sentence. If several patterns match, we select the pattern which matches the longest portion of the text. If several patterns match the same (longest) portion, we select the pattern whose when statement appeared first in the pattern file. The actions associated with the selected pattern are then executed in sequence (if no pattern matches, no actions are performed).
The starting point for pattern matching is then advanced and the process
is repeated. If any of the actions created new annotations, the starting
point is set to the maximum of thes end of the annotations. If no
new annotation was created, the starting point is advanced by one token.
The matching continues until the starting point reaches the end of the
sentence.