public String process(String document,Date documentCreationTime,ResultFormatter resultFormatter) throws DocumentCreationTimeMissingException {
  logger.log(Level.INFO,"Processing started");
  logger.log(Level.FINE,"Generate CAS object");
  JCas jcas=null;
  try {
    jcas=jcasFactory.createJCas();
    jcas.setDocumentText(document);
    logger.log(Level.FINE,"CAS object generated");
  }
 catch (  Exception e) {
    e.printStackTrace();
    logger.log(Level.WARNING,"Cas object could not be generated");
  }
  try {
    logger.log(Level.FINER,"Establishing preconditions...");
    provideDocumentCreationTime(jcas,documentCreationTime);
    establishHeidelTimePreconditions(jcas);
    logger.log(Level.FINER,"Preconditions established");
    heidelTime.process(jcas);
    logger.log(Level.INFO,"Processing finished");
  }
 catch (  Exception e) {
    e.printStackTrace();
    logger.log(Level.WARNING,"Processing aborted due to errors");
  }
  if (doIntervalTagging)   runIntervalTagger(jcas);
  logger.log(Level.FINE,"Formatting result...");
  String result=null;
  try {
    result=resultFormatter.format(jcas);
    logger.log(Level.INFO,"Result formatted");
  }
 catch (  Exception e) {
    e.printStackTrace();
    logger.log(Level.WARNING,"Result could not be formatted");
  }
  return result;
}

public String process ( String document , Date documentCreationTime , ResultFormatter resultFormatter ) throws DocumentCreationTimeMissingException { logger . log ( Level . INFO , "Processing started" ) ; logger . log ( Level . FINE , "Generate CAS object" ) ; JCas jcas = null ; try { jcas = jcasFactory . createJCas ( ) ; jcas . setDocumentText ( document ) ; logger . log ( Level . FINE , "CAS object generated" ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; logger . log ( Level . WARNING , "Cas object could not be generated" ) ; } try { logger . log ( Level . FINER , "Establishing preconditions..." ) ; provideDocumentCreationTime ( jcas , documentCreationTime ) ; establishHeidelTimePreconditions ( jcas ) ; logger . log ( Level . FINER , "Preconditions established" ) ; heidelTime . process ( jcas ) ; logger . log ( Level . INFO , "Processing finished" ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; logger . log ( Level . WARNING , "Processing aborted due to errors" ) ; } if ( doIntervalTagging ) runIntervalTagger ( jcas ) ; logger . log ( Level . FINE , "Formatting result..." ) ; String result = null ; try { result = resultFormatter . format ( jcas ) ; logger . log ( Level . INFO , "Result formatted" ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; logger . log ( Level . WARNING , "Result could not be formatted" ) ; } return result ; }
processes document with heideltime
