public static HierarchyVersion createGenusWordProbList(Reader r, List<GenusWordConditionalProb> aList, HierarchyVersion version) throws IOException, TrainingDataException {
BufferedReader reader = new BufferedReader(r);
String line = reader.readLine();
if (line != null) {
HierarchyVersion thisVersion = new HierarchyVersion(line);
int trainsetNo = thisVersion.getTrainsetNo();
if (thisVersion.getVersion() == null) {
throw new TrainingDataException("Error: There is no version information "
+ "in the probabilityList file");
}
if (version == null) {
version = thisVersion;
} else if (!version.getVersion().equals(thisVersion.getVersion()) || version.getTrainsetNo() != thisVersion.getTrainsetNo()) {
throw new TrainingDataException("Error: The version information in the probabilityList file is different from the version of the other training files.");
}
}
while ((line = reader.readLine()) != null) {