uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vinod <vkag...@gmail.com>
Subject annotation type
Date Wed, 11 Apr 2012 03:10:31 GMT
I have a very basic question on Annotation type and 
would appreciate any pointers.

I am using reflection to create an instance of an annotation, 
before I add it to the cas, I want to check to 
see if there is an instance of that type in the cas. However, the line 
below returns a non-zero set 
containing DocumentAnnotation!

  Class uimaTypeClass = Class.forName(objectName);
  Class[] constructorArgs = {JCas.class};
  Object[] constructorArgVals = {jcas};
  Constructor constructor = uimaTypeClass.getConstructor(constructorArgs);
  Annotation ann = (Annotation)constructor.newInstance(constructorArgVals);
  Iterator itr = jcas.getJFSIndexRepository().getAnnotationIndex(ann.type).iterator();
	ann = (Annotation)itr.next();


View raw message