All Downloads are FREE. Search and download functionalities are using the official Maven repository.

is2.mtag.Options Maven / Gradle / Ivy

The newest version!
package is2.mtag;

import is2.util.OptionsSuper;

public final class Options extends OptionsSuper {

	
	public Options (String[] args)  {
		
		for(int i = 0; i < args.length; i++) {

			if (args[i].equals("--help")) explain();
			
			if (args[i].equals("-nonormalize")) {
				normalize=false;
			} else if (args[i].equals("-features")) {
				features= args[i+1]; i++;			
			} else if (args[i].equals("-hsize")) {
				hsize= Integer.parseInt(args[i+1]); i++;			
			} else if (args[i].equals("-len")) {
				maxLen= Integer.parseInt(args[i+1]); i++;			
			} else super.addOption(args, i);					
		}
	}

	private void explain() {
		System.out.println("Usage: ");
		System.out.println("java -cp anna.jar is2.mtag.Tagger [Options]");
		System.out.println();
		System.out.println("Example: ");
		System.out.println(" java -cp mate.jar is2.mtag.Tagger -model eps3.model -train corpora/conll08st/train/train.closed -test corpora/conll08st/devel/devel.closed  -out b3.test -eval corpora/conll08st/devel/devel.closed  -count 2000 -i 6");
		System.out.println("");
		System.out.println("Options:");
		System.out.println("");
		System.out.println(" -train      the corpus a model is trained on; default "+this.trainfile);
		System.out.println(" -test       the input corpus for testing; default "+this.testfile);
		System.out.println(" -out        the output corpus (result) of a test run; default "+this.outfile);
		System.out.println(" -model      the parsing model for traing the model is stored in the files");
		System.out.println("                   and for parsing the model is load from this file; default "+this.modelName);
		System.out.println(" -i        the number of training iterations; good numbers are 10 for smaller corpora and 6 for bigger; default "+this.numIters);
		System.out.println(" -count    the n first sentences of the corpus are take for the training default "+this.count);
		
		System.exit(0);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy