boolean defaultStringsAsFactors)
{
HashMap<String, ImportFileSettings> commandDefaults_ =
new HashMap<String, ImportFileSettings>();
commandDefaults_.put("read.table", new ImportFileSettings(
null, null, false, "", ".", "\"'", "NA", defaultStringsAsFactors));
commandDefaults_.put("read.csv", new ImportFileSettings(
null, null, true, ",", ".", "\"", "NA", defaultStringsAsFactors));
commandDefaults_.put("read.delim", new ImportFileSettings(
null, null, true, "\t", ".", "\"", "NA", defaultStringsAsFactors));
commandDefaults_.put("read.csv2", new ImportFileSettings(
null, null, true, ";", ",", "\"", "NA", defaultStringsAsFactors));
commandDefaults_.put("read.delim2", new ImportFileSettings(
null, null, true, "\t", ",", "\"", "NA", defaultStringsAsFactors));
String command = "read.table";
ImportFileSettings settings = commandDefaults_.get("read.table");
int score = settings.calculateSimilarity(input);
for (String cmd : new String[] {"read.csv", "read.delim"})
{
ImportFileSettings theseSettings = commandDefaults_.get(cmd);
int thisScore = theseSettings.calculateSimilarity(input);
if (thisScore > score)
{
score = thisScore;
command = cmd;
settings = theseSettings;