syntaxcontainsuimaruta

uima MARK annotation in CONTAINS


The following marks Line to M_Subordinator (same as M_Line)

(Line{CONTAINS(Phrase), CONTAINS(Subordinator) -> MARK(M_Subordinator)}){-> MARK(M_Line)};

How to mark Subordinator to M_Subordinator?
Because I need to mark both Phrase and Subordinator separately, not interested in the whole match.


Solution

  • Maybe something like this:

    Line{CONTAINS(Phrase), CONTAINS(Subordinator) -> M_Line} -> {Subordinator{ -> M_Subordinator};};
    

    This rule matches on each Line annotation and, if this Line contains a Phrase and a Subordinator annotation, then this Line is annotated with the type M_Line. Additionally, an inlined rule is executed as an action: The inlined rule matches on all Subordinator annotations within the currently matched Line annotation and annotates it with the type M_Subordinator.