public static void main(String[] args) {
		//
		Options options = new Options();
		// create boolean options
		Option underscoreOpt = new Option("u", "Use underscore character for separating syllables of words");
		options.addOption(underscoreOpt);
		//
		Option plainTextFormatOpt = new Option("p", "Use plain text format for saving tagging results.");
		options.addOption(plainTextFormatOpt);

		// create obligatory input/output options
		Option inpOpt = new Option("i", true, "Input filename");
		options.addOption(inpOpt);

		Option outOpt = new Option("o", true, "Output filename");
		options.addOption(outOpt);

		// create a test option
		Option testOpt = new Option("t", true, "Test filename");
		options.addOption(testOpt);

		// a help formatter
		HelpFormatter formatter = new HelpFormatter();
		;

		if (args.length < 1) {
			// automatically generate the help statement
			formatter.printHelp("VietnameseMaxentTagger", options);
			System.exit(1);
		}

		CommandLineParser commandLineParser = new PosixParser();
		try {
			CommandLine commandLine = commandLineParser.parse(options, args);

			String testFile = commandLine.getOptionValue("t");
			if (testFile == null) {
				// we are in tag mode
				if (commandLine.hasOption("u")) {
					TaggerOptions.UNDERSCORE = true;
				}

				if (commandLine.hasOption("p")) {
					TaggerOptions.PLAIN_TEXT_FORMAT = true;
				}

				String inputFile = commandLine.getOptionValue("i");
				if (inputFile == null) {
					System.err.println("Input filename is required.");
					formatter.printHelp("VietnameseMaxentTagger", options);
					System.exit(1);
				}
				String outputFile = commandLine.getOptionValue("o");
				if (outputFile == null) {
					System.err.println("Output filename is required.");
					formatter.printHelp("VietnameseMaxentTagger", options);
					System.exit(1);
				}
				// create and run the tagger
				VietnameseMaxentTagger tagger = new VietnameseMaxentTagger();
				System.out.println("Tagging the file. Please wait...");
				tagger.tagFile(inputFile, outputFile);
			} else {
				// we are in test mode
				// create and run the tagger
				VietnameseMaxentTagger tagger = new VietnameseMaxentTagger();
				System.out.println("Testing the file. Please wait...");
				tagger.testFile(testFile);
			}
			System.err.println("Done.");
		} catch (ParseException exp) {
			System.err.println("Parsing failed.  Reason: " + exp.getMessage());
		}

	}