private static List<TaggedSentence> readTaggedSentences(String path, boolean hasTags) throws Exception {
    List<TaggedSentence> taggedSentences = new ArrayList<TaggedSentence>();
    BufferedReader reader = new BufferedReader(new FileReader(path));
	String line = "";
    List<String> words = new LinkedList<String>();
    List<String> tags = new LinkedList<String>();
    while ((line = reader.readLine()) != null) {
      if (line.equals("")) {
        taggedSentences.add(
        		new TaggedSentence(
        					new BoundedList<String>(words, START_WORD, STOP_WORD), 
        					new BoundedList<String>(tags, START_WORD, STOP_WORD)));
        words = new LinkedList<String>();
	    tags = new LinkedList<String>();
      } else {
    	String[] fields = line.split("\\s+");
    	words.add(fields[0]);
    	tags.add(hasTags ? fields[1] : "");
      }
    }
	System.out.println("Read " + taggedSentences.size() + " sentences.");
    return taggedSentences;
  }