code: public static void main(String[] args) throws IOException {
      if (args.length == 0) {
        System.err.println("Usage: PosTaggerME [-td tagdict] model < tokenized_sentences");
        System.err.println("       PosTaggerME -test model \"sentence\"");
        System.exit(1);
      }
      int ai=0;
      boolean test = false;
      String tagdict = null;
      while(ai < args.length && args[ai].startsWith("-")) {
        if (args[ai].equals("-test")) {
          ai++;
          test=true;
        }
        else if (args[ai].equals("-td")) {
          tagdict = args[ai+1];
          ai+=2;
        }
      }
      POSTaggerME tagger;
      String modelFile = args[ai++];
      if (tagdict != null) {
        tagger = new PosTagger(modelFile, new POSDictionary(tagdict));
      }
      else {
        tagger = new PosTagger(modelFile);
      }
      if (test) {
        System.out.println(tagger.tag(args[ai]));
      }
      else {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in,"ISO-8859-1"));
        PrintStream out = new PrintStream(System.out,true,"ISO-8859-1");
        for (String line = in.readLine(); line != null; line = in.readLine()) {
          out.println(tagger.tag(line));
        }
      }
    }
docs: <p>Part-of-speech tag a string passed in on the command line. For
  example:
  
  <p>java opennlp.tools.lang.spanish.PosTagger -test "Sr. Smith da el auto a sus hermano en Lunes."