// Path: javaCode/utility/Config.java
// public class Config 
// {
// 	public String cfgFileName;
// 	public String dbName;
// 	public String host ;
// 	public String user ;
// 	public String passwd;
// 	public String port ;
// 	public String url ;
// 	public boolean useFile;
// 	public String fileName;
// 	public String dbServer;
// 	public String outputFile;
//     public String preprocessingColumn;
// 	public boolean debugMode;
// 	public int dbOption;
// 	
// 	public static String storeResultDirectory = "c:/Users/admin/dcp-workspace/log/";
//     public static String queryFileName = "c:/Users/admin/dcp-workspace/data/_fixedQueries_";
//     public static String expResultTablePrefix = "_ExpRes_"; 
// 	public static String queryClass = "dcp.clean";
//     
// 	public static boolean tokenizeUsingQgrams = true;
//     public int numHeaders;
//     
// 
// 	public String bm25WeightTable = "$Aux$_BM253_0_cu1_string_BMBaseWeights";
// 	public String tfidfWeightTable = "$Aux$_TfIdf3_0_cu1_string_Weights";
// 	// Class constructor 
// 	public Config() {
// 		outputFile = "geneRatios.txt";
// 		
// 		host = "localhost";
// 		user = "root";
// 		passwd = "";
// 		port = "3306";
// 		url = "";
// 		useFile = false;
// 	    fileName = "tmpFile";
// 	    dbServer = "mysql";
// 	    numHeaders = 7;
// 	    dbName = "midas";
// 	    preprocessingColumn = "name";
// 	    
// 	    //dbName = "probtest";
// 	    //preprocessingColumn = "title";
// 	}
// 	
// 	public String returnURL(){
// 		if(dbOption == 1)
// 			url = "jdbc:postgres://"+ host + ":"+ port +"/"+ dbName;
// 		else
// 			url = "jdbc:mysql://"+host+":"+port+"/"+dbName ;
// 		return url;
// 	}
// 	
// 	public void setDebugMode(boolean val){
// 		debugMode = val;
// 	}
// 
// 	public void setDbName(String name){
// 		dbName = name;
// 	}
// 	
// }
// 
// Path: javaCode/dbdriver/MySqlDB.java
// public class MySqlDB
// {
// 	//String url, usr, passwd;
// 	Connection con=null;
// 	Statement st=null;
// 
// 	public MySqlDB(String url, String user, String passwd) {
// 		try {
// 			Class.forName("com.mysql.jdbc.Driver").newInstance();
// 		}
// 		catch (Exception E) {
// 			System.err.println("Unable to load driver.");
// 			E.printStackTrace();
// 			System.exit(1);
// 		}
// 		try {
// 			Connection con2 = DriverManager.getConnection(url, user, passwd);
// 			//System.out.println(url+" "+user+" "+passwd);
// 			con = con2;
// 		}
// 		catch (SQLException E) {
// 			System.out.println("SQLException: " + E.getMessage());
// 			System.out.println("SQLState:     " + E.getSQLState());
// 			System.out.println("VendorError:  " + E.getErrorCode());
// 			E.printStackTrace();
// 			con=null;
// 			System.exit(1);
// 		}
// 
// 
// 
// 	}
// 
// 	public ResultSet executeQuery(String query) throws java.lang.Exception {
// 		return con.createStatement().executeQuery(query);
// 	}
// 
// 	public DatabaseMetaData getMetaData() throws java.lang.Exception {
// 		return con.getMetaData();
// 	}
// 
// 	public int executeUpdate(String query) throws java.lang.Exception {
// 		return con.createStatement().executeUpdate(query);
// 	}
// 
// 	public PreparedStatement prepareStatement(String query)
// 		throws java.lang.Exception {
// 			return con.prepareStatement(query);
// 		}
// 
// 	public void close() throws Exception {
// 		if(con != null)
// 			con.close();
// 	}
// } 
// 
// Path: javaCode/experiment/IdScore.java
// public class IdScore implements Comparable<IdScore> {
// 	int id;
// 
// 	double score;
// 
// 	public int compareTo(IdScore other) {
// 		return (int) Math.signum(other.score - this.score);
// 	}
// 
// 	public IdScore(int id, double score) {
// 		this.id = id;
// 		this.score = score;
// 	}
// 	
// 	public String toString(){
// 		return "[ "+id+" : "+score+" ] ";
// 	}
// }


