Example usage for weka.core.converters TextDirectoryLoader setOptions

List of usage examples for weka.core.converters TextDirectoryLoader setOptions

Introduction

In this page you can find the example usage for weka.core.converters TextDirectoryLoader setOptions.

Prototype

@Override
public void setOptions(String[] options) throws Exception 

Source Link

Document

Parses a given list of options.

Usage

From source file:preprocess.TextDirectoryLoaderEX.java

License:Open Source License

/**
 * Main method.//  w w  w. ja  v  a 2 s .  co  m
 *
 * @param args should contain the name of an input file.
 */
public static void main(String[] args) {
    if (args.length > 0) {
        try {
            TextDirectoryLoader loader = new TextDirectoryLoader();
            loader.setOptions(args);
            System.out.println(loader.getDataSet());
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else {
        System.err.println("\nUsage:\n" + "\tTextDirectoryLoader [options]\n" + "\n" + "Options:\n");

        Enumeration enm = ((OptionHandler) new TextDirectoryLoader()).listOptions();
        while (enm.hasMoreElements()) {
            Option option = (Option) enm.nextElement();
            System.err.println(option.synopsis());
            System.err.println(option.description());
        }

        System.err.println();
    }
}