class Driver { static class Config extends Configuration { @Argument(keys = {"-i", "--input"}, help = "Input file") private String inputFile = "./text8"; @Argument(keys = {"-e", "--epochs"}, help = "Number of epochs to train on") private int epochs = 5; @Argument(keys = {"-t", "--threads"}, help = "Number of threads") private int threads = Runtime.getRuntime().availableProcessors(); @Argument(keys = {"-v", "--vector-size"}, help = "Embedding vector dimension") private int emb_size = 128; @Argument(keys = {"-w", "--window-size"}, help = "Window size") private int windowSize = 10; @Argument(keys = {"-ns", "--negative-samples"}, help = "number of negative samples per word pair") private int negativeSamples = 10; @Argument(keys = {"-a", "--alpha"}, help = "initial alpha (learning rate)") private float alpha = 0.005F; @Argument(keys = {"--test"}, help = "Run in testing mode") private boolean testMode = false; @Argument(keys = {"--local-rng"}, help = "Use local random number generator") private boolean localRng = false; public Config(String[] args) throws Exception { parse(args); } } public static void main(String args[]) throws Exception { Config conf = new Config(args); if(c.help) { System.out.println(c.getHelp()); System.exit(0); } // ... } }