Thanks Jeff, I don't think the image is needed. here's what it showed. With the negex annotator in the pipeline
With "Negative for headache" as the text starting at position 0 In HistoryAttributeClassifier beginning near line 274 the first IdentifiedAnnotation in the *List<IdentifiedAnnotation> lsmentions* contains a ContextAnnotation where the offset range is -1, 13. Looking at the text, it should probably have been 0, 11. Add any text ahead of the "Negative for" and it works brilliantly. Probably one of those off-by-one errors that comes from staying up too late. Peter Peter Peter On Mon, Aug 31, 2020 at 3:48 AM Miller, Timothy < timothy.mil...@childrens.harvard.edu> wrote: > Peter, > I think the email server doesn't let images through. Can you post an > imgur link maybe? > Tim > > On Sun, 2020-08-30 at 14:35 -0700, Peter Abramowitsch wrote: > > * External Email - Caution * > > > > Hi, > > I was getting a StringIndexOutOfBoundsException in > > DependencyUtil.doesSubsume(annot1, annot2) with exactly this > > situation: > > > > negex annotator > > the text begins "negative for <anything>" > > > > If the chunk negative for xyz is preceded by anything else, even a > > space, the problem goes away. It also goes away when you choose > > another style of negation. "no headache", for instance > > > > I've traced the problem back to some illegal entries in the jCAS You > > can see from the image below that the ContextAnnotation's begin > > offset is illegal. > > > > Clearly there's an off-by-one error and this triggered the exception > > because in my example, the Annotation is created right from the 0th > > char of my note text. But it occurred to me that in every other > > case, where the annotation doesn't begin on the first character and > > it doesn't throw an exception, it might cause downstream methods > > like doesSubsume to give the wrong result because the begin/end > > offsets are wrong. > > > > I'm not sure how to follow this up. But if anyone wants to tackle > > it....? > > > > This is from HistoryAttributeClassifier beginning at line 274 > > > > > > > > > > >