Search code examples
ruta

RUTA: Multiline Annotation


Full disclosure: New to RUTA.

I have a multi line using regex to find the entity. But I need it now to have the break removed in the annotation.

My RUTA looks like "(?i)\\b[A-Z]{2}[[0-9]{1,}[\n]{0,}[0-9]{1,}]{1,}" -> EntitType;

My results end up like

S01234
25475

How can I get it be S0123425475?


Solution

  • Here is an example for storing a modified string in a feature:

    DECLARE EntitType (String normalized);
    e:EntitType{-> e.normalized = replaceAll(e.ct, "\n", "")};
    

    DISCLAIMER: I am a developer of UIMA Ruta