Hm, maybe you're not invoking anything that
actually creates sentences? Simply declaring
sentences as input requirement is not enough:
you need to also invoke the annotator to create
sentences. You need to build an aggregate, see
http://incubator.apache.org/uima/downloads/releaseDocs/2.2.1-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.aae.building_aggregates
If that's not the problem, we'll need more info
(e.g., the full descriptor you created).
HTH,
Thilo
Sam Fisher wrote:
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