private static Iterator<Instance> constructIterator (File trainFile, File dataDir, boolean isList) throws IOException
{
if (isList) {
return new FileListIterator (trainFile, dataDir, null, null, true);
} else {
return new LineGroupIterator (new FileReader (trainFile), Pattern.compile ("^\\s*$"), true);
}
}