Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.1
-
None
Description
- JCasUtil Subiterator returns annotations which are not within the border of the container (parent) annotation if parameter "strict" is set to "false"
- See attached maven project for test setup, java classes, a SIMPLIFIED typesystem and the test CAS xml-file.
- We have two annotations, "SentenceAnnotation" and "ValueAnnotation". A "SentenceAnnotation" covers a sentence and the "ValueAnnotation" covers a numerical value.
- We have the following example plank text:
- "This is sentence A with no value. This is sentence B with value 377."
- Creates two sentence annotations ("This is sentence A with no value." and "This is sentence B with value 377.") and one value annotation ("377").
- Now, if i want to get all "ValueAnnotation" within a "SentenceAnnotation", i iterate over each "SentenceAnnotation" and use JCasUtil.iterator(...) to get the ValueAnnotations with the following parameters: JCasUtil.iterator(currentSentence, ValueAnnotation.class, false, false);
- As a result, i get for the first sentence also the value of the second sentence and this might be wrong because even if "strict" is set to "false", the begin of the "ValueAnnotation" should be smaller than the end of the "SentenceAnnnotation". But in the example given the begin of the "ValueAnnotation" is after the end of the FIRST "SentenceAnnotation"
Attachments
Attachments
Issue Links
- duplicates
-
UIMA-3075 Unambiguous non-strict subiterator may return annotations outside the given annotation's range
- Resolved