<commit_before>package de.uni_freiburg.informatik.dbis.sempala.translator;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Get the Properties from the DB, with the information about the complex
 * columns. Share them through the singleton pattern.
 * @author <NAME>
 *
 */
public class ComplexProperties {
	private static ComplexProperties singleton;
	private static Map<String, Boolean> isComplexProperty;
	
	 /* A private Constructor prevents any other
	    * class from instantiating.
	    */
	private ComplexProperties() {}

	/*
	 * Get one instance of this class
	 */
	public static ComplexProperties getInstance(Connection connection) {
		if(singleton != null) return singleton;
		
		HashMap<String, Boolean> tempComplexProperties = new HashMap<String, Boolean>();
		
		ResultSet result;
		try {
			result = connection.createStatement().executeQuery(String.format(
					"SELECT * FROM %s;", Tags.COMPLEX_PROPERTIES_TABLENAME));
			while(result.next()){
				String property = result.getString(1);
				Boolean isComplex = result.getBoolean(2);
				tempComplexProperties.put(property, isComplex);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		isComplexProperty = Collections.unmodifiableMap(tempComplexProperties);
		
		return singleton;
	}

	public static Map<String, Boolean> getComplexProperties() {
		return isComplexProperty;<commit_msg>property added<commit_after>package de.uni_freiburg.informatik.dbis.sempala.translator;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Get the Properties from the DB, with the information about the complex
 * columns. Share them through the singleton pattern.
 * @author <NAME>
 *
 */
public class ComplexProperties {
	private static ComplexProperties singleton;
	private static Map<String, Boolean> isComplexProperty;
	
	 /* A private Constructor prevents any other
	    * class from instantiating.
	    */
	private ComplexProperties() {}

	/*
	 * Get one instance of this class
	 */
	public static ComplexProperties getInstance(Connection connection) {
		if(singleton != null) return singleton;
		
		HashMap<String, Boolean> tempComplexProperties = new HashMap<String, Boolean>();
		
		ResultSet result;
		try {
			result = connection.createStatement().executeQuery(String.format(
					"SELECT * FROM %s;", Tags.COMPLEX_PROPERTIES_TABLENAME));
			while(result.next()){
				String property = result.getString(1);
				Boolean isComplex = result.getBoolean(2);
				tempComplexProperties.put(property, isComplex);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		// add also the name of the subject
		tempComplexProperties.put(Tags.SUBJECT_COLUMN_NAME, false);
		
		isComplexProperty = Collections.unmodifiableMap(tempComplexProperties);
		
		return singleton;
	}

	public static Map<String, Boolean> getComplexProperties() {
		return isComplexProperty;
{'fraction_non_alphanumeric': 0.0973393900064893, 'fraction_numerical': 0.0012978585334198572, 'mean_word_length': 4.51520572450805, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5222966', 'n_tokens_mistral': 949, 'n_tokens_neox': 833, 'n_words': 233}