public static void main(String[] args) throws Exception {
    String input = Utils.getOption('i', args);
    String output = Utils.getOption('o', args);
    boolean print = Utils.getFlag('p', args);

    // words to process?
    Vector words = new Vector();
    for (int i = 0; i < args.length; i++) {
      if (args[i].trim().length() > 0)
        words.add(args[i].trim());
    }
    
    Stopwords stopwords = new Stopwords();

    // load from file?
    if (input.length() != 0)
      stopwords.read(input);

    // write to file?
    if (output.length() != 0)
      stopwords.write(output);
    
    // output to stdout?
    if (print) {
      System.out.println("\nStopwords:");
      Enumeration enm = stopwords.elements();
      int i = 0;
      while (enm.hasMoreElements()) {
        System.out.println((i+1) + ". " + enm.nextElement());
        i++;
      }
    }

    // check words for being a stopword
    if (words.size() > 0) {
      System.out.println("\nChecking for stopwords:");
      for (int i = 0; i < words.size(); i++) {
        System.out.println(
            (i+1) + ". " + words.get(i) + ": " 
            + stopwords.is(words.get(i).toString()));
      }
    }
  }