Package weka.core.scripting

Examples of weka.core.scripting.Jython


    /**
     * Performs the actual run.
     */
    protected void doRun() {
      Jython  jython;
      Class[]  classes;
      Object[]  params;
      String  argv;
      String  arg;
      int  i;
     
      classes = new Class[]{String.class};
      params  = new Object[]{m_Owner.getFilename().getPath()};
      argv    = "sys.argv = ['" + Utils.backQuoteChars(m_Owner.getFilename().getPath()) + "'";
      for (i = 0; i < getArgs().length; i++) {
  arg   = Utils.backQuoteChars(getArgs()[i]);
  argv += ", '" + arg + "'";
      }
      argv   += "]";
     
      jython  = new Jython();
     
      // set commandline parameters
      jython.invoke("exec", new Class[]{String.class}, new Object[]{"import sys"});
      jython.invoke("exec", new Class[]{String.class}, new Object[]{argv});
     
      jython.invoke("execfile", classes, params);
    }
View Full Code Here

TOP

Related Classes of weka.core.scripting.Jython

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.