use of org.kohsuke.args4j.CmdLineException in project Anserini by castorini.
the class EntityLinking method main.
public static void main(String[] args) throws Exception {
Args searchArgs = new Args();
// Parse args
CmdLineParser parser = new CmdLineParser(searchArgs, ParserProperties.defaults().withUsageWidth(90));
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.err.println("Example command: " + EntityLinking.class.getSimpleName() + parser.printExample(OptionHandlerFilter.REQUIRED));
return;
}
LOG.info("searching gold data: " + searchArgs.goldData);
if (searchArgs.goldData) {
new EntityLinking(searchArgs.index).searchGoldFile(searchArgs.data, searchArgs.hits, searchArgs.output);
} else {
new EntityLinking(searchArgs.index).bruteSearchFile(searchArgs.data, searchArgs.hits, searchArgs.output);
}
}
use of org.kohsuke.args4j.CmdLineException in project Anserini by castorini.
the class IndexNodes method main.
public static void main(String[] args) throws Exception {
Args indexArgs = new Args();
CmdLineParser parser = new CmdLineParser(indexArgs, ParserProperties.defaults().withUsageWidth(90));
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.err.println("Example: " + IndexNodes.class.getSimpleName() + parser.printExample(OptionHandlerFilter.REQUIRED));
return;
}
new IndexNodes(indexArgs.input, indexArgs.index).run();
}
use of org.kohsuke.args4j.CmdLineException in project Anserini by castorini.
the class IndexTopics method main.
public static void main(String[] args) throws Exception {
Args indexArgs = new Args();
CmdLineParser parser = new CmdLineParser(indexArgs, ParserProperties.defaults().withUsageWidth(90));
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.err.println("Example: " + IndexTopics.class.getSimpleName() + parser.printExample(OptionHandlerFilter.REQUIRED));
return;
}
new IndexTopics(indexArgs.input, indexArgs.index).run();
}
use of org.kohsuke.args4j.CmdLineException in project Anserini by castorini.
the class LookupNode method main.
public static void main(String[] args) throws Exception {
Args searchArgs = new Args();
CmdLineParser parser = new CmdLineParser(searchArgs, ParserProperties.defaults().withUsageWidth(90));
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.err.println("Example: " + LookupNode.class.getSimpleName() + parser.printExample(OptionHandlerFilter.REQUIRED));
return;
}
LookupNode lookup = new LookupNode(searchArgs.index);
lookup.search(searchArgs.subject);
lookup.close();
}
use of org.kohsuke.args4j.CmdLineException in project legacy-jclouds-examples by jclouds.
the class MainApp method main.
public static void main(String[] args) throws Exception {
Arguments arguments = new Arguments();
CmdLineParser parser = new CmdLineParser(arguments);
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
// handling of wrong arguments
System.err.println(e.getMessage());
parser.printUsage(System.err);
System.exit(1);
}
new MainApp(arguments).run();
}
Aggregations