I have two annotations named First and Second.In this I need to compare the feature of two annotations which having same index position.
First.csv:
Position1;0
Position2;1
Script:
DECLARE Second(INT secondpass);
"Position1"->Second;
WORDTABLE FirstList = 'First.csv';
DECLARE Annotation First(INT firstpass);
Document{->MARKTABLE(First, 2, FirstList,true,0,"",0, "firstpass" = 1 )};
DECLARE Text;
p1:First ANY*? p2:Second{p1.secondpass == p2.firstpass -> MARK(Text)};
p1:First # p2:Second{p1.secondpass == p2.firstpass -> MARK(Text)}; wont work because both annotations are in same positions.
Depending on how exactly the offsets need to be checked, something like the following would probably do:
p1:First{-> MARK(Text)}<-{p2:Second{p1.begin==p2.begin,p1.end==p2.end,p1.firstpass==p2.secondpass};};
or
p1:First{p1.firstpass == Second.secondpass -> MARK(Text)};
You can specify this also with a conjunct rule element (&
), but I would recommend to avoid these if not really necessary.
DISCLAIMER: I am a developer of UIMA Ruta