public void start() throws LiveIOProgramExecutionException { if (OS.isWindows()) { // C&C's craziness on Windows... this.modelsDir = this.modelsDir.replaceAll("\\\\", "\\\\\\\\"); } System.out.println("["+this.getClass().getName()+"] models directory = " +this.modelsDir); LinkedList<String> programAndArgs = new LinkedList<String>(); programAndArgs.add(this.programName); programAndArgs.add("--models"); programAndArgs.add(this.modelsDir); execution = new LiveIOProgramExecution(programAndArgs); execution.start(); converter = new TextToPennTreeBankConverter(); }
/** * Parser initializations. * @throws LiveIOProgramExecutionException */ private void start() throws LiveIOProgramExecutionException { if (OS.isWindows()) { // C&C's craziness on Windows... this.modelsDir = this.modelsDir.replaceAll("\\\\", "\\\\\\\\"); } System.out.println("["+this.getClass().getName()+"] models directory = " +this.modelsDir); LinkedList<String> programAndArgs = new LinkedList<String>(); programAndArgs.add(this.exec); programAndArgs.add(MODELS_ARG_SPECIFIER); programAndArgs.add(this.modelsDir); //execution = new LiveIOProgramExecution(programAndArgs,Charset.forName(C_AND_C_CHARSET),true); execution = new LiveIOProgramExecution(programAndArgs,java.nio.charset.Charset.forName(C_AND_C_CHARSET),false,false,true); //execution = new LiveIOProgramExecution(programAndArgs,null,true,false,true); //execution = new LiveIOProgramExecution(programAndArgs); execution.start(); converter = new eu.excitementproject.eop.lap.biu.en.tokenizer.TextToPennTreeBankConverter(); }
protected void start() throws LiveIOProgramExecutionException, PennTreeBankConverterException { if (execution!=null) ; else { try { createConvertionScript(); LinkedList<String> programAndArguments = new LinkedList<String>(); programAndArguments.add(CONVERTER_PROGRAM); programAndArguments.addAll(Utils.arrayToCollection(CONVERTER_PARAMS, new ArrayList<String>(CONVERTER_PARAMS.length))); programAndArguments.add(CONVERTER_SCRIPT_NAME_SPECIFIER_PARAM); programAndArguments.add(convertionFile.getAbsolutePath()); execution = new LiveIOProgramExecution(programAndArguments); execution.start(); } catch(IOException e) { throw new PennTreeBankConverterException("script creation failure. See nested exception",e); } } }