private static void labelTestSet(String path, String filename, Parser parser, boolean verbose) throws Exception {
    BufferedReader reader = new BufferedReader(new FileReader(path + filename));
		BufferedWriter writer = new BufferedWriter(new FileWriter(path + filename +"_output.txt"));
		String line = "";
		int notPossibleParse = 0;
		long startTime = 0, endTime = 0;
    while ((line = reader.readLine()) != null) {
      List<String> testSentence = Arrays.asList(line.split(" "));
      startTime = System.currentTimeMillis();
      Tree<String> guessedTree = parser.getBestParse(testSentence);
      endTime = System.currentTimeMillis();
      if (guessedTree.isLeaf()){
      	notPossibleParse++;
      }
      writer.write(guessedTree.toString() + "\n"); 
      writer.flush();
      if (verbose) {
        System.out.println("Guess:\n" + Trees.PennTreeRenderer.render(guessedTree));
      }
      	System.out.println("size: " + testSentence.size() + "  time elapsed: " + (endTime-startTime)/1000);
    }
    System.out.println("not possbile to be parsed out: " + notPossibleParse);
    writer.close();
  }