Hi UIMA Users,

I'm very new to UIMA (started exploring it last week). From following the uimaj-example tutorials, I was able to create an annotator that operates directly on a text document. Now I'm trying to create a descriptor and annotator code (i.e. a 'primitive' analysis engine) that simply looks at or accesses Sentence annotations.

In the descriptor (AnnotViewerDescr.xml), I've set the type system to use the OpenNLPExampleTypes.xml (which specifies/references the org.apache.uima.examples.opennlp.Sentence type). The capabillities are set to take the Sentence type as input. This descriptor is nearly identical to the OpenNLPTokenizer.xml file except that it points to AnnotViewer.java and does not "output" any capabilities.

In the AnnotViewer.java file, I copied and pasted (from Tokenizer.java) the AnnotationIndex declaration for the set of sentences, and then print whether or not the sentence annotations index contains anything. Here's the process method ...

<code>
public void process(JCas aJCas) throws AnalysisEngineProcessException  {

AnnotationIndex sentenceIndex = aJCas.getAnnotationIndex(Sentence.type);

// iterate over Sentences
FSIterator sentenceIterator = sentenceIndex.iterator();
System.out.println(sentenceIterator.isValid());//.hasNext();

}
</code>

The sentenceIterator.isValid() is returning "false" when asked if it has any sentence annotations. So the annotation is not happening or is not being found. Any thoughts? What am I leaving out?

Many thanks,

Sam




Reply via email to