import dbdriver.MySqlDB;
import experiment.IdScore;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Vector;
import utility.Config;
					}
					numberOfRecords++;
				}
			}
			mysqlDB.close();
		} catch (Exception e) {
			System.out.println("database error: cannot read table");
			e.printStackTrace();
		}
		if (logToDB) {
			storePreprocessedDataToDB(tableName, recordTokenWeights, extractMetricName(this.getClass().getName())
					+ "_tf");
		}
		// convert the df into IDF
		convertDFtoIDF(qgramIDF, numberOfRecords, recordTokenWeights);
		if (logToDB) {
			storePreprocessedIDF(tableName, qgramIDF, extractMetricName(this.getClass().getName()) + "_idf");
		}
		// Now convert the tf in fileQrmanWeight to tfidf weights
		/*
		 * convertTFtoWeights(records, qgramIDF, recordTokenWeights); if
		 * (logToDB) { storePreprocessedDataToDB(tableName, recordTokenWeights,
		 * extractMetricName(this.getClass().getName()) + "_wt"); }
		 */
	}

	// This function is for the metrics which has to go iteratively through all
	// the records to get the final scoreList
	public List<IdScore> getSimilarRecords(String query, HashMap<String, Double> qgramIDF,
			Vector<HashMap<String, Double>> recordTokenWeights, Vector<String> recordVector) {
// Path: javaCode/utility/Config.java
// public class Config 
// {
// 	public String cfgFileName;
// 	public String dbName;
// 	public String host ;
// 	public String user ;
// 	public String passwd;
// 	public String port ;
// 	public String url ;
// 	public boolean useFile;
// 	public String fileName;
// 	public String dbServer;
// 	public String outputFile;
//     public String preprocessingColumn;
// 	public boolean debugMode;
// 	public int dbOption;
// 	
// 	public static String storeResultDirectory = "c:/Users/admin/dcp-workspace/log/";
//     public static String queryFileName = "c:/Users/admin/dcp-workspace/data/_fixedQueries_";
//     public static String expResultTablePrefix = "_ExpRes_"; 
// 	public static String queryClass = "dcp.clean";
//     
// 	public static boolean tokenizeUsingQgrams = true;
//     public int numHeaders;
//     
// 
// 	public String bm25WeightTable = "$Aux$_BM253_0_cu1_string_BMBaseWeights";
// 	public String tfidfWeightTable = "$Aux$_TfIdf3_0_cu1_string_Weights";
// 	// Class constructor 
// 	public Config() {
// 		outputFile = "geneRatios.txt";
// 		
// 		host = "localhost";
// 		user = "root";
// 		passwd = "";
// 		port = "3306";
// 		url = "";
// 		useFile = false;
// 	    fileName = "tmpFile";
// 	    dbServer = "mysql";
// 	    numHeaders = 7;
// 	    dbName = "midas";
// 	    preprocessingColumn = "name";
// 	    
// 	    //dbName = "probtest";
// 	    //preprocessingColumn = "title";
// 	}
// 	
// 	public String returnURL(){
// 		if(dbOption == 1)
// 			url = "jdbc:postgres://"+ host + ":"+ port +"/"+ dbName;
// 		else
// 			url = "jdbc:mysql://"+host+":"+port+"/"+dbName ;
// 		return url;
// 	}
// 	
// 	public void setDebugMode(boolean val){
// 		debugMode = val;
// 	}
// 
// 	public void setDbName(String name){
// 		dbName = name;
// 	}
// 	
// }
// 
// Path: javaCode/dbdriver/MySqlDB.java
// public class MySqlDB
// {
// 	//String url, usr, passwd;
// 	Connection con=null;
// 	Statement st=null;
// 
// 	public MySqlDB(String url, String user, String passwd) {
// 		try {
// 			Class.forName("com.mysql.jdbc.Driver").newInstance();
// 		}
// 		catch (Exception E) {
// 			System.err.println("Unable to load driver.");
// 			E.printStackTrace();
// 			System.exit(1);
// 		}
// 		try {
// 			Connection con2 = DriverManager.getConnection(url, user, passwd);
// 			//System.out.println(url+" "+user+" "+passwd);
// 			con = con2;
// 		}
// 		catch (SQLException E) {
// 			System.out.println("SQLException: " + E.getMessage());
// 			System.out.println("SQLState:     " + E.getSQLState());
// 			System.out.println("VendorError:  " + E.getErrorCode());
// 			E.printStackTrace();
// 			con=null;
// 			System.exit(1);
// 		}
// 
// 
// 
// 	}
// 
// 	public ResultSet executeQuery(String query) throws java.lang.Exception {
// 		return con.createStatement().executeQuery(query);
// 	}
// 
// 	public DatabaseMetaData getMetaData() throws java.lang.Exception {
// 		return con.getMetaData();
// 	}
// 
// 	public int executeUpdate(String query) throws java.lang.Exception {
// 		return con.createStatement().executeUpdate(query);
// 	}
// 
// 	public PreparedStatement prepareStatement(String query)
// 		throws java.lang.Exception {
// 			return con.prepareStatement(query);
// 		}
// 
// 	public void close() throws Exception {
// 		if(con != null)
// 			con.close();
// 	}
// } 
// 
// Path: javaCode/experiment/IdScore.java
// public class IdScore implements Comparable<IdScore> {
// 	int id;
// 
// 	double score;
// 
// 	public int compareTo(IdScore other) {
// 		return (int) Math.signum(other.score - this.score);
// 	}
// 
// 	public IdScore(int id, double score) {
// 		this.id = id;
// 		this.score = score;
// 	}
// 	
// 	public String toString(){
// 		return "[ "+id+" : "+score+" ] ";
// 	}
// }


// Path: javaCode/simfunctions/ApproximateGES.java
import dbdriver.MySqlDB;
import experiment.IdScore;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Vector;
import utility.Config;

					}
					numberOfRecords++;
				}
			}
			mysqlDB.close();
		} catch (Exception e) {
			System.out.println("database error: cannot read table");
			e.printStackTrace();
		}
		if (logToDB) {
			storePreprocessedDataToDB(tableName, recordTokenWeights, extractMetricName(this.getClass().getName())
					+ "_tf");
		}
		// convert the df into IDF
		convertDFtoIDF(qgramIDF, numberOfRecords, recordTokenWeights);
		if (logToDB) {
			storePreprocessedIDF(tableName, qgramIDF, extractMetricName(this.getClass().getName()) + "_idf");
		}
		// Now convert the tf in fileQrmanWeight to tfidf weights
		/*
		 * convertTFtoWeights(records, qgramIDF, recordTokenWeights); if
		 * (logToDB) { storePreprocessedDataToDB(tableName, recordTokenWeights,
		 * extractMetricName(this.getClass().getName()) + "_wt"); }
		 */
	}

	// This function is for the metrics which has to go iteratively through all
	// the records to get the final scoreList
	public List<IdScore> getSimilarRecords(String query, HashMap<String, Double> qgramIDF,
			Vector<HashMap<String, Double>> recordTokenWeights, Vector<String> recordVector) {
		List<IdScore> scoreList = new ArrayList<IdScore>();