From: <raj...@us...> - 2006-08-23 14:23:55
|
Revision: 6796 Author: rajarshi Date: 2006-08-23 07:23:43 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/cdk/?rev=6796&view=rev Log Message: ----------- Made some minor cleanups to the code Modified Paths: -------------- trunk/cdk/src/org/openscience/cdk/libio/weka/Weka.java Modified: trunk/cdk/src/org/openscience/cdk/libio/weka/Weka.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/libio/weka/Weka.java 2006-08-21 06:17:34 UTC (rev 6795) +++ trunk/cdk/src/org/openscience/cdk/libio/weka/Weka.java 2006-08-23 14:23:43 UTC (rev 6796) @@ -23,19 +23,14 @@ */ package org.openscience.cdk.libio.weka; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.StringReader; -import java.util.Vector; - import weka.classifiers.Classifier; import weka.core.Instance; import weka.core.Instances; +import java.io.*; +import java.util.Vector; + /** * <p>Weka class is a library which use the program WEKA: a Machine Learning Project.</p> * To inizalizate weka class is typically done like: <pre> @@ -101,18 +96,18 @@ /** * Extract the class name attribute manually from the file * - * @param insr The BufferedReader + * @param input The BufferedReader * @return Array with the class attributes */ private String[] extractClass(BufferedReader input) { Vector attribV = new Vector(); String[] classAttrib = null; - String line = ""; + String line; try { while ((line = input.readLine()) != null) { if(line.startsWith("@attribute class {")){ int strlen = line.length(); - String line_ = null; + String line_ = null; out: for (int i = 0; i < strlen; i++){ switch(line.charAt(i)){ @@ -141,7 +136,7 @@ edited.append(line_.charAt(i)); } } - + } } if(attribV.size() > 0){ @@ -289,8 +284,7 @@ string += y[j]+", \n"; } } - Reader reader = new StringReader(string); - return reader; + return (Reader)new StringReader(string); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |