Search code examples
apacheuimaruta

UIMA Ruta How make rule which will create new combined annotation?


I'm started learn UIMA Ruta and have some troubles in task. I need to add simple rule which will create new combined annotation called FLName which will consist of FirstName and LastName annotations which transliterates each Cyrillic-written word. Here's my code, could anybody find where I'm wrong?

Main
Document {-> CALL(TranslitCyrillic)};
Document {-> CALL(AnnotatePerson)};

Symbol {-> UNMARK(Symbol)};
Document {-> RETAINTYPE(SPACE)};
ALL {-> UNMARK(ALL)}; 

AnnotatePerson
DECLARE Annotation FirstName (STRING first_name);
DECLARE Annotation LastName (STRING last_name);
DECLARE Annotation FLName(STRING first_name, STRING last_name);

//in this rule trouble
Word {FEATURE("translit", "beishor"), FEATURE("translit", "bishop") -> CREATE(FLName), FILL(FirstName, "first_name" = Word.translit), 
FILL(LastName, "last_name" = Word.translit)};


Word {FEATURE("translit", "beishor") -> CREATE(FirstName), FILL(FirstName, "first_name" = Word.translit)}
Word {FEATURE("translit", "bishop") -> CREATE(LastName), FILL(LastName, "last_name" = Word.translit)};

I'm trying to do something like this enter image description here

But result is this enter image description here


Solution

  • Find the solution 
    (FirstName # LastName){-> CREATE(FLName, "first_name" = FirstName, "last_name" = LastName)};