Package no.priv.garshol.duke.utils

Examples of no.priv.garshol.duke.utils.CommandLineParser$Option


   
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option oobOpt = obuilder.withShortName("oob").withRequired(false).withDescription(
      "Optional, estimate the out-of-bag error").create();
   
    Option dataOpt = obuilder.withLongName("data").withShortName("d").withRequired(true).withArgument(
      abuilder.withName("path").withMinimum(1).withMaximum(1).create()).withDescription("Data path").create();
   
    Option datasetOpt = obuilder.withLongName("dataset").withShortName("ds").withRequired(true).withArgument(
      abuilder.withName("dataset").withMinimum(1).withMaximum(1).create()).withDescription("Dataset path")
        .create();
   
    Option selectionOpt = obuilder.withLongName("selection").withShortName("sl").withRequired(true)
        .withArgument(abuilder.withName("m").withMinimum(1).withMaximum(1).create()).withDescription(
          "Number of variables to select randomly at each tree-node").create();
   
    Option seedOpt = obuilder.withLongName("seed").withShortName("sd").withRequired(false).withArgument(
      abuilder.withName("seed").withMinimum(1).withMaximum(1).create()).withDescription(
      "Optional, seed value used to initialise the Random number generator").create();
   
    Option partialOpt = obuilder.withLongName("partial").withShortName("p").withRequired(false)
        .withDescription("Optional, use the Partial Data implementation").create();
   
    Option nbtreesOpt = obuilder.withLongName("nbtrees").withShortName("t").withRequired(true).withArgument(
      abuilder.withName("nbtrees").withMinimum(1).withMaximum(1).create()).withDescription(
      "Number of trees to grow").create();
   
    Option helpOpt = obuilder.withLongName("help").withDescription("Print out help").withShortName("h")
        .create();
   
    Group group = gbuilder.withName("Options").withOption(oobOpt).withOption(dataOpt).withOption(datasetOpt)
        .withOption(selectionOpt).withOption(seedOpt).withOption(partialOpt).withOption(nbtreesOpt)
        .withOption(helpOpt).create();
View Full Code Here


   
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option oobOpt = obuilder.withShortName("oob").withRequired(false).withDescription(
      "Optional, estimate the out-of-bag error").create();
   
    Option dataOpt = obuilder.withLongName("data").withShortName("d").withRequired(true).withArgument(
      abuilder.withName("path").withMinimum(1).withMaximum(1).create()).withDescription("Data path").create();
   
    Option datasetOpt = obuilder.withLongName("dataset").withShortName("ds").withRequired(true).withArgument(
      abuilder.withName("dataset").withMinimum(1).withMaximum(1).create()).withDescription("Dataset path")
        .create();
   
    Option selectionOpt = obuilder.withLongName("selection").withShortName("sl").withRequired(true)
        .withArgument(abuilder.withName("m").withMinimum(1).withMaximum(1).create()).withDescription(
          "Number of variables to select randomly at each tree-node").create();
   
    Option seedOpt = obuilder.withLongName("seed").withShortName("sd").withRequired(false).withArgument(
      abuilder.withName("seed").withMinimum(1).withMaximum(1).create()).withDescription(
      "Optional, seed value used to initialise the Random number generator").create();
   
    Option partialOpt = obuilder.withLongName("partial").withShortName("p").withRequired(false)
        .withDescription("Optional, use the Partial Data implementation").create();
   
    Option nbtreesOpt = obuilder.withLongName("nbtrees").withShortName("t").withRequired(true).withArgument(
      abuilder.withName("nbtrees").withMinimum(1).withMaximum(1).create()).withDescription(
      "Number of trees to grow").create();
   
    Option helpOpt = obuilder.withLongName("help").withDescription("Print out help").withShortName("h")
        .create();
   
    Group group = gbuilder.withName("Options").withOption(oobOpt).withOption(dataOpt).withOption(datasetOpt)
        .withOption(selectionOpt).withOption(seedOpt).withOption(partialOpt).withOption(nbtreesOpt)
        .withOption(helpOpt).create();
