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 inputDirOpt = DefaultOptionCreator.inputOption().create();
Option outputOpt = DefaultOptionCreator.outputOption().create();
Option gramSizeOpt = obuilder.withLongName("gramSize").withRequired(false).withArgument(
abuilder.withName("gramSize").withMinimum(1).withMaximum(1).create()).withDescription(
"Size of the n-gram. Default Value: 1 ").withShortName("ng").create();
Option minDfOpt = obuilder.withLongName("minDf").withRequired(false).withArgument(
abuilder.withName("minDf").withMinimum(1).withMaximum(1).create()).withDescription(
"Minimum Term Document Frequency: 1 ").withShortName("mf").create();
Option minSupportOpt = obuilder.withLongName("minSupport").withRequired(false).withArgument(
abuilder.withName("minSupport").withMinimum(1).withMaximum(1).create()).withDescription(
"Minimum Support (Term Frequency): 1 ").withShortName("ms").create();
Option alphaOpt = obuilder.withLongName("alpha").withRequired(false).withArgument(
abuilder.withName("a").withMinimum(1).withMaximum(1).create()).withDescription(
"Smoothing parameter Default Value: 1.0").withShortName("a").create();
Option typeOpt = obuilder.withLongName("classifierType").withRequired(false).withArgument(
abuilder.withName("classifierType").withMinimum(1).withMaximum(1).create()).withDescription(
"Type of classifier: bayes|cbayes. Default: bayes").withShortName("type").create();
Option dataSourceOpt = obuilder.withLongName("dataSource").withRequired(false).withArgument(
abuilder.withName("dataSource").withMinimum(1).withMaximum(1).create()).withDescription(
"Location of model: hdfs. Default Value: hdfs").withShortName("source").create();
Option skipCleanupOpt = obuilder.withLongName("skipCleanup").withRequired(false).withDescription(
"Skip cleanup of feature extraction output").withShortName("sc").create();
Group group = gbuilder.withName("Options").withOption(gramSizeOpt).withOption(helpOpt).withOption(
inputDirOpt).withOption(outputOpt).withOption(typeOpt).withOption(dataSourceOpt).withOption(alphaOpt)
.withOption(minDfOpt).withOption(minSupportOpt).withOption(skipCleanupOpt).create();