public static JCas runTest(String aDocumentId,AnalysisEngine aEngine,String aLanguage,String aDocument) throws UIMAException {
  if (offline) {
    System.setProperty(ResourceObjectProviderBase.PROP_REPO_OFFLINE,"true");
  }
  offline=true;
  JCas jcas=aEngine.newJCas();
  if (aDocumentId != null) {
    DocumentMetaData meta=DocumentMetaData.create(jcas);
    meta.setDocumentId(aDocumentId);
  }
  jcas.setDocumentLanguage(aLanguage);
  TokenBuilder<Token,Sentence> tb=new TokenBuilder<Token,Sentence>(Token.class,Sentence.class);
  tb.buildTokens(jcas,aDocument);
  aEngine.process(jcas);
  AssertAnnotations.assertValid(jcas);
  return jcas;
}

public static JCas runTest ( String aDocumentId , AnalysisEngine aEngine , String aLanguage , String aDocument ) throws UIMAException { if ( offline ) { System . setProperty ( ResourceObjectProviderBase . PROP_REPO_OFFLINE , "true" ) ; } offline = true ; JCas jcas = aEngine . newJCas ( ) ; if ( aDocumentId != null ) { DocumentMetaData meta = DocumentMetaData . create ( jcas ) ; meta . setDocumentId ( aDocumentId ) ; } jcas . setDocumentLanguage ( aLanguage ) ; TokenBuilder < Token , Sentence > tb = new TokenBuilder < Token , Sentence > ( Token . class , Sentence . class ) ; tb . buildTokens ( jcas , aDocument ) ; aEngine . process ( jcas ) ; AssertAnnotations . assertValid ( jcas ) ; return jcas ; }
run an analysis engine using a document . the document is automatically split into tokens based on spaces and into sentences based on newline . make sure the punctuation is surrounded by spaces !
