wiki:Action

Version 2 (modified by Vojtěch Kovář, 11 years ago) (diff)

--

Action

An action (or action list) follows the template specification in the rule.
An action is basically a function taking arbitrary number of arguments named accordingly to the token indices, starting with 0.

Currently, there are following actions implemented:

  • MARK
    This action is used for marking a token segment. It is used in two cases:
    • Adding a phrasal element: in this case, the last argument must be the name of the new phrase.
      Example: MARK 0 2 4 <coord> -- marks a coordination on tokens with indices 0, 2 and 4.
    • Marking a single element: in this case, this element is then assigned a dependency using the DEP action (see below).

  • AGREE
    This action is used for testing grammatical agreement. It takes 3 arguments, the first two are the token indices, the third describes the morphological tags to be tested - g for the gender, n for the number and c for the case.
    Example: AGREE 0 2 gnc -- tests a case-number-gender agreement on tokens with indices 0 and 2.
  • DEP
    This action marks a dependency on a result of the MARK action. It takes a single argument describing the token index to depend on.
  • PROB
    This action assigns a probability, or rather weight (as it does not need to meet the probability axioms), to the rule. It takes a single argument -- the weight which is any positive natural number.
  • HEAD
    This action marks the head of a phrasal element created by the MARK action. It takes a single argument -- the token index to be marked as the head.