On#

The on statement is used for different purposes, like triggering functions, setting then lifecycle of the annotation or adding attributes.

The general syntax is:

on Annotation1 , Annotation2 : {
    ...
};
  • To set attributes: You can set attributes in general for an annotation. For instance, the following example would set the given attributes on the CityBE annotations.

on CityBE : {
    attributes = @( country="Belgium" , capital="Brussel" , languages="NL,FR,DE" )
};

lexicon:
{
    Brussels,
    Antwerp,
} = CityBE;
  • To set the lifecycle of an annotation: You can limit the existence of an annotation to a certain namespace. This is useful if you are using intermediate annotations that you do not wish to see in the final results. For instance, in the following example the annotation CityBE will be no longer available after the namespace “entity”

on CityBE : {
    scope = "entities"
};

You can use your custom namespaces , but also use the system namespaces.

  • conjecture

  • grammar

  • entities

  • anaphora

  • instances

  • user defines

  1. last is a virtual namespace that can be used for the scope attribute.

  • To call certain functions once a certain annotation has matched

on CityBE : {
    triggers = [ ::python::module_name::function_name@( att="value" ) ]
};
  • To map a certain annotation to another.

on CityBE {
    map = [ City_Belgium@( att="value" ) ]
};