if (!foundPSE)
continue;
if (foundPSE && foundDrug) {
PSESentence ps = new PSESentence(jcas);
ps.setBegin(sen.getBegin());
ps.setEnd(sen.getEnd());
ps.addToIndexes();
} else if (foundPSE && !foundDrug) {
int num = sen.getSentenceNumber();
num = (num > 0) ? num - 1 : num;
int[] previousSenSpan = SEUtil
.getSentenceSpanOfGivenSentenceNum(jcas, num);
// only if they are in the same line
if (SEUtil.isSpanInSameLine(jcas, previousSenSpan[0],
sen.getEnd())) {
neIter = FSUtil.getAnnotationsInSpanIterator(jcas,
IdentifiedAnnotation.type, previousSenSpan[0],
previousSenSpan[1] + 1);
while (neIter.hasNext()) {
IdentifiedAnnotation n = (IdentifiedAnnotation) neIter
.next();
if (n.getTypeID() == 1) {
PSESentence ps = new PSESentence(jcas);
ps.setBegin(previousSenSpan[0]);
ps.setEnd(sen.getEnd());
ps.addToIndexes();
break;
}
}
}
}