cz.cvut.felk.newsgroup.preprocess
Class Main

java.lang.Object
  extended by cz.cvut.felk.newsgroup.preprocess.Main

public class Main
extends Object


Field Summary
(package private) static String testArff
          Default path to the newsgroup training dataset
(package private) static String testPath
          Default path to the newsgroup training dataset
(package private) static String trainArff
          Default path to the newsgroup training dataset
(package private) static String trainPath
          Default path to the newsgroup training dataset
 
Constructor Summary
Main()
           
 
Method Summary
private static String getArffHeader(Model model)
          Produces a header for an ARFF file.
private static void initFromCommandLine(String[] args)
          Parse command-line parameters.
static void main(String[] args)
          Runs the whole programme
private static Map<File,String> readInputDataset(File root)
          Finds all examples in a dataset + their target class
private static void writeOutputDataset(Map<File,String> data, Model model, String outputFileName)
          Writes the while dataset into an ARFF file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trainPath

static String trainPath
Default path to the newsgroup training dataset


testPath

static String testPath
Default path to the newsgroup training dataset


trainArff

static String trainArff
Default path to the newsgroup training dataset


testArff

static String testArff
Default path to the newsgroup training dataset

Constructor Detail

Main

public Main()
Method Detail

main

public static void main(String[] args)
Runs the whole programme

Parameters:
args - the command line arguments

writeOutputDataset

private static void writeOutputDataset(Map<File,String> data,
                                       Model model,
                                       String outputFileName)
Writes the while dataset into an ARFF file

Parameters:
data -
model -
outputFileName -

readInputDataset

private static Map<File,String> readInputDataset(File root)
                                          throws IOException
Finds all examples in a dataset + their target class

Parameters:
root - the path to the dataset
Returns:
the list all files (=examples) + appropriate target class
Throws:
IOException - the root does not exist

initFromCommandLine

private static void initFromCommandLine(String[] args)
Parse command-line parameters.

Parameters:
args - array of command-line parameters

getArffHeader

private static String getArffHeader(Model model)
Produces a header for an ARFF file.

Parameters:
model - the model containing column definitions
Returns:
string to be written into the file