Pattern Element Conditions

Forming link pattern element conditions with features
Links and nodes frequently have features which are normally single values constants attached to the graph element. When they are used in conditions they make the rule more selective. For example, to match any token where the value of its "length" feature (the number of characters in the word) is equal to 5, we would employ the pattern element:
Token<length=5>
To match a term.symbolic with a feature of "punctuation" where it is equal to "true" you would use:
Term.symbolic<=punctuation>
To match a term.symbolic with a feature missing like "comma-punct" you would use:
Term.symbolic<'comma-punct'=>
You can use any of the following constants in conditions:
- unquoted text or text in back quotes (`) is taken as a value of a feature with the key of that link. The value is null if the link doesn't match that feature.
- the words true and false are boolean constants
- a number is a numerical constant
- the word null is a special null constant
- a character in single quotes (') is a character constant
- a string in double quotes (") is a string constant
The valid operators in conditions are:
- " = " where the two values must be equal
- " != " where the two values must not be equal
If you do not need to use a condition for a feature you can omit the <>

Forming node pattern element conditions with features
Nodes carry information about the characters that appear before, after and in between links. Both nodes and links can appear in matching patterns. Nodes occur between the links. By default unconditioned nodes are assumed to appear between links, so it is only necessary to include nodes in matching patterns when a condition on the node is needed.
For example, to match a token with the feature "length" equal to "5" but only if it is at the beginning of a text block you would use:
Node<isBreak=>
Token<length=5>

Forming pattern element conditions with functions
The full list of functions available in EESs is given in Entity Extraction Script functions. They can all be used in defining Conditions.
Simple functions are used to place more complex conditions on features than are available with the conditions: "=" and "!=", for example:
Token<ge(length,10)=>
which only matches tokens longer than 9 characters.
There are a range of functions that enable pattern elements to match more than one link at the same position, such as "costarts()" and "contains()", for example:
Token<ge(length,10)=>Token<typography="upper", costarts("tag:Person")=>
which would fire for the text snippet 'The client said he should be called "JOHN Smith"'.