Duy Dinh - 2012-03-01
/**
 * 
 * Arguments for running concept extraction using command line options
 * 
 */
static class ConceptExtractionOptions {
    public static CommandLine parseArguments(String[] args) {
        CommandLine commandLine = null;

        // Manually define short options and their long equivalent ones
        Options options = new Options();
        options.addOption("r", "recursive", false,
                "Recursively processing (only for processing a directory)");
        options.addOption("c", "clean", false,
                "Clean and remove all previous processing data");
        options.addOption("h", "help", false,
                "Print this usage information");
        options.addOption("f", "inputFile", true,
                "Extracting concepts from a file");
        options.addOption("t", "text", true,
                "Extracting concepts from a text");
        options.addOption("d", "inputDirectory", true,
                "Extracting concepts from a directory");
        options.addOption("o", "output", true, "Output file/directory");

        // Parse options
        CommandLineParser parser = new BasicParser();
        try {
            commandLine = parser.parse(options, args);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return commandLine;
    }
}