// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.dataprep.dataprepschemaanasysis;

import java.io.File;

import com.google.refine.importers.SeparatorBasedImporter;
import com.google.refine.importers.SeparatorBasedImporter.Separator;

/**
 * created by stef on Dec 22, 2014 Detailled comment
 *
 */
public class GuessSeparator {

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        File file = new File("/home/stef/talend/test_files/customers_1k.csv");
        Separator guessSeparator = SeparatorBasedImporter.guessSeparator(file, null);
        System.out.println(guessSeparator.separator + " in " + (System.currentTimeMillis() - start) + " ms");

        start = System.currentTimeMillis();

        file = new File("/home/stef/talend/test_files/customers_10k.csv");
        guessSeparator = SeparatorBasedImporter.guessSeparator(file, null);
        System.out.println(guessSeparator.separator + " in " + (System.currentTimeMillis() - start) + " ms");

        start = System.currentTimeMillis();

        file = new File("/home/stef/talend/test_files/customers_100k.csv");
        guessSeparator = SeparatorBasedImporter.guessSeparator(file, null);
        System.out.println(guessSeparator.separator + " in " + (System.currentTimeMillis() - start) + " ms");

    }
}

@@ -901,33 +901,32 @@
 ntTimeMillis();%0A
-%0A
         File fil
@@ -1221,33 +1221,32 @@
 ntTimeMillis();%0A
-%0A
         file = n
@@ -1535,17 +1535,16 @@
 llis();%0A
-%0A
         
@@ -1794,20 +1794,651 @@
  + %22 ms%22);%0A%0A
+        start = System.currentTimeMillis();%0A        file = new File(%22/home/stef/talend/test_files/customers_10k_comma.csv%22);%0A        guessSeparator = SeparatorBasedImporter.guessSeparator(file, null);%0A        System.out.println(guessSeparator.separator + %22 in %22 + (System.currentTimeMillis() - start) + %22 ms%22);%0A%0A        start = System.currentTimeMillis();%0A        file = new File(%22/home/stef/talend/test_files/customers_10k_space.csv%22);%0A        guessSeparator = SeparatorBasedImporter.guessSeparator(file, null);%0A        System.out.println(%22%3C%22 + guessSeparator.separator + %22%3E in %22 + (System.currentTimeMillis() - start) + %22 ms%22);%0A%0A
     %7D%0A%7D%0A

test others separators