uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Gruber" <thomas.gru...@econob.com>
Subject UIMA subiterator
Date Wed, 03 Apr 2013 10:48:22 GMT


I have a problem with the subiterator and would appreciate any help on this
issue. I use uimafit 1.4.0 and uimaj-core 2.4.0

Subiterator in use is:


I have an annotation "Sentence" which covers a sentence. 

Then I have an annotation "Value" which covers numerical values in a


Example: "This is sentence A with no value. This is sentence B with value
377." causes 

-          two "Sentence" annotations: "This is sentence A with no value."
and "This is sentence B with value 377."

-          one  "Value" annotation: "377"


Now, if I want to get all "Value" annotations of each "Sentence", I iterate
over the "Sentence"-anntotations and then use a subiterator to iterate over
all "Value"-annotations within this sentence. 


The problem occurs if I set the "strict" parameter to "false". In this case,
for the first Sentence the subiterator also returns the value of the second
sentence, i.e. "377" is returned for the sentence "This is sentence A with
no value."

Normally, according to the javadoc, only annotations should returned with
"annot < b and annot.getBegin() <= b.getBegin() <= annot.getEnd()".


The (abstracted) code fragment looks as follow:


Iterator<SentenceAnnotation> it = JCasUtil.iterator(myCAS,


while (it.hasNext()) {


Sentence sa = it.next();


Iterator<Value> it3 = JCasUtil.iterator(sa, Value.class, false, false);


                                while (it3.hasNext()) {


                                               Value tempAmount =


                if (tempAmount.getBegin() > sa.getEnd()) {

-------------------------------- ERROR ------------------------- This
sentence covers a value which is out of bounds!");





Thank you in advance. 

Best regards,





  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message