private static List<String[]> readSentence(BufferedReader aReader) throws IOException {
  List<String[]> words=new ArrayList<String[]>();
  String line;
  while ((line=aReader.readLine()) != null) {
    if (StringUtils.isBlank(line)) {
      break;
    }
    if (line.startsWith("#")) {
      continue;
    }
    String[] fields=line.split("\t");
    if (fields.length != 4) {
      throw new IOException("Invalid file format. Line needs to have 4 tab-separted fields.");
    }
    words.add(fields);
  }
  if (line == null && words.isEmpty()) {
    return null;
  }
 else {
    return words;
  }
}

private static List < String [ ] > readSentence ( BufferedReader aReader ) throws IOException { List < String [ ] > words = new ArrayList < String [ ] > ( ) ; String line ; while ( ( line = aReader . readLine ( ) ) != null ) { if ( StringUtils . isBlank ( line ) ) { break ; } if ( line . startsWith ( "#" ) ) { continue ; } String [ ] fields = line . split ( "\t" ) ; if ( fields . length != 4 ) { throw new IOException ( "Invalid file format. Line needs to have 4 tab-separted fields." ) ; } words . add ( fields ) ; } if ( line == null && words . isEmpty ( ) ) { return null ; } else { return words ; } }
read a single sentence .