View Full Code Here

  public static void main(String[] args) throws Exception {
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option inputOpt = DefaultOptionCreator.inputOption().withRequired(false).create();
    Option outputOpt = DefaultOptionCreator.outputOption().withRequired(false).create();
    Option maxIterOpt = DefaultOptionCreator.maxIterOption().withRequired(false).create();
    Option topicsOpt = DefaultOptionCreator.kOption().withRequired(false).create();
   
    Option redOpt = obuilder.withLongName("reducerNum").withRequired(false).withArgument(
      abuilder.withName("r").withMinimum(1).withMaximum(1).create()).withDescription(
      "The number of reducers to use.").withShortName("r").create();
   
    Option vectorOpt = obuilder.withLongName("vector").withRequired(false).withArgument(
      abuilder.withName("v").withMinimum(1).withMaximum(1).create()).withDescription(
      "The vector implementation to use.").withShortName("v").create();
   
    Option mOpt = obuilder.withLongName("alpha").withRequired(false).withShortName("m").withArgument(
      abuilder.withName("alpha").withMinimum(1).withMaximum(1).create()).withDescription(
      "The alpha0 value for the DirichletDistribution.").create();
   
    Option modelOpt = obuilder.withLongName("modelClass").withRequired(false).withShortName("d")
        .withArgument(abuilder.withName("modelClass").withMinimum(1).withMaximum(1).create())
        .withDescription("The ModelDistribution class name.").create();
    Option helpOpt = DefaultOptionCreator.helpOption();
   
    Group group = gbuilder.withName("Options").withOption(inputOpt).withOption(outputOpt)
        .withOption(modelOpt).withOption(maxIterOpt).withOption(mOpt).withOption(topicsOpt)
        .withOption(redOpt).withOption(helpOpt).create();
   
View Full Code Here

  public int run(String[] args) throws Exception {
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option inputOpt = obuilder.withLongName("input").withRequired(true).withArgument(
      abuilder.withName("input").withMinimum(1).withMaximum(1).create()).withDescription(
      "The Path for input files.").withShortName("i").create();
   
    Option outputOpt = obuilder.withLongName("output").withRequired(true).withArgument(
      abuilder.withName("output").withMinimum(1).withMaximum(1).create()).withDescription(
      "The Path write output to").withShortName("o").create();
   
    Option maxNGramSizeOpt = obuilder.withLongName("maxNGramSize").withRequired(false).withArgument(
      abuilder.withName("ngramSize").withMinimum(1).withMaximum(1).create())
        .withDescription(
          "(Optional) The maximum size of ngrams to create"
              + " (2 = bigrams, 3 = trigrams, etc) Default Value:2").withShortName("ng").create();
   
    Option minSupportOpt = obuilder.withLongName("minSupport").withRequired(false).withArgument(
      abuilder.withName("minSupport").withMinimum(1).withMaximum(1).create()).withDescription(
      "(Optional) Minimum Support. Default Value: " + CollocReducer.DEFAULT_MIN_SUPPORT).withShortName("s")
        .create();
   
    Option minLLROpt = obuilder.withLongName("minLLR").withRequired(false).withArgument(
      abuilder.withName("minLLR").withMinimum(1).withMaximum(1).create()).withDescription(
      "(Optional)The minimum Log Likelihood Ratio(Float)  Default is " + LLRReducer.DEFAULT_MIN_LLR)
        .withShortName("ml").create();
   
    Option numReduceTasksOpt = obuilder.withLongName("numReducers").withRequired(false).withArgument(
      abuilder.withName("numReducers").withMinimum(1).withMaximum(1).create()).withDescription(
      "(Optional) Number of reduce tasks. Default Value: " + DEFAULT_PASS1_NUM_REDUCE_TASKS)
        .withShortName("nr").create();
   
    Option preprocessOpt = obuilder.withLongName("preprocess").withRequired(false).withDescription(
      "If set, input is SequenceFile<Text,Text> where the value is the document, "
          + " which will be tokenized using the specified analyzer.").withShortName("p").create();
   
    Option unigramOpt = obuilder.withLongName("unigram").withRequired(false).withDescription(
      "If set, unigrams will be emitted in the final output alongside collocations").withShortName("u")
        .create();
   
    Option overwriteOutput = obuilder.withLongName("overwrite").withRequired(false).withDescription(
      "If set, overwrite the output directory").withShortName("w").create();
   
    Option analyzerNameOpt = obuilder.withLongName("analyzerName").withArgument(
      abuilder.withName("analyzerName").withMinimum(1).withMaximum(1).create()).withDescription(
      "The class name of the analyzer").withShortName("a").create();
   
    Option helpOpt = obuilder.withLongName("help").withDescription("Print out help").withShortName("h")
        .create();
   
    Group group = gbuilder.withName("Options").withOption(inputOpt).withOption(outputOpt).withOption(
      maxNGramSizeOpt).withOption(overwriteOutput).withOption(minSupportOpt).withOption(minLLROpt)
        .withOption(numReduceTasksOpt).withOption(analyzerNameOpt).withOption(preprocessOpt).withOption(
View Full Code Here

 
  public static void main(String[] args) throws Exception {
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
    Option helpOpt = DefaultOptionCreator.helpOption();
   
    Option parentOpt = obuilder.withLongName("parent").withRequired(true).withArgument(
      abuilder.withName("parent").withMinimum(1).withMaximum(1).create()).withDescription(
      "Parent dir containing the newsgroups").withShortName("p").create();
   
    Option outputDirOpt = obuilder.withLongName("outputDir").withRequired(true).withArgument(
      abuilder.withName("outputDir").withMinimum(1).withMaximum(1).create()).withDescription(
      "The output directory").withShortName("o").create();
   
    Option analyzerNameOpt = obuilder.withLongName("analyzerName").withRequired(true).withArgument(
      abuilder.withName("analyzerName").withMinimum(1).withMaximum(1).create()).withDescription(
      "The class name of the analyzer").withShortName("a").create();
   
    Option charsetOpt = obuilder.withLongName("charset").withRequired(true).withArgument(
      abuilder.withName("charset").withMinimum(1).withMaximum(1).create()).withDescription(
      "The name of the character encoding of the input files").withShortName("c").create();
   
    Group group = gbuilder.withName("Options").withOption(analyzerNameOpt).withOption(charsetOpt).withOption(
      outputDirOpt).withOption(parentOpt).withOption(helpOpt).create();
View Full Code Here

  public static File getRatings(String[] args) throws OptionException {
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option inputOpt = obuilder.withLongName("input").withRequired(false)
    .withShortName("i").withArgument(
      abuilder.withName("input").withMinimum(1).withMaximum(1).create())
      .withDescription("The Path for input data directory.").create();
   
    Option helpOpt = DefaultOptionCreator.helpOption();
   
    Group group = gbuilder.withName("Options").withOption(inputOpt).withOption(
      helpOpt).create();
   
    Parser parser = new Parser();
View Full Code Here

  public static void main(String[] args) throws IOException {
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option inputOpt = obuilder.withLongName("input").withRequired(true)
    .withShortName("i").withArgument(
      abuilder.withName("input").withMinimum(1).withMaximum(1).create())
      .withDescription("The Path for input data directory.").create();
   
    Option helpOpt = DefaultOptionCreator.helpOption();
   
    Group group = gbuilder.withName("Options").withOption(inputOpt).withOption(
      helpOpt).create();
   
    Parser parser = new Parser();
View Full Code Here

public final class RecommenderJob extends AbstractJob {
 
  @Override
  public int run(String[] args) throws IOException {
   
    Option numReccomendationsOpt = AbstractJob.buildOption("numRecommendations", "n",
      "Number of recommendations per user", "10");
    Option usersFileOpt = AbstractJob.buildOption("usersFile", "u", "File of users to recommend for", null);
   
    Map<String,String> parsedArgs = AbstractJob.parseArguments(args, numReccomendationsOpt, usersFileOpt);
    if (parsedArgs == null) {
      return -1;
    }
View Full Code Here

   
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option vectorSizeOpt = obuilder.withLongName("vectorSize").withRequired(false).withArgument(
      abuilder.withName("vs").withMinimum(1).withMaximum(1).create()).withDescription(
      "Cardinality of the vector. Default 1000").withShortName("vs").create();
    Option vectorSparsityOpt = obuilder.withLongName("sparsity").withRequired(false).withArgument(
      abuilder.withName("sp").withMinimum(1).withMaximum(1).create()).withDescription(
      "Sparsity of the vector. Default 1000").withShortName("sp").create();
    Option numVectorsOpt = obuilder.withLongName("numVectors").withRequired(false).withArgument(
      abuilder.withName("nv").withMinimum(1).withMaximum(1).create()).withDescription(
      "Number of Vectors to create. Default: 100").withShortName("nv").create();
    Option loopOpt = obuilder.withLongName("loop").withRequired(false).withArgument(
      abuilder.withName("loop").withMinimum(1).withMaximum(1).create()).withDescription(
      "Number of times to loop. Default: 200").withShortName("l").create();
    Option numOpsOpt = obuilder.withLongName("numOps").withRequired(false).withArgument(
      abuilder.withName("numOps").withMinimum(1).withMaximum(1).create()).withDescription(
      "Number of operations to do per timer. "
          + "E.g In distance measure, the distance is calculated numOps times"
          + " and the total time is measured. Default: 10").withShortName("no").create();
   
    Option helpOpt = DefaultOptionCreator.helpOption();
   
    Group group = gbuilder.withName("Options").withOption(vectorSizeOpt).withOption(vectorSparsityOpt)
        .withOption(numVectorsOpt).withOption(loopOpt).withOption(numOpsOpt).withOption(helpOpt).create();
   
    try {
View Full Code Here

  public static void main(String[] args) throws IOException, IllegalAccessException, InstantiationException {
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option seqOpt = obuilder.withLongName("seqFile").withRequired(false).withArgument(
      abuilder.withName("seqFile").withMinimum(1).withMaximum(1).create()).
      withDescription("The Sequence File containing the Clusters").withShortName("s").create();
    Option outputOpt = obuilder.withLongName("output").withRequired(false).withArgument(
      abuilder.withName("output").withMinimum(1).withMaximum(1).create()).
      withDescription("The output file.  If not specified, dumps to the console").withShortName("o").create();
    Option substringOpt = obuilder.withLongName("substring").withRequired(false).withArgument(
      abuilder.withName("substring").withMinimum(1).withMaximum(1).create()).
      withDescription("The number of chars of the asFormatString() to print").withShortName("b").create();
    Option countOpt = obuilder.withLongName("count").withRequired(false).
    withDescription("Report the count only").withShortName("c").create();
    Option helpOpt = obuilder.withLongName("help").
    withDescription("Print out help").withShortName("h").create();
   
    Group group = gbuilder.withName("Options").withOption(seqOpt).withOption(outputOpt)
    .withOption(substringOpt).withOption(countOpt).withOption(helpOpt).create();
   
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.utils.CommandLineParser$Option

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.