docs: public static void main(String[] args) throws Exception {
  		
  		for (int i=0; i<args.length; i++) {
  			if (args[i].equalsIgnoreCase("-tab")) {  // one response line per each query line, tab-separated
  				outputType = outputTypes.TAB;
  				token_separator = "\t";
  			}
  			if (args[i].equalsIgnoreCase("-vert")) { // one response line per token, tab-separated
  				outputType = outputTypes.VERT;
  			}
  			if (args[i].equalsIgnoreCase("-moses")) { // one response line per token, pipe-separated
  				field_separator = "|";
  				token_separator = " ";
  				outputType = outputTypes.MOSES;
  			}
  			if (args[i].equalsIgnoreCase("-stripped")) mini_tag = true; //remove nonlexical attributes
  			if (args[i].equalsIgnoreCase("-features")) features = true; //output training features
  			if (args[i].equalsIgnoreCase("-leta")) LETAfeatures = true; //output specific features for LETA semantic frame analysis
  			if (args[i].equalsIgnoreCase("-vertinput")) inputType = inputTypes.VERT; //vertical input format as requested by Milos Jakubicek 2012.11.01
  			if (args[i].equalsIgnoreCase("-paragraphs")) {
  				inputType = inputTypes.PARAGRAPH;
  				if (i+1 < args.length && !args[i+1].startsWith("-")) {
  					try {
  						sentencelengthcap = Integer.parseInt(args[i+1]);
  						System.err.printf("Sentence length capped to %d\n", sentencelengthcap);
  						i++;
  					} catch (Exception e) {
  						System.err.printf("Error when parsing command line param '%s %s'\n",args[i], args[i+1]);
  						System.err.println(e.getMessage());
  					}
  				}
  			}
  			if (args[i].equalsIgnoreCase("-conll-in")) inputType = inputTypes.CONLL; 
  			if (args[i].equalsIgnoreCase("-json-in")) inputType = inputTypes.JSON; 
  			if (args[i].equalsIgnoreCase("-conll-x")) outputType = outputTypes.CONLL_X;
  			if (args[i].equalsIgnoreCase("-xml")) outputType = outputTypes.XML;
  			if (args[i].equalsIgnoreCase("-visl-cg")) outputType = outputTypes.VISL_CG;
  			if (args[i].equalsIgnoreCase("-lemmatized-text")) outputType = outputTypes.lemmatizedText;
              if (args[i].equalsIgnoreCase("-lowercased-text")) outputType = outputTypes.lowercasedText;
              if (args[i].equalsIgnoreCase("-analyzer")) {
                  outputType = outputTypes.analyzerOptions;
                  token_separator = "\t";
              }
  			if (args[i].equalsIgnoreCase("-saveColumns")) saveColumns = true; //save extra columns from conll input
  			if (args[i].equalsIgnoreCase("-unix-line-endings")) eol="\n";
  			if (args[i].equalsIgnoreCase("-keep-tags")) keepTags = true;
  			if (args[i].equalsIgnoreCase("-output-separators")) outputSeparators = true;
              if (args[i].equalsIgnoreCase("-whitespace-marker")) whitespaceMarker = true;
              if (args[i].equalsIgnoreCase("-allow-empty-lines")) stopOnEmpty = false;
  						
  			if (args[i].equalsIgnoreCase("-h") || args[i].equalsIgnoreCase("--help") || args[i].equalsIgnoreCase("-?")) {
  				System.out.println("LV morphological tagger");
  				System.out.println("\nInput formats");
  				System.out.println("\tDefault : plain text UTF-8, one sentence per line, terminated by a blank line.");
  				System.out.println("\t-paragraphs [lengthcap]: plain text UTF-8, each line will be split in sentences. In output, paragraph borders are noted by an extra blank line. If lengthcap parameter is provided, then sentence length will be limited to that, instead of the default of " + sentencelengthcap);
  				System.out.println("\t-vertinput : one line per token, sentences separated by <s></s>. Any XML-style tags are echoed as-is. \n\t\tNB! sentences are retokenized, the number of tokens may be different.");
  				System.out.println("\t-conll-in : CONLL shared task data format - one line per token, with tab-delimited columns, sentences separated by blank lines.");
  				System.out.println("\t-json-in : one line per sentence, each line contains a single json array of strings-tokens.");
  				System.out.println("\nOutput formats");
  				System.out.println("\tDefault : JSON. Each sentence is returned as a list of dicts, each dict contains elements 'Word', 'Tag' and 'Lemma'.");
  				System.out.println("\t-tab : one response line for each query line; tab-separated lists of word, tag and lemma.");
  				System.out.println("\t-vert : one response line for each token; tab-separated lists of word, tag and lemma.");
  				System.out.println("\t-moses : one response line for each token; pipe-separated lists of word, tag and lemma.");
  				System.out.println("\t-conll-x : CONLL-X shared task data format - one line per token, with tab-delimited columns, sentences separated by blank lines.");
  				System.out.println("\t-xml : one xml word per line");
  				System.out.println("\t-visl-cg : output format for VISL constraint grammar tool");
  				System.out.println("\t-lemmatized-text : output lowercase lemmatized text, each sentence in new row, tokens seperated by single space");
  				System.out.println("\t-lowercased-text : output lowercased text, each sentence in new row, tokens seperated by single space");
                  System.out.println("\t-analyzer : one response line for each token; word followed by a tab-separated list of undisambiguated morphological tag options");
  				System.out.println("\nOther options:");
  				System.out.println("\t-stripped : lexical/nonessential parts of the tag are replaced with '-' to reduce sparsity.");
  				System.out.println("\t-features : in conll output, include the features that were used for training/tagging.");
  				System.out.println("\t-leta : in conll output, include extra features used for semantic frame analysis.");
  				System.out.println("\t-saveColumns : save extra columns from conll input.");
  				System.out.println("\t-unix-line-endings : use \\n line endings for output even on windows systems");
  				System.out.println("\t-keep-tags : preserve lines that start with '<' to enable xml-style metadata");
  				System.out.println("\t-output-separators : put <s></s> sentence markup and <p></p> paragraph markup");
  				System.out.println("\t-whitespace-marker : put <g /> tags where the tokens did not have whitespace between them");
                  System.out.println("\t-allow-empty-lines : do not quit on blank lines input (as per default)");
  				System.out.flush();
  				System.exit(0);
  			}
  		}
  						
  		CMMClassifier<CoreLabel> morphoClassifier = CMMClassifier.getClassifier(morphoClassifierLocation);
  			
  		PrintStream out = new PrintStream(System.out, true, "UTF8");
  		BufferedReader in = new BufferedReader(new InputStreamReader(System.in, "UTF8"));
  		
  		switch(inputType) {
  		case CONLL:
  			for (List<CoreLabel> sentence : readCONLL(in)) {
  		    	outputSentence(morphoClassifier, out, sentence);
  			}
  			break;
  		default:
  		    String s;
  		    String sentence = "";
  		    while ((s = in.readLine()) != null && (s.length() != 0 || !stopOnEmpty)) {
  		    	if (s.startsWith("<") && s.length()>1 && keepTags) {
  		    		if (outputType != outputTypes.lemmatizedText && outputType != outputTypes.lowercasedText) out.println(s);
  		    		continue;
  		    	}
                  if (s.length() == 0) continue;
  		    	boolean finished = true; // is sentence finished and ready to analyze
  		    	if (inputType != inputTypes.VERT) {		    		
  		    		sentence = s;
  		    	} else {
  		    		if (s.startsWith("<") && s.length()>1) out.println(s);
  		    		else sentence = sentence + " " + s;
  		    		finished = s.startsWith("</s>");
  		    	}	    	
  		    	if (finished) {
  		    		processSentences(morphoClassifier, out, sentence.trim());
  			    	sentence = "";
  		    	}
  		    }
  	    	if (inputType != inputTypes.VERT && sentence.length()>0) { //FIXME, not DRY
  	    		processSentences(morphoClassifier, out, sentence.trim());
  	    	}	    			
  		}
  		in.close();
  		out.close();
  	}