Search in sources :

Example 1 with InteractiveShell

use of edu.illinois.cs.cogcomp.core.utilities.commands.InteractiveShell in project cogcomp-nlp by CogComp.

the class VerbSenseClassifierMain method main.

@CommandIgnore
public static void main(String[] arguments) throws Exception {
    InteractiveShell<VerbSenseClassifierMain> shell = new InteractiveShell<>(VerbSenseClassifierMain.class);
    if (arguments.length == 0) {
        System.err.println("Usage: <config-file> command");
        System.err.println("Required parameter config-file missing.");
        shell.showDocumentation();
    } else if (arguments.length == 1) {
        System.err.println("Usage: <config-file> command");
        shell.showDocumentation();
    } else {
        long start_time = System.currentTimeMillis();
        try {
            rm = new VerbSenseConfigurator().getDefaultConfig();
            String[] args = new String[arguments.length - 1];
            System.arraycopy(arguments, 1, args, 0, args.length);
            shell.runCommand(args);
            long runTime = (System.currentTimeMillis() - start_time) / 1000;
            System.out.println("This experiment took " + runTime + " secs");
        } catch (AssertionError e) {
            e.printStackTrace();
            System.exit(-1);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : VerbSenseConfigurator(edu.illinois.cs.cogcomp.verbsense.utilities.VerbSenseConfigurator) InteractiveShell(edu.illinois.cs.cogcomp.core.utilities.commands.InteractiveShell) CommandIgnore(edu.illinois.cs.cogcomp.core.utilities.commands.CommandIgnore)

Aggregations

CommandIgnore (edu.illinois.cs.cogcomp.core.utilities.commands.CommandIgnore)1 InteractiveShell (edu.illinois.cs.cogcomp.core.utilities.commands.InteractiveShell)1 VerbSenseConfigurator (edu.illinois.cs.cogcomp.verbsense.utilities.VerbSenseConfigurator)1