@Override public void getNext(CAS aCAS) throws IOException, CollectionException { super.getNext(aCAS); JCas jcas; try { jcas = aCAS.getJCas(); // consider a tweet to be a sentence Sentence sentenceAnno = new Sentence(jcas); sentenceAnno.setBegin(0); sentenceAnno.setEnd(jcas.getDocumentText().length()); sentenceAnno.addToIndexes(); } catch (CASException e) { throw new CollectionException(); } TextClassificationOutcome outcome = new TextClassificationOutcome(jcas); outcome.setOutcome(getTextClassificationOutcome(jcas)); outcome.addToIndexes(); }