Annotation A has 3 features namely, name, date & index. Annotation B has 3 features namely, name, date & index. Values are assigned to all the features except B.index. Matching name & date of A & B, I want to assign A.index to B.index
Sample output:
A annotaion:
Wardlaw
name:Wardlaw
date:2003
index:3
Rahul
name:Rahul
date:1993
index:4
B annotaion:
Rahul
name:Rahul
date:1993
index:0
Wardlaw
name:Wardlaw
date:2003
index:0
Expected Output:
B annotaion:
Rahul
name:Rahul
date:1993
index:4
Wardlaw
name:Wardlaw
date:2003
index:3
You can try something like:
a:A{a.name == b.name, a.date == b.date} # b:@B{ -> b.index = a.index};
I put the anchor on B
so that no B is missed. The condition need to be placed at A
so that the wildcard stops at the correct annotation.
If the A
s and the B
s share the same offset, you need another, simpler rule with only one rule element and no wildcard..
DISCLAIMER: I am a developer of UIMA Ruta