/** * Adds an Option for a flag to the list of options. * * @param options the options to extend * @param text the description * @param flag the flag (no dash) */ public static void addFlag(Vector options, String text, String flag) { options.add(new Option("\t" + text, flag, 0, "-" + flag)); }
/** * prints all the options to stdout */ protected static void printOptions(OptionHandler o) { Enumeration<Option> enm = o.listOptions(); System.out.println("Options for " + o.getClass().getName() + ":\n"); while (enm.hasMoreElements()) { Option option = enm.nextElement(); System.out.println(option.synopsis()); System.out.println(option.description()); } }
/** * Removes an option from a given list of options. * * @param list the list to reduce * @param name the name of the option */ public static void deleteOption(List<Option> list, String name) { for (Iterator<Option> iter = list.listIterator(); iter.hasNext();) { Option a = iter.next(); if (a.name().equals(name)) { iter.remove(); } } }
new Option( "\tSet type of SVM (default: 0)\n" + "\t\t 0 = C-SVC\n" new Option( "\tSet type of kernel function (default: 2)\n" + "\t\t 0 = linear: u'*v\n" new Option( "\tSet degree in kernel function (default: 3)", "D", 1, "-D <int>")); new Option( "\tSet gamma in kernel function (default: 1/k)", "G", 1, "-G <double>")); new Option( "\tSet coef0 in kernel function (default: 0)", "R", 1, "-R <double>")); new Option( "\tSet the parameter C of C-SVC, epsilon-SVR, and nu-SVR\n" + "\t (default: 1)", new Option( "\tSet the parameter nu of nu-SVC, one-class SVM, and nu-SVR\n" + "\t (default: 0.5)", new Option(
public static void printOptions(Enumeration e) { // Evaluation Options StringBuffer text = new StringBuffer(); text.append("\n\nEvaluation Options:\n\n"); text.append("-t\n"); text.append("\tSpecify the dataset (required)\n"); text.append("-B <number of windows>\n"); text.append("\tSets the number of windows (batches) for evalutation; default: 20.\n"); text.append("-semisupervised <ratio labelled>\n"); text.append("\tSets the ratio of labelled instances; default: 1.0.\n"); // Multilabel Options text.append("\n\nClassifier Options:\n\n"); while (e.hasMoreElements()) { Option o = (Option) (e.nextElement()); text.append("-"+o.name()+'\n'); text.append(""+o.description()+'\n'); } System.out.println(text); }
/** * returns all the options in a string * * @param generator the DataGenerator to return all the options for * @return the assembled option string */ protected static String makeOptionString(DataGenerator generator) { StringBuffer result; Enumeration<Option> enm; Option option; result = new StringBuffer(); result.append("\nData Generator options:\n\n"); enm = generator.listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); // skip option if on blacklist if (isOnBlacklist(option.name())) { continue; } result.append(option.synopsis() + "\n" + option.description() + "\n"); } return result.toString(); }
/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ @Override public String[] getOptions() { return Option.getOptions(this, this.getClass()); }
while (enm.hasMoreElements()) { option = enm.nextElement(); if (isOnBlacklist(option.name())) { pool.put(option.name(), option); option = pool.get(enm2.nextElement()); try { if (option.numArguments() == 0) { Utils.getFlag(option.name(), options); } else { Utils.getOption(option.name(), options);
while (e.hasMoreElements()) { Option o = (Option) (e.nextElement()); text.append("-"+o.name()+'\n'); text.append(""+o.description()+'\n');
/** * returns all the options in a string * * @param generator the DataGenerator to return all the options for * @return the assembled option string */ protected static String makeOptionString(DataGenerator generator) { StringBuffer result; Enumeration<Option> enm; Option option; result = new StringBuffer(); result.append("\nData Generator options:\n\n"); enm = generator.listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); // skip option if on blacklist if (isOnBlacklist(option.name())) { continue; } result.append(option.synopsis() + "\n" + option.description() + "\n"); } return result.toString(); }
/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ @Override public String[] getOptions() { return Option.getOptions(this, this.getClass()); }
while (enm.hasMoreElements()) { option = enm.nextElement(); if (isOnBlacklist(option.name())) { pool.put(option.name(), option); option = pool.get(enm2.nextElement()); try { if (option.numArguments() == 0) { Utils.getFlag(option.name(), options); } else { Utils.getOption(option.name(), options);
/** * Adds an Option for a flag to the list of options. * * @param options the options to extend * @param text the description * @param flag the flag (no dash) */ public static void addFlag(Vector options, String text, String flag) { options.add(new Option("\t" + text, flag, 0, "-" + flag)); }
/** * prints all the options to stdout */ protected static void printOptions(OptionHandler o) { Enumeration<Option> enm = o.listOptions(); System.out.println("Options for " + o.getClass().getName() + ":\n"); while (enm.hasMoreElements()) { Option option = enm.nextElement(); System.out.println(option.synopsis()); System.out.println(option.description()); } }
while (e.hasMoreElements()) { Option o = (Option) (e.nextElement()); text.append("-"+o.name()+'\n'); text.append(""+o.description()+'\n');
/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ @Override public String[] getOptions() { return Option.getOptions(this, this.getClass()); }
/** * Removes an option from a given list of options. * * @param list the list to reduce * @param name the name of the option */ public static void deleteOption(List<Option> list, String name) { for (Iterator<Option> iter = list.listIterator(); iter.hasNext();) { Option a = iter.next(); if (a.name().equals(name)) { iter.remove(); } } }
/** * Adds an Option for a flag to the list of options. * * @param options the options to extend * @param text the description * @param option the option (no dash) */ public static void addOption(Vector options, String text, String defValue, String option) { options.add(new Option("\t" + text + "\n\t(default: " + defValue + ")", option, 0, "-" + option + " <value>")); }
/** * generates a string to print as help on the console * * @return the generated help */ public String generateHelp() { String result; Enumeration<Option> enm; Option option; result = getClass().getName().replaceAll(".*\\.", "") + " Options:\n\n"; enm = listOptions(); while (enm.hasMoreElements()) { option = enm.nextElement(); result += option.synopsis() + "\n" + option.description() + "\n"; } return result; }
while (e.hasMoreElements()) { Option o = (Option) (e.nextElement()); text.append("-"+o.name()+'\n'); text.append(""+o.description()+'\n');