public static void main(String[] args) throws Exception {
    if (args.length != 3 && args.length !=4) {
      System.err.println("usage: java edu.berkeley.nlp.classical.ChartParser [-verbose] lexiconFileName grammarFileName \"sentence to parse\"");
      System.exit(0);
    }
    if (args[0].equalsIgnoreCase("-verbose") || args[0].equalsIgnoreCase("-v"))
      verbose = true;
    String lexiconFileName = args[args.length-3];
    String grammarFileName = args[args.length-2];
    String sentenceString = args[args.length-1];
    Lexicon lexicon = new Lexicon(new BufferedReader(new FileReader(lexiconFileName)));
    Grammar grammar = new Grammar(new BufferedReader(new FileReader(grammarFileName)));
    List<String> sentence = Arrays.asList(sentenceString.split("\\s+"));
    ChartParser parser = new ChartParser(lexicon, grammar);
    parser.parse(sentence);
    List<Tree<String>> parses = parser.getParses();
    for (int parseNum = 0; parseNum < parses.size(); parseNum++) {
      Tree<String> parse = (Tree<String>) parses.get(parseNum);
      parse = cleanTree(parse);
      System.out.println("PARSE "+(parseNum+1));
      System.out.print(Trees.PennTreeRenderer.render(parse));
    }
  }