You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Matthew Campbell <mc...@syrres.com> on 2007/07/27 23:52:09 UTC

AnnotationIndex tree()

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

Re: AnnotationIndex tree()

Posted by Matthew Campbell <mc...@syrres.com>.
I put in an issue on JIRA, UIMA-519 
(https://issues.apache.org/jira/browse/UIMA-519).


-Matt

Thilo Goetz wrote:
> Hi Matt,
>
> the endless loop is certainly a bug.  Feel free to open a Jira issue,
> else I'll do it later today.  Thanks for reporting this.
>
> --Thilo
>
> Matthew Campbell wrote:
>   
>> Actually...I may have put my foot in my mouth on Friday concerning
>> DocumentAnnotation containing only one child annotation.  The bug in the
>> AnnotationIndexImpl addChildredn() method may still be an issue though. 
>> Sorry for the confusion.
>>
>>
>> -Matt
>>
>> Matthew Campbell wrote:
>>     
>>> 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
>>>
>>>       
>
>   

Re: AnnotationIndex tree()

Posted by Thilo Goetz <tw...@gmx.de>.
Hi Matt,

the endless loop is certainly a bug.  Feel free to open a Jira issue,
else I'll do it later today.  Thanks for reporting this.

--Thilo

Matthew Campbell wrote:
> Actually...I may have put my foot in my mouth on Friday concerning
> DocumentAnnotation containing only one child annotation.  The bug in the
> AnnotationIndexImpl addChildredn() method may still be an issue though. 
> Sorry for the confusion.
> 
> 
> -Matt
> 
> Matthew Campbell wrote:
>> 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
>>

Re: AnnotationIndex tree()

Posted by Matthew Campbell <mc...@syrres.com>.
Actually...I may have put my foot in my mouth on Friday concerning 
DocumentAnnotation containing only one child annotation.  The bug in the 
AnnotationIndexImpl addChildredn() method may still be an issue though.  
Sorry for the confusion.


-Matt

Matthew Campbell wrote:
> 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
>