Changeset 7851


Ignore:
Timestamp:
05/21/12 11:13:32 (7 years ago)
Author:
sforsten
Message:

#1784: changed the TableFileParser, so that you don't have to determine the file format by yourself. Comments have been added for the different Parse methods.

Location:
trunk/sources
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3

    • Property svn:ignore set to
      Plugin.cs
      obj
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ClassificationInstanceProvider.cs

    r7849 r7851  
    2323using System.Collections;
    2424using System.Collections.Generic;
    25 using System.Globalization;
    2625using System.IO;
    2726using System.Linq;
     
    3231  public abstract class ClassificationInstanceProvider : IProblemInstanceProvider<IClassificationProblemData> {
    3332    public IClassificationProblemData LoadData(string path) {
    34       NumberFormatInfo numberFormat;
    35       DateTimeFormatInfo dateFormat;
    36       char separator;
    37       TableFileParser.DetermineFileFormat(new FileStream(path, FileMode.Open), out numberFormat, out dateFormat, out separator);
    38 
    39       IClassificationProblemData claData = LoadData(new FileStream(path, FileMode.Open), numberFormat, dateFormat, separator);
    40       int pos = path.LastIndexOf('\\');
    41       if (pos < 0)
    42         claData.Name = path;
    43       else {
    44         pos++;
    45         claData.Name = path.Substring(pos, path.Length - pos);
    46       }
    47 
    48       return claData;
    49     }
    50 
    51     protected IClassificationProblemData LoadData(Stream stream, NumberFormatInfo numberFormat, DateTimeFormatInfo dateFormat, char separator) {
    5233      TableFileParser csvFileParser = new TableFileParser();
    5334
    54       csvFileParser.Parse(stream, numberFormat, dateFormat, separator);
     35      csvFileParser.Parse(path);
    5536
    5637      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
     
    6546      claData.TestPartition.Start = trainingPartEnd;
    6647      claData.TestPartition.End = csvFileParser.Rows;
     48      int pos = path.LastIndexOf('\\');
     49      if (pos < 0)
     50        claData.Name = path;
     51      else {
     52        pos++;
     53        claData.Name = path.Substring(pos, path.Length - pos);
     54      }
     55
    6756      return claData;
    6857    }
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ResourceClassificationInstanceProvider.cs

    r7849 r7851  
    6464        }
    6565
    66         IClassificationProblemData claData;
     66        TableFileParser csvFileParser = new TableFileParser();
    6767        using (Stream stream = instancesZipFile.GetInputStream(entry)) {
    68           claData = LoadData(stream, numberFormat, dateFormat, separator);
     68          csvFileParser.Parse(stream, numberFormat, dateFormat, separator);
    6969        }
     70
     71        Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
     72        string targetVar = csvFileParser.VariableNames.Last();
     73        IEnumerable<string> allowedInputVars = csvFileParser.VariableNames.Where(x => !x.Equals(targetVar));
     74
     75        ClassificationProblemData claData = new ClassificationProblemData(dataset, allowedInputVars, targetVar);
     76
     77        int trainingPartEnd = csvFileParser.Rows * 2 / 3;
     78        claData.TrainingPartition.Start = 0;
     79        claData.TrainingPartition.End = trainingPartEnd;
     80        claData.TestPartition.Start = trainingPartEnd;
     81        claData.TestPartition.End = csvFileParser.Rows;
     82
    7083        claData.Name = descriptor.Name;
    7184        claData.Description = descriptor.Description;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Properties

    • Property svn:ignore set to
      AssemblyInfo.cs
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RegressionInstanceProvider.cs

    r7849 r7851  
    2323using System.Collections;
    2424using System.Collections.Generic;
    25 using System.Globalization;
    2625using System.IO;
    2726using System.Linq;
     
    3332
    3433    public IRegressionProblemData LoadData(string path) {
    35       NumberFormatInfo numberFormat;
    36       DateTimeFormatInfo dateFormat;
    37       char separator;
    38       TableFileParser.DetermineFileFormat(path, out numberFormat, out dateFormat, out separator);
     34      TableFileParser csvFileParser = new TableFileParser();
     35      csvFileParser.Parse(path);
    3936
    40       IRegressionProblemData regData = LoadData(new FileStream(path, FileMode.Open), numberFormat, dateFormat, separator);
     37      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
     38      string targetVar = csvFileParser.VariableNames.Last();
     39      IEnumerable<string> allowedInputVars = csvFileParser.VariableNames.Where(x => !x.Equals(targetVar));
     40
     41      IRegressionProblemData regData = new RegressionProblemData(dataset, allowedInputVars, targetVar);
     42
     43      int trainingPartEnd = csvFileParser.Rows * 2 / 3;
     44      regData.TrainingPartition.Start = 0;
     45      regData.TrainingPartition.End = trainingPartEnd;
     46      regData.TestPartition.Start = trainingPartEnd;
     47      regData.TestPartition.End = csvFileParser.Rows;
    4148
    4249      int pos = path.LastIndexOf('\\');
     
    4754        regData.Name = path.Substring(pos, path.Length - pos);
    4855      }
    49       return regData;
    50     }
    51 
    52     protected IRegressionProblemData LoadData(Stream stream, NumberFormatInfo numberFormat, DateTimeFormatInfo dateFormat, char separator) {
    53       TableFileParser csvFileParser = new TableFileParser();
    54 
    55       csvFileParser.Parse(stream, numberFormat, dateFormat, separator);
    56 
    57       Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    58       string targetVar = csvFileParser.VariableNames.Last();
    59       IEnumerable<string> allowedInputVars = csvFileParser.VariableNames.Where(x => !x.Equals(targetVar));
    60 
    61       RegressionProblemData regData = new RegressionProblemData(dataset, allowedInputVars, targetVar);
    62 
    63       int trainingPartEnd = csvFileParser.Rows * 2 / 3;
    64       regData.TrainingPartition.Start = 0;
    65       regData.TrainingPartition.End = trainingPartEnd;
    66       regData.TestPartition.Start = trainingPartEnd;
    67       regData.TestPartition.End = csvFileParser.Rows;
    68 
    6956      return regData;
    7057    }
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ResourceRegressionInstanceProvider.cs

    r7849 r7851  
    6464        }
    6565
    66         IRegressionProblemData regData;
     66        TableFileParser csvFileParser = new TableFileParser();
    6767        using (Stream stream = instancesZipFile.GetInputStream(entry)) {
    68           regData = LoadData(stream, numberFormat, dateFormat, separator);
     68          csvFileParser.Parse(stream, numberFormat, dateFormat, separator);
    6969        }
     70
     71        Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
     72        string targetVar = csvFileParser.VariableNames.Last();
     73        IEnumerable<string> allowedInputVars = csvFileParser.VariableNames.Where(x => !x.Equals(targetVar));
     74
     75        IRegressionProblemData regData = new RegressionProblemData(dataset, allowedInputVars, targetVar);
     76
     77        int trainingPartEnd = csvFileParser.Rows * 2 / 3;
     78        regData.TrainingPartition.Start = 0;
     79        regData.TrainingPartition.End = trainingPartEnd;
     80        regData.TestPartition.Start = trainingPartEnd;
     81        regData.TestPartition.End = csvFileParser.Rows;
    7082
    7183        regData.Name = descriptor.Name;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs

    r7849 r7851  
    7575    }
    7676
     77    /// <summary>
     78    /// Parses a file and determines the format first
     79    /// </summary>
     80    /// <param name="fileName">file which is parsed</param>
     81    public void Parse(string fileName) {
     82      NumberFormatInfo numberFormat;
     83      DateTimeFormatInfo dateTimeFormatInfo;
     84      char separator;
     85      DetermineFileFormat(new FileStream(fileName, FileMode.Open), out numberFormat, out dateTimeFormatInfo, out separator);
     86      Parse(new FileStream(fileName, FileMode.Open), numberFormat, dateTimeFormatInfo, separator);
     87    }
     88
     89    /// <summary>
     90    /// Parses a file with the given formats
     91    /// </summary>
     92    /// <param name="fileName">file which is parsed</param>
     93    /// <param name="numberFormat">Format of numbers</param>
     94    /// <param name="dateTimeFormatInfo">Format of datetime</param>
     95    /// <param name="separator">defines the separator</param>
    7796    public void Parse(string fileName, NumberFormatInfo numberFormat, DateTimeFormatInfo dateTimeFormatInfo, char separator) {
    7897      Parse(new FileStream(fileName, FileMode.Open), numberFormat, dateTimeFormatInfo, separator);
    7998    }
    8099
     100    /// <summary>
     101    /// Takes a Stream and parses it with default format. NumberFormatInfo.InvariantInfo, DateTimeFormatInfo.InvariantInfo and separator = ','
     102    /// </summary>
     103    /// <param name="stream">stream which is parsed</param>
     104    public void Parse(Stream stream) {
     105      NumberFormatInfo numberFormat = NumberFormatInfo.InvariantInfo;
     106      DateTimeFormatInfo dateTimeFormatInfo = DateTimeFormatInfo.InvariantInfo;
     107      char separator = ',';
     108      Parse(stream, numberFormat, dateTimeFormatInfo, separator);
     109    }
     110
     111    /// <summary>
     112    /// Parses a stream with the given formats.
     113    /// </summary>
     114    /// <param name="stream">Stream which is parsed</param>   
     115    /// <param name="numberFormat">Format of numbers</param>
     116    /// <param name="dateTimeFormatInfo">Format of datetime</param>
     117    /// <param name="separator">defines the separator</param>
    81118    public void Parse(Stream stream, NumberFormatInfo numberFormat, DateTimeFormatInfo dateTimeFormatInfo, char separator) {
    82119      using (StreamReader reader = new StreamReader(stream)) {
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/TableFileParserTest.cs

    r7849 r7851  
    2121
    2222using System;
    23 using System.Globalization;
    2423using System.IO;
    2524using HeuristicLab.Problems.Instances.DataAnalysis;
     
    3433    public void ParseCSV() {
    3534      string tempFileName = Path.GetTempFileName();
    36       NumberFormatInfo numberFormat;
    37       DateTimeFormatInfo dateFormatInfo;
    38       char separator;
    3935      WriteToFile(tempFileName,
    4036      @"0.00, 0.00, 0.00, 3.14
     
    4642      TableFileParser parser = new TableFileParser();
    4743      try {
    48         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    49         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     44        parser.Parse(tempFileName);
    5045        Assert.AreEqual(6, parser.Rows);
    5146        Assert.AreEqual(4, parser.Columns);
     
    5954    public void ParseCSVWithNames() {
    6055      string tempFileName = Path.GetTempFileName();
    61       NumberFormatInfo numberFormat;
    62       DateTimeFormatInfo dateFormatInfo;
    63       char separator;
    6456      WriteToFile(tempFileName,
    6557      @"x01, x02, x03, x04
     
    7264      TableFileParser parser = new TableFileParser();
    7365      try {
    74         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    75         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     66        parser.Parse(tempFileName);
    7667        Assert.AreEqual(6, parser.Rows);
    7768        Assert.AreEqual(4, parser.Columns);
     
    8677    public void ParseGermanCSV() {
    8778      string tempFileName = Path.GetTempFileName();
    88       NumberFormatInfo numberFormat;
    89       DateTimeFormatInfo dateFormatInfo;
    90       char separator;
    9179      WriteToFile(tempFileName,
    9280      @"0,00; 0,00; 0,00; 3,14
     
    9886      TableFileParser parser = new TableFileParser();
    9987      try {
    100         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    101         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     88        parser.Parse(tempFileName);
    10289        Assert.AreEqual(6, parser.Rows);
    10390        Assert.AreEqual(4, parser.Columns);
     
    11299    public void ParseGermanCSVWithNames() {
    113100      string tempFileName = Path.GetTempFileName();
    114       NumberFormatInfo numberFormat;
    115       DateTimeFormatInfo dateFormatInfo;
    116       char separator;
    117101      WriteToFile(tempFileName,
    118102      @"x01; x02; x03; x04
     
    125109      TableFileParser parser = new TableFileParser();
    126110      try {
    127         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    128         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     111        parser.Parse(tempFileName);
    129112        Assert.AreEqual(6, parser.Rows);
    130113        Assert.AreEqual(4, parser.Columns);
     
    139122    public void ParseGermanCSVWithoutCommas() {
    140123      string tempFileName = Path.GetTempFileName();
    141       NumberFormatInfo numberFormat;
    142       DateTimeFormatInfo dateFormatInfo;
    143       char separator;
    144124      WriteToFile(tempFileName,
    145125      @"0; 0; 0; 3
     
    151131      TableFileParser parser = new TableFileParser();
    152132      try {
    153         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    154         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     133        parser.Parse(tempFileName);
    155134        Assert.AreEqual(6, parser.Rows);
    156135        Assert.AreEqual(4, parser.Columns);
     
    164143    public void ParseGermanCSVWithoutCommasWithNames() {
    165144      string tempFileName = Path.GetTempFileName();
    166       NumberFormatInfo numberFormat;
    167       DateTimeFormatInfo dateFormatInfo;
    168       char separator;
    169145      WriteToFile(tempFileName,
    170146      @"x01; x02; x03; x04
     
    177153      TableFileParser parser = new TableFileParser();
    178154      try {
    179         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    180         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     155        parser.Parse(tempFileName);
    181156        Assert.AreEqual(6, parser.Rows);
    182157        Assert.AreEqual(4, parser.Columns);
     
    191166    public void ParseEnglishCSVWithoutCommas() {
    192167      string tempFileName = Path.GetTempFileName();
    193       NumberFormatInfo numberFormat;
    194       DateTimeFormatInfo dateFormatInfo;
    195       char separator;
    196168      WriteToFile(tempFileName,
    197169      @"0, 0, 0, 3
     
    203175      TableFileParser parser = new TableFileParser();
    204176      try {
    205         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    206         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     177        parser.Parse(tempFileName);
    207178        Assert.AreEqual(6, parser.Rows);
    208179        Assert.AreEqual(4, parser.Columns);
     
    217188    public void ParseEnglishCSVWithoutCommasWithoutSpace() {
    218189      string tempFileName = Path.GetTempFileName();
    219       NumberFormatInfo numberFormat;
    220       DateTimeFormatInfo dateFormatInfo;
    221       char separator;
    222190      WriteToFile(tempFileName,
    223191      @"0,0,0,3
     
    229197      TableFileParser parser = new TableFileParser();
    230198      try {
    231         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    232         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     199        parser.Parse(tempFileName);
    233200        Assert.AreEqual(6, parser.Rows);
    234201        Assert.AreEqual(4, parser.Columns);
     
    243210    public void ParseEnglishCSVWithoutCommasWithNames() {
    244211      string tempFileName = Path.GetTempFileName();
    245       NumberFormatInfo numberFormat;
    246       DateTimeFormatInfo dateFormatInfo;
    247       char separator;
    248212      WriteToFile(tempFileName,
    249213      @"x01, x02, x03, x04
     
    256220      TableFileParser parser = new TableFileParser();
    257221      try {
    258         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    259         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     222        parser.Parse(tempFileName);
    260223        Assert.AreEqual(6, parser.Rows);
    261224        Assert.AreEqual(4, parser.Columns);
     
    270233    public void ParseEnglishCSVWithoutCommasWithoutSpacesWithNames() {
    271234      string tempFileName = Path.GetTempFileName();
    272       NumberFormatInfo numberFormat;
    273       DateTimeFormatInfo dateFormatInfo;
    274       char separator;
    275235      WriteToFile(tempFileName,
    276236      @"x01,x02,x03,x04
     
    283243      TableFileParser parser = new TableFileParser();
    284244      try {
    285         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    286         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     245        parser.Parse(tempFileName);
    287246        Assert.AreEqual(6, parser.Rows);
    288247        Assert.AreEqual(4, parser.Columns);
     
    298257    public void ParseGermanTabSeparated() {
    299258      string tempFileName = Path.GetTempFileName();
    300       NumberFormatInfo numberFormat;
    301       DateTimeFormatInfo dateFormatInfo;
    302       char separator;
    303259      WriteToFile(tempFileName,
    304260      "0,00\t 0,00\t 0,00\t 3,14" + Environment.NewLine +
     
    310266      TableFileParser parser = new TableFileParser();
    311267      try {
    312         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    313         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     268        parser.Parse(tempFileName);
    314269        Assert.AreEqual(6, parser.Rows);
    315270        Assert.AreEqual(4, parser.Columns);
     
    324279    public void ParseGermanTabSeparatedWithNames() {
    325280      string tempFileName = Path.GetTempFileName();
    326       NumberFormatInfo numberFormat;
    327       DateTimeFormatInfo dateFormatInfo;
    328       char separator;
    329281      WriteToFile(tempFileName,
    330282      "x01\t x02\t x03\t x04" + Environment.NewLine +
     
    337289      TableFileParser parser = new TableFileParser();
    338290      try {
    339         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    340         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     291        parser.Parse(tempFileName);
    341292        Assert.AreEqual(6, parser.Rows);
    342293        Assert.AreEqual(4, parser.Columns);
     
    351302    public void ParseEnglishTabSeparated() {
    352303      string tempFileName = Path.GetTempFileName();
    353       NumberFormatInfo numberFormat;
    354       DateTimeFormatInfo dateFormatInfo;
    355       char separator;
    356304      WriteToFile(tempFileName,
    357305      "0.00\t 0.00\t 0.00\t 3.14" + Environment.NewLine +
     
    363311      TableFileParser parser = new TableFileParser();
    364312      try {
    365         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    366         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     313        parser.Parse(tempFileName);
    367314        Assert.AreEqual(6, parser.Rows);
    368315        Assert.AreEqual(4, parser.Columns);
     
    376323    public void ParseEnglishTabSeparatedWithNames() {
    377324      string tempFileName = Path.GetTempFileName();
    378       NumberFormatInfo numberFormat;
    379       DateTimeFormatInfo dateFormatInfo;
    380       char separator;
    381325      WriteToFile(tempFileName,
    382326      "x01\t x02\t x03\t x04" + Environment.NewLine +
     
    389333      TableFileParser parser = new TableFileParser();
    390334      try {
    391         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    392         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     335        parser.Parse(tempFileName);
    393336        Assert.AreEqual(6, parser.Rows);
    394337        Assert.AreEqual(4, parser.Columns);
     
    403346    public void ParseTabSeparatedWithoutCommas() {
    404347      string tempFileName = Path.GetTempFileName();
    405       NumberFormatInfo numberFormat;
    406       DateTimeFormatInfo dateFormatInfo;
    407       char separator;
    408348      WriteToFile(tempFileName,
    409349      "0\t 0\t 0\t 3" + Environment.NewLine +
     
    415355      TableFileParser parser = new TableFileParser();
    416356      try {
    417         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    418         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     357        parser.Parse(tempFileName);
    419358        Assert.AreEqual(6, parser.Rows);
    420359        Assert.AreEqual(4, parser.Columns);
     
    428367    public void ParseTabSeparatedWithoutCommasWithNames() {
    429368      string tempFileName = Path.GetTempFileName();
    430       NumberFormatInfo numberFormat;
    431       DateTimeFormatInfo dateFormatInfo;
    432       char separator;
    433369      WriteToFile(tempFileName,
    434370      "x01\t x02\t x03\t x04" + Environment.NewLine +
     
    441377      TableFileParser parser = new TableFileParser();
    442378      try {
    443         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    444         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     379        parser.Parse(tempFileName);
    445380        Assert.AreEqual(6, parser.Rows);
    446381        Assert.AreEqual(4, parser.Columns);
     
    455390    public void ParseWithEmtpyLines() {
    456391      string tempFileName = Path.GetTempFileName();
    457       NumberFormatInfo numberFormat;
    458       DateTimeFormatInfo dateFormatInfo;
    459       char separator;
    460392      WriteToFile(tempFileName,
    461393      "x01\t x02\t x03\t x04" + Environment.NewLine +
     
    468400      TableFileParser parser = new TableFileParser();
    469401      try {
    470         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    471         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     402        parser.Parse(tempFileName);
    472403        Assert.AreEqual(4, parser.Rows);
    473404        Assert.AreEqual(4, parser.Columns);
     
    481412    public void ParseGermanSpaceSeparated() {
    482413      string tempFileName = Path.GetTempFileName();
    483       NumberFormatInfo numberFormat;
    484       DateTimeFormatInfo dateFormatInfo;
    485       char separator;
    486414      WriteToFile(tempFileName,
    487415      @"0,00 0,00 0,00 3,14
     
    493421      TableFileParser parser = new TableFileParser();
    494422      try {
    495         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    496         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     423        parser.Parse(tempFileName);
    497424        Assert.AreEqual(6, parser.Rows);
    498425        Assert.AreEqual(4, parser.Columns);
     
    506433    public void ParseGermanSpaceSeparatedWithNames() {
    507434      string tempFileName = Path.GetTempFileName();
    508       NumberFormatInfo numberFormat;
    509       DateTimeFormatInfo dateFormatInfo;
    510       char separator;
    511435      WriteToFile(tempFileName,
    512436      @"x01 x02 x03 x04
     
    519443      TableFileParser parser = new TableFileParser();
    520444      try {
    521         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    522         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     445        parser.Parse(tempFileName);
    523446        Assert.AreEqual(6, parser.Rows);
    524447        Assert.AreEqual(4, parser.Columns);
     
    533456    public void ParseEnglishSpaceSeparated() {
    534457      string tempFileName = Path.GetTempFileName();
    535       NumberFormatInfo numberFormat;
    536       DateTimeFormatInfo dateFormatInfo;
    537       char separator;
    538458      WriteToFile(tempFileName,
    539459      @"0.00 0.00 0.00 3.14
     
    545465      TableFileParser parser = new TableFileParser();
    546466      try {
    547         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    548         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     467        parser.Parse(tempFileName);
    549468        Assert.AreEqual(6, parser.Rows);
    550469        Assert.AreEqual(4, parser.Columns);
     
    558477    public void ParseEnglishSpaceSeparatedWithNames() {
    559478      string tempFileName = Path.GetTempFileName();
    560       NumberFormatInfo numberFormat;
    561       DateTimeFormatInfo dateFormatInfo;
    562       char separator;
    563479      WriteToFile(tempFileName,
    564480      @"x01 x02 x03 x04
     
    571487      TableFileParser parser = new TableFileParser();
    572488      try {
    573         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    574         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     489        parser.Parse(tempFileName);
    575490        Assert.AreEqual(6, parser.Rows);
    576491        Assert.AreEqual(4, parser.Columns);
     
    585500    public void ParseSpaceSeparatedWithoutCommas() {
    586501      string tempFileName = Path.GetTempFileName();
    587       NumberFormatInfo numberFormat;
    588       DateTimeFormatInfo dateFormatInfo;
    589       char separator;
    590502      WriteToFile(tempFileName,
    591503      @"0 0 0 3
     
    597509      TableFileParser parser = new TableFileParser();
    598510      try {
    599         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    600         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     511        parser.Parse(tempFileName);
    601512        Assert.AreEqual(6, parser.Rows);
    602513        Assert.AreEqual(4, parser.Columns);
     
    610521    public void ParseSpaceSeparatedWithoutCommasWithNames() {
    611522      string tempFileName = Path.GetTempFileName();
    612       NumberFormatInfo numberFormat;
    613       DateTimeFormatInfo dateFormatInfo;
    614       char separator;
    615523      WriteToFile(tempFileName,
    616524      @"x01 x02 x03 x04
     
    623531      TableFileParser parser = new TableFileParser();
    624532      try {
    625         TableFileParser.DetermineFileFormat(tempFileName, out numberFormat, out dateFormatInfo, out separator);
    626         parser.Parse(tempFileName, numberFormat, dateFormatInfo, separator);
     533        parser.Parse(tempFileName);
    627534        Assert.AreEqual(6, parser.Rows);
    628535        Assert.AreEqual(4, parser.Columns);
Note: See TracChangeset for help on using the changeset viewer.