Program: 131470
Project: 131470
Buggy source:
public void run() throws IOException {
  log.info("String_Node_Str");
  CnfGrammarReader builder=new CnfGrammarReader();
  builder.loadFromFile(grammar);
  CnfGrammar grammar=builder.getGrammar(loopOrder);
  log.info("String_Node_Str" + grammar.getNumNonTerminals());
  log.info("String_Node_Str" + grammar.getNumLexicalTypes());
  log.info("String_Node_Str" + train);
  Alphabet<Label> lexAlphabet=new Alphabet<Label>();
  Alphabet<Label> ntAlphabet=new Alphabet<Label>();
  NaryTreebank naryTrees=readPtbTrees(lexAlphabet,ntAlphabet);
  log.info("String_Node_Str" + ntAlphabet.size());
  log.info("String_Node_Str" + lexAlphabet.size());
  log.info("String_Node_Str");
  removeNullElements(naryTrees);
  log.info("String_Node_Str");
  removeFunctionTagsAndTraces(naryTrees);
  log.info("String_Node_Str");
  useSignaturesForUnknownWords(naryTrees,grammar);
  if (treeFile != null) {
    log.info("String_Node_Str" + treeFile);
    naryTrees.writeTreesInOneLineFormat(treeFile);
    naryTrees.writeSentencesInOneLineFormat(treeFile + "String_Node_Str");
  }
  naryTrees.resetAlphabets(grammar.getLexAlphabet(),ntAlphabet);
  log.info("String_Node_Str" + naryTrees.size() + "String_Node_Str");
  BinaryTreebank binaryParses=new BinaryTreebank();
  Timer timer=new Timer();
  CkyPcfgParserPrm prm=new CkyPcfgParserPrm();
  prm.loopOrder=loopOrder;
  prm.cellType=cellType;
  prm.cacheChart=true;
  prm.parseType=ParseType.VITERBI;
  CkyPcfgParser parser=new CkyPcfgParser(prm);
  for (  NaryTree tree : naryTrees) {
    Sentence sent=tree.getSentence();
    timer.start();
    Chart chart=parser.parseSentence(sent,grammar);
    timer.stop();
    Pair<BinaryTree,Double> pair=chart.getViterbiParse();
    binaryParses.add(pair.get1());
    log.debug("String_Node_Str" + timer.avgSec());
  }
  binaryParses.resetAlphabets(lexAlphabet,ntAlphabet);
  log.info("String_Node_Str");
  removeRefinements(binaryParses);
  log.info("String_Node_Str");
  NaryTreebank naryParses=binaryParses.collapseToNary(ntAlphabet);
  if (parseFile != null) {
    log.info("String_Node_Str" + parseFile);
    naryParses.writeTreesInOneLineFormat(parseFile);
  }
  if (evalbDir != null) {
    Evalb evalb=new Evalb(evalbDir);
    evalb.runEvalb(treeFile,parseFile,new File("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void run() throws IOException {
  log.info("String_Node_Str");
  CnfGrammarReader builder=new CnfGrammarReader();
  builder.loadFromFile(grammar);
  CnfGrammar grammar=builder.getGrammar(loopOrder);
  log.info("String_Node_Str" + grammar.getNumNonTerminals());
  log.info("String_Node_Str" + grammar.getNumLexicalTypes());
  log.info("String_Node_Str" + train);
  Alphabet<Label> lexAlphabet=new Alphabet<Label>();
  Alphabet<Label> ntAlphabet=new Alphabet<Label>();
  NaryTreebank naryTrees=readPtbTrees(lexAlphabet,ntAlphabet);
  log.info("String_Node_Str" + ntAlphabet.size());
  log.info("String_Node_Str" + lexAlphabet.size());
  log.info("String_Node_Str");
  removeNullElements(naryTrees);
  log.info("String_Node_Str");
  removeFunctionTagsAndTraces(naryTrees);
  log.info("String_Node_Str");
  useSignaturesForUnknownWords(naryTrees,grammar);
  if (treeFile != null) {
    log.info("String_Node_Str" + treeFile);
    naryTrees.writeTreesInOneLineFormat(treeFile);
    naryTrees.writeSentencesInOneLineFormat(treeFile + "String_Node_Str");
  }
  naryTrees.resetAlphabets(grammar.getLexAlphabet(),ntAlphabet);
  log.info("String_Node_Str" + naryTrees.size() + "String_Node_Str");
  BinaryTreebank binaryParses=new BinaryTreebank();
  Timer timer=new Timer();
  CkyPcfgParserPrm prm=new CkyPcfgParserPrm();
  prm.loopOrder=loopOrder;
  prm.cellType=cellType;
  prm.cacheChart=true;
  prm.parseType=ParseType.VITERBI;
  CkyPcfgParser parser=new CkyPcfgParser(prm);
  for (  NaryTree tree : naryTrees) {
    Sentence sent=tree.getSentence();
    timer.start();
    Chart chart=parser.parseSentence(sent,grammar);
    timer.stop();
    Pair<BinaryTree,Double> pair=chart.getViterbiParse();
    BinaryTree parse=pair.get1();
    if (parse == null) {
      log.warn("String_Node_Str" + sent);
    }
    binaryParses.add(parse);
    log.debug("String_Node_Str" + timer.avgSec());
  }
  binaryParses.resetAlphabets(lexAlphabet,ntAlphabet);
  log.info("String_Node_Str");
  removeRefinements(binaryParses);
  log.info("String_Node_Str");
  NaryTreebank naryParses=binaryParses.collapseToNary(ntAlphabet);
  if (parseFile != null) {
    log.info("String_Node_Str" + parseFile);
    naryParses.writeTreesInOneLineFormat(parseFile);
  }
  if (evalbDir != null) {
    Evalb evalb=new Evalb(evalbDir);
    evalb.runEvalb(treeFile,parseFile,new File("String_Node_Str"));
  }
}