Hey folks:
I was just wondering if anyone else was having any luck with the
tree() method in AnnotationIndexImpl. I've been walking through it with
the debugger and believe that the child subiterator in addChildren()
never gets pushed to the next annotation, so we get stuck in the while
loop. I changed the while loop to the code below and it gets through fine:
while (it.hasNext()) {
annot = (AnnotationFS) it.next();
dtr = new AnnotationTreeNodeImpl();
dtr.set(annot);
node.addChild(dtr);
addChildren(dtr, subiterator(annot));
}
On a somewhat unrelated note, I'm basically trying to make a tree of
all the annotations in the document, so I'm passing in the
DocumentAnnotation into the tree function. Is there a reason the
DocumentAnnotation only has one child via a subiterator (which is a
SourceDocumentInformation annotation)? I assumed that since it's range
covers the entire document's length and is the first annotation in the
index, a subiterator on this annotation would iterate over all of the
strict unambiguous annotations in the document. Thanks in advance for
the help - I've only been working with UIMA for a few weeks now so I'm
still getting my head around everything, but it's a great tool.
-Matt
|