private List<Sentence> createBaseSentences(JCas jCas) throws AnalysisEngineProcessException {
  List<Sentence> sentences=new ArrayList<>();
  try {
    String text=jCas.getDocumentText();
    Span[] sentenceSpans=sentenceDetector.sentPosDetect(text);
    for (int a=0; a < sentenceSpans.length; a++) {
      Span sentSpan=sentenceSpans[a];
      Sentence sent=new Sentence(jCas);
      sent.setBegin(sentSpan.getStart());
      sent.setEnd(sentSpan.getEnd());
      addToJCasIndex(sent);
      sentences.add(sent);
    }
  }
 catch (  Exception e) {
    throw new AnalysisEngineProcessException(e);
  }
  return sentences;
}

private List < Sentence > createBaseSentences ( JCas jCas ) throws AnalysisEngineProcessException { List < Sentence > sentences = new ArrayList < > ( ) ; try { String text = jCas . getDocumentText ( ) ; Span [ ] sentenceSpans = sentenceDetector . sentPosDetect ( text ) ; for ( int a = 0 ; a < sentenceSpans . length ; a ++ ) { Span sentSpan = sentenceSpans [ a ] ; Sentence sent = new Sentence ( jCas ) ; sent . setBegin ( sentSpan . getStart ( ) ) ; sent . setEnd ( sentSpan . getEnd ( ) ) ; addToJCasIndex ( sent ) ; sentences . add ( sent ) ; } } catch ( Exception e ) { throw new AnalysisEngineProcessException ( e ) ; } return sentences ; }
use the opennlp sentence detector to detect sentences and add them to the jcas index
