Package com.martiansoftware.jsap

Examples of com.martiansoftware.jsap.Switch


        registerParameter(sw1);
    }

    public void registerSwitch(String parameterName) throws JSAPException {
        Switch sw1 = new Switch(parameterName)
                        .setLongFlag(parameterName);

        registerParameter(sw1);
    }
View Full Code Here


        .setStringParser(JSAP.STRING_PARSER).setRequired(false)
        .setLongFlag("fileCodes");
    opt3.setHelp("A file containing a mapping between filenames and some key. "
        + "If specified, the query results will list the key instead of the filename.");

    Switch sw0 = new Switch("help").setDefault("false").setLongFlag("help");
    sw0.setHelp("Prints this message.");

    FlaggedOption opt4 = new FlaggedOption("ldaConfig")
        .setStringParser(JSAP.STRING_PARSER).setRequired(false)
        .setList(true).setListSeparator(',')
        .setAllowMultipleDeclarations(true).setLongFlag("ldaConfig");
View Full Code Here

         .setRequired(false)
         .setLongFlag("fileCodes");
     opt2.setHelp("A file containing a mapping between filenames and some key. " +
             "If specified, the query results will list the key instead of the filename.");
    
     Switch sw0 = new Switch("help")
         .setDefault("false")
         .setLongFlag("help");
     sw0.setHelp("Prints this message.");
    
     FlaggedOption opt4 = new FlaggedOption("numK")
     .setStringParser(JSAP.INTEGER_PARSER)
         .setRequired(false)
         .setDefault("50")
View Full Code Here

    .setStringParser(JSAP.INTEGER_PARSER).setRequired(false)
    .setLongFlag("scoringCode").setDefault("1");
    opt4.setHelp("An integer code that specifies the scoring metric that should be used. "
    + "1=Cosine, 2=Overlap.");

    Switch sw0 = new Switch("help").setDefault("false").setLongFlag("help");
    sw0.setHelp("Prints this message.");

    jsap.registerParameter(sw0);
    jsap.registerParameter(opt0);
    jsap.registerParameter(opt1);
    jsap.registerParameter(opt2);
View Full Code Here

    .setStringParser(JSAP.INTEGER_PARSER).setRequired(false)
    .setLongFlag("scoringCode").setDefault("1");
    opt4.setHelp("An integer code that specifies the scoring metric that should be used. "
    + "1=conditional probability.");

    Switch sw0 = new Switch("help").setDefault("false").setLongFlag("help");
    sw0.setHelp("Prints this message.");

    jsap.registerParameter(sw0);
    jsap.registerParameter(opt0);
    jsap.registerParameter(opt0a);
    jsap.registerParameter(opt1);
View Full Code Here

  public static void main(String[] args) throws JSAPException, IOException, ClassNotFoundException {

    final SimpleJSAP jsap = new SimpleJSAP(ClusterSequences.class.getName(),
        "Parses input sequences to do clustering on them. Input sequences should have one sequence per line. "
            + "Each sequence is a tab-separated list of symbols.", new Parameter[] {
            new Switch("verbose", 'v', "verbose", "Set verbose output"),
            new FlaggedOption("taxonomy-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 't', "taxonomy-file",
                "File containing the description of the taxonomy."),
            new FlaggedOption("clusters", JSAP.INTEGER_PARSER, Integer.toString(DEFAULT_CLUSTERS), JSAP.NOT_REQUIRED, 'c', "clusters",
                "Number of clusters to use."),
            new FlaggedOption("passes", JSAP.INTEGER_PARSER, Integer.toString(DEFAULT_PASSES), JSAP.NOT_REQUIRED, 'p', "passes",
                "Number of passes of the algorithm to do."),

            new Switch("init-all-leaves", 'l', "init-all-leaves", "Initial model states are all leaves from taxonomy."),
            new FlaggedOption("init-all-level", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'e', "init-all-level",
                "Initial model states are leaves or internal nodes at level <= x."),
            new FlaggedOption("init-explicit", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'x', "init-explicit",
                "Initial model states are a quote-enclosed, space-separated list, given as input."),
            new FlaggedOption("max-iterations", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'm', "max-iterations",
View Full Code Here

   
    final SimpleJSAP jsap = new SimpleJSAP(
        GenerateSequences.class.getName(),
        "Generates sequences given a HMM.",
        new Parameter[] {
            new Switch("verbose", 'v', "verbose", "Set the verbose output"),
            new FlaggedOption("num-sequences", JSAP.INTEGER_PARSER, Integer.toString(DEFAULT_SEQUENCES), JSAP.NOT_REQUIRED, 'n', "num-sequences",
            "Number of sequences to generate."),
            new FlaggedOption("model-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'm', "model-file",
                "File containing the description of the HMM."),
            new FlaggedOption("taxonomy-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 't', "taxonomy-file",
View Full Code Here

  public static void main(String[] args) throws IOException, JSAPException {

    logger.setLevel(Level.INFO);

    final SimpleJSAP jsap = new SimpleJSAP(ComputeProbabilities.class.getName(), "Computes the probabilities of a set of sequences given a HMM.", new Parameter[] {
        new Switch("verbose", 'v', "verbose", "Set verbose output"),
        new FlaggedOption("model-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'm', "model-file", "File containing the description of the HMM."),
        new FlaggedOption("taxonomy-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 't', "taxonomy-file", "File containing the taxonomy."),
        new FlaggedOption("input-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'i', "input-file", "File containing the input sequences."),
        new FlaggedOption("sequence", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 's', "sequence",
            "Optionally, pass a single sequence as a string. Place it between quotes, with space-separated symbols.") });
View Full Code Here

    final SimpleJSAP jsap = new SimpleJSAP(
        LearnModel.class.getName(),
        "Learns a HMM based on the frequency of the transitions observed. Requires a list of acceptable states where not there can not be an state and one of its descendants in the taxonomy.",
        new Parameter[] {
            new Switch("verbose", 'v', "verbose", "Set verbose output"),
            new FlaggedOption("taxonomy-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 't', "taxonomy-file",
                "File containing the description of the taxonomy."),
            new Switch("init-all-leaves", 'l', "init-all-leaves", "Initial model states are all leaves from taxonomy."),
            new FlaggedOption("init-all-level", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'e', "init-all-level",
                "Initial model states are leaves or internal nodes at level <= x."),
            new FlaggedOption("init-explicit", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'x', "init-explicit",
                "Initial model states are a quote-enclosed, space-separated list, given as input."),
            new FlaggedOption("input-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'i', "input-file", "File containing the input sequences."),
View Full Code Here

TOP

Related Classes of com.martiansoftware.jsap.Switch

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.