coreComponents
Class ArffCreator

java.lang.Object
  |
  +--coreComponents.ArffCreator

public class ArffCreator
extends java.lang.Object

A very messy class used to convert/create arff files

Version:
$Revision: 1.0 $
Author:
David Lindsay (davidl@cs.rhul.ac.uk)

Constructor Summary
ArffCreator()
           
 
Method Summary
static java.lang.String convertFileToString(java.io.File inputFile)
          Method for converting a text file into a big long string for processing!
static Instances createArffDataFromTextFilesInDirectories(FastVector classNames, java.lang.String dataSetName, java.lang.String stringAttributeName, java.lang.String classAttributeName, FastVector[] directoryNames)
          Create a pattern recognition data set from text files stored in directories.
static void main(java.lang.String[] args)
          Testing area for this object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArffCreator

public ArffCreator()
Method Detail

createArffDataFromTextFilesInDirectories

public static Instances createArffDataFromTextFilesInDirectories(FastVector classNames,
                                                                 java.lang.String dataSetName,
                                                                 java.lang.String stringAttributeName,
                                                                 java.lang.String classAttributeName,
                                                                 FastVector[] directoryNames)
                                                          throws java.lang.Exception
Create a pattern recognition data set from text files stored in directories. Each of the text files are read in from each directory (and assigned the appropriate class), with the files text being converted into a String and used as an attribute! Really this is useful for applications such as creating data sets from email/documents etc. Will strip out the charachter ' so that can output as a string in arff format!

Parameters:
dataSetName - the name of the data set that you are creating
stringAttributeName - the name of the String attribute that you are creating!
directoryNames - an array contains vectors of each directory name (containing the files for each class)
Returns:
the nice data set all in friendly arff format
java.lang.Exception

convertFileToString

public static java.lang.String convertFileToString(java.io.File inputFile)
Method for converting a text file into a big long string for processing!

Parameters:
inputFile - the input file to be converted

main

public static void main(java.lang.String[] args)
Testing area for this object



Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London