/** * runs the evaluator with the given commandline options * * @param evaluator the evaluator to run * @param options the commandline options */ public static void runEvaluator(ASEvaluation evaluator, String[] options) { try { evaluator.preExecution(); System.out .println(AttributeSelection.SelectAttributes(evaluator, options)); } catch (Exception e) { String msg = e.toString().toLowerCase(); if ((msg.indexOf("help requested") == -1) && (msg.indexOf("no training file given") == -1)) { e.printStackTrace(); } System.err.println(e.getMessage()); } try { evaluator.postExecution(); } catch (Exception ex) { ex.printStackTrace(); } }
/** * runs the evaluator with the given commandline options * * @param evaluator the evaluator to run * @param options the commandline options */ public static void runEvaluator(ASEvaluation evaluator, String[] options) { try { evaluator.preExecution(); System.out .println(AttributeSelection.SelectAttributes(evaluator, options)); } catch (Exception e) { String msg = e.toString().toLowerCase(); if ((msg.indexOf("help requested") == -1) && (msg.indexOf("no training file given") == -1)) { e.printStackTrace(); } System.err.println(e.getMessage()); } try { evaluator.postExecution(); } catch (Exception ex) { ex.printStackTrace(); } }
/** * Execute the supplied object. Subclasses need to override this method. * * @param toRun the object to execute * @param options any options to pass to the object * @throws Exception if a problem occurs */ @Override public void run(Object toRun, String[] options) throws Exception { if (!(toRun instanceof ASEvaluation)) { throw new IllegalArgumentException( "Object to run is not an instance of ASEValuation!"); } preExecution(); runEvaluator((ASEvaluation) toRun, options); postExecution(); }
/** * Execute the supplied object. Subclasses need to override this method. * * @param toRun the object to execute * @param options any options to pass to the object * @throws Exception if a problem occurs */ @Override public void run(Object toRun, String[] options) throws Exception { if (!(toRun instanceof ASEvaluation)) { throw new IllegalArgumentException( "Object to run is not an instance of ASEValuation!"); } preExecution(); runEvaluator((ASEvaluation) toRun, options); postExecution(); }