0

I am new to the GATE here, I am using java for the integration. Now, I have some rules on that basis I got some annotations.

I am trying to get the particular type of annotations within that range. So, I've written below code,

public AnnotationSet get(String neededType, Long startOffset, Long endOffset)

I have following annotation offset,

annotations are -- `fullName` `52 to 66`
The second annotation is `split`, `66 to 67`

In this, I am trying to use it in this way,

get("Split", 52, 66)

I was assuming that this will return me a set which will have the annotation split as it is between the 52 to 66 but it is returning the empty array.

Any help is appreciated!

Dushyant Tankariya
  • 1,432
  • 3
  • 11
  • 17
ganesh kaspate
  • 1
  • 9
  • 41
  • 88

1 Answers1

0

I assume that you wrote a creole plugin or a jape grammar that uses get method of AnnotationSet class in Gate. First you need to capture the annotations you have (i.e. split, fullName) from your document then you may apply get method in order to get the specific annotations you'd like to capture. Also, you need to care about capitalization of annotation names as well.

For example, if you have your annotations in a set called "Original markups" you need to get it as:

AnnotationSet mySet = document.getAnnotations("Original markups");
AnnotationSet mySplitSet = mySet.get("split", 52, 66);  

Hope this helps,

berkin
  • 548
  • 6
  • 18