Examples of ArgumentBuilder


Examples of org.apache.commons.cli2.builder.ArgumentBuilder

  /**
   * Returns a default command line option for input directory specification.
   */
  public static DefaultOptionBuilder inputOption() {
    return new DefaultOptionBuilder().withLongName("input").withRequired(true).withShortName("i")
        .withArgument(new ArgumentBuilder().withName("input").withMinimum(1).withMaximum(1).create())
        .withDescription("Path to job input directory");
  }
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

   */
  public static DefaultOptionBuilder kOption() {
    return new DefaultOptionBuilder()
        .withLongName("k")
        .withRequired(true)
        .withArgument(new ArgumentBuilder().withName("k").withMinimum(1).withMaximum(1).create())
        .withDescription(
          "The k in k-Means. k random Vectors will be chosen as the Centroid and written to the clusters output path.")
        .withShortName("k");
  }
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

  /**
   * Returns a default command line option for specification of max number of iterations.
   */
  public static DefaultOptionBuilder maxIterOption() {
    return new DefaultOptionBuilder().withLongName("maxIter").withRequired(true).withShortName("x")
        .withArgument(new ArgumentBuilder().withName("maxIter").withMinimum(1).withMaximum(1).create())
        .withDescription("The maximum number of iterations.");
  }
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

  /**
   * Returns a default command line option for specification of distance measure class to use.
   */
  public static DefaultOptionBuilder distanceOption() {
    return new DefaultOptionBuilder().withLongName("measure").withRequired(true).withShortName("d")
        .withArgument(new ArgumentBuilder().withName("measure").withMinimum(1).withMaximum(1).create())
        .withDescription("The classname of the DistanceMeasure.");
  }
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

 
  @Override
  public int run(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
   
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    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("path").withMinimum(1).create()).withDescription("dataset path").create();
   
    Option helpOpt = obuilder.withLongName("help").withDescription("Print out help").withShortName("h")
        .create();
   
    Group group = gbuilder.withName("Options").withOption(dataOpt).withOption(datasetOpt).withOption(helpOpt)
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

  public static void main(String[] args) throws ClassNotFoundException,
                                        IllegalAccessException,
                                        InstantiationException,
                                        IOException {
    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 Input file")
        .withShortName("i").create();
   
    Option outputOpt = obuilder.withLongName("output").withRequired(true).withArgument(
      abuilder.withName("output").withMinimum(1).withMaximum(1).create()).withDescription("The output file")
        .withShortName("o").create();
   
    Option labelOpt = obuilder.withLongName("label").withRequired(true).withArgument(
      abuilder.withName("label").withMinimum(1).withMaximum(1).create()).withDescription("The label of the file")
        .withShortName("l").create();
   
    Option analyzerOpt = obuilder.withLongName("analyzer").withArgument(
      abuilder.withName("analyzer").withMinimum(1).withMaximum(1).create()).withDescription(
      "The fully qualified class name of the analyzer to use. "
          + "Must have a no-arg constructor.  Default is the StandardAnalyzer").withShortName("a").create();
   
    Option charsetOpt = obuilder.withLongName("charset").withArgument(
      abuilder.withName("charset").withMinimum(1).withMaximum(1).create()).withDescription(
      "The character encoding of the input file").withShortName("c").create();
   
    Option collapseOpt = obuilder.withLongName("collapse").withRequired(true).withArgument(
      abuilder.withName("collapse").withMinimum(1).withMaximum(1).create()).withDescription(
      "Collapse a whole directory to a single file, one doc per line").withShortName("p").create();
   
    Option helpOpt = obuilder.withLongName("help").withRequired(true).withDescription("Print out help").withShortName(
      "h").create();
    Group group = gbuilder.withName("Options").withOption(inputOpt).withOption(outputOpt).withOption(labelOpt)
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

  private Describe() { }
 
  public static void main(String[] args) throws IOException, DescriptorException {
   
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option pathOpt = obuilder.withLongName("path").withShortName("p").withRequired(true).withArgument(
      abuilder.withName("path").withMinimum(1).withMaximum(1).create()).withDescription("Data path").create();
   
    Option descriptorOpt = obuilder.withLongName("descriptor").withShortName("d").withRequired(true)
        .withArgument(abuilder.withName("descriptor").withMinimum(1).create()).withDescription(
          "data descriptor").create();
   
    Option descPathOpt = obuilder.withLongName("file").withShortName("f").withRequired(true).withArgument(
      abuilder.withName("file").withMinimum(1).withMaximum(1).create()).withDescription(
      "Path to generated descriptor file").create();
   
    Option helpOpt = obuilder.withLongName("help").withDescription("Print out help").withShortName("h")
        .create();
   
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

  /**
   * Run TopK FPGrowth given the input file,
   */
  public static void main(String[] args) throws Exception {
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option inputDirOpt = obuilder.withLongName("input").withRequired(true).withArgument(
      abuilder.withName("input").withMinimum(1).withMaximum(1).create()).withDescription(
      "The Directory on HDFS containing the transaction files").withShortName("i").create();
   
    Option outputOpt = DefaultOptionCreator.outputOption().create();
   
    Option helpOpt = DefaultOptionCreator.helpOption();
   
    // minSupport(3), maxHeapSize(50), numGroups(1000)
    Option minSupportOpt = obuilder.withLongName("minSupport").withArgument(
      abuilder.withName("minSupport").withMinimum(1).withMaximum(1).create()).withDescription(
      "(Optional) Minimum Support. Default Value: 3").withShortName("s").create();
   
    Option maxHeapSizeOpt = obuilder.withLongName("maxHeapSize").withArgument(
      abuilder.withName("maxHeapSize").withMinimum(1).withMaximum(1).create()).withDescription(
      "(Optional) Maximum Heap Size k, to denote the requirement to mine top K items. Default value: 50")
        .withShortName("k").create();
   
    Option numGroupsOpt = obuilder.withLongName("numGroups").withArgument(
      abuilder.withName("numGroups").withMinimum(1).withMaximum(1).create()).withDescription(
      "(Optional) Number of groups the features should be divided in the map-reduce version."
          + " Doesn't work in sequential version Default Value:1000").withShortName("g").create();
   
    Option recordSplitterOpt = obuilder.withLongName("splitterPattern").withArgument(
      abuilder.withName("splitterPattern").withMinimum(1).withMaximum(1).create()).withDescription(
      "Regular Expression pattern used to split given string transaction into itemsets."
          + " Default value splits comma separated itemsets.  Default Value:"
          + " \"[ ,\\t]*[,|\\t][ ,\\t]*\" ").withShortName("regex").create();
   
    Option treeCacheOpt = obuilder.withLongName("numTreeCacheEntries").withArgument(
      abuilder.withName("numTreeCacheEntries").withMinimum(1).withMaximum(1).create()).withDescription(
      "(Optional) Number of entries in the tree cache to prevent duplicate tree building. "
          + "(Warning) a first level conditional FP-Tree might consume a lot of memory, "
          + "so keep this value small, but big enough to prevent duplicate tree building. "
          + "Default Value:5 Recommended Values: [5-10]").withShortName("tc").create();
   
    Option methodOpt = obuilder.withLongName("method").withRequired(true).withArgument(
      abuilder.withName("method").withMinimum(1).withMaximum(1).create()).withDescription(
      "Method of processing: sequential|mapreduce").withShortName("method").create();
    Option encodingOpt = obuilder.withLongName("encoding").withArgument(
      abuilder.withName("encoding").withMinimum(1).withMaximum(1).create()).withDescription(
      "(Optional) The file encoding.  Default value: UTF-8").withShortName("e").create();
   
    Group group = gbuilder.withName("Options").withOption(minSupportOpt).withOption(inputDirOpt).withOption(
      outputOpt).withOption(maxHeapSizeOpt).withOption(numGroupsOpt).withOption(methodOpt).withOption(
      encodingOpt).withOption(helpOpt).withOption(treeCacheOpt).withOption(recordSplitterOpt).create();
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

   *
   */
  public static void main(String[] args) throws IOException {
   
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option dataOpt = obuilder.withLongName("data").withShortName("d").withRequired(true).withArgument(
      abuilder.withName("data").withMinimum(1).withMaximum(1).create()).withDescription("Data path").create();
   
    Option datasetOpt = obuilder.withLongName("dataset").withShortName("ds").withRequired(true).withArgument(
      abuilder.withName("dataset").withMinimum(1).create()).withDescription("Dataset path").create();
   
    Option outputOpt = obuilder.withLongName("output").withShortName("o").withRequired(true).withArgument(
      abuilder.withName("output").withMinimum(1).withMaximum(1).create()).withDescription(
      "Path to generated files").create();
   
    Option partitionsOpt = obuilder.withLongName("numpartitions").withShortName("p").withRequired(true)
        .withArgument(abuilder.withName("numparts").withMinimum(1).withMinimum(1).create()).withDescription(
          "Number of partitions to create").create();
    Option helpOpt = obuilder.withLongName("help").withDescription("Print out help").withShortName("h")
        .create();
   
    Group group = gbuilder.withName("Options").withOption(dataOpt).withOption(outputOpt).withOption(
View Full Code Here

Examples of org.apache.commons.cli2.builder.ArgumentBuilder

  private Classify() { }
 
  public static void main(String[] args) throws Exception {
   
    DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
    ArgumentBuilder abuilder = new ArgumentBuilder();
    GroupBuilder gbuilder = new GroupBuilder();
   
    Option pathOpt = obuilder.withLongName("path").withRequired(true).withArgument(
      abuilder.withName("path").withMinimum(1).withMaximum(1).create()).withDescription(
      "The local file system path").withShortName("m").create();
   
    Option classifyOpt = obuilder.withLongName("classify").withRequired(true).withArgument(
      abuilder.withName("classify").withMinimum(1).withMaximum(1).create()).withDescription(
      "The doc to classify").withShortName("").create();
   
    Option encodingOpt = obuilder.withLongName("encoding").withRequired(true).withArgument(
      abuilder.withName("encoding").withMinimum(1).withMaximum(1).create()).withDescription(
      "The file encoding.  Default: UTF-8").withShortName("e").create();
   
    Option analyzerOpt = obuilder.withLongName("analyzer").withRequired(true).withArgument(
      abuilder.withName("analyzer").withMinimum(1).withMaximum(1).create()).withDescription(
      "The Analyzer to use").withShortName("a").create();
   
    Option defaultCatOpt = obuilder.withLongName("defaultCat").withRequired(true).withArgument(
      abuilder.withName("defaultCat").withMinimum(1).withMaximum(1).create()).withDescription(
      "The default category").withShortName("d").create();
   
    Option gramSizeOpt = obuilder.withLongName("gramSize").withRequired(true).withArgument(
      abuilder.withName("gramSize").withMinimum(1).withMaximum(1).create()).withDescription(
      "Size of the n-gram").withShortName("ng").create();
   
    Option typeOpt = obuilder.withLongName("classifierType").withRequired(true).withArgument(
      abuilder.withName("classifierType").withMinimum(1).withMaximum(1).create()).withDescription(
      "Type of classifier").withShortName("type").create();
   
    Option dataSourceOpt = obuilder.withLongName("dataSource").withRequired(true).withArgument(
      abuilder.withName("dataSource").withMinimum(1).withMaximum(1).create()).withDescription(
      "Location of model: hdfs|hbase").withShortName("source").create();
   
    Group options = gbuilder.withName("Options").withOption(pathOpt).withOption(classifyOpt).withOption(
      encodingOpt).withOption(analyzerOpt).withOption(defaultCatOpt).withOption(gramSizeOpt).withOption(
      typeOpt).withOption(dataSourceOpt).create();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.