OffsetAttribute offset = ts.addAttribute(OffsetAttribute.class);
//when tokenizing labels we need to preserve all chars
if(offset.startOffset() > lastEnd){ //add token for stopword
at.addToken(lastEnd,offset.startOffset());
}
at.addToken(offset.startOffset(), offset.endOffset());
lastEnd = offset.endOffset();
}
} catch (IOException e) {
log.warn("IOException while reading the parsed Text",e);
throw new EngineException("IOException while reading the parsed Text",e);