<commit_before>package org.openlca.app.cloud.ui.compare;

import java.util.HashMap;
import java.util.Map;

import org.openlca.app.M;
import org.openlca.core.model.Actor;
import org.openlca.core.model.AllocationFactor;
import org.openlca.core.model.CategorizedEntity;
import org.openlca.core.model.Category;
import org.openlca.core.model.Currency;
import org.openlca.core.model.DQIndicator;
import org.openlca.core.model.DQScore;
import org.openlca.core.model.DQSystem;
import org.openlca.core.model.Exchange;
import org.openlca.core.model.Flow;
import org.openlca.core.model.FlowProperty;
import org.openlca.core.model.FlowPropertyFactor;
import org.openlca.core.model.ImpactCategory;
import org.openlca.core.model.ImpactFactor;
import org.openlca.core.model.ImpactMethod;
import org.openlca.core.model.Location;
import org.openlca.core.model.NwFactor;
import org.openlca.core.model.NwSet;
import org.openlca.core.model.Parameter;
import org.openlca.core.model.ParameterRedef;
import org.openlca.core.model.Process;
import org.openlca.core.model.ProcessDocumentation;
import org.openlca.core.model.ProductSystem;
import org.openlca.core.model.Project;
import org.openlca.core.model.ProjectVariant;
import org.openlca.core.model.SocialAspect;
import org.openlca.core.model.SocialIndicator;
import org.openlca.core.model.Source;
import org.openlca.core.model.Uncertainty;
import org.openlca.core.model.Unit;
import org.openlca.core.model.UnitGroup;

class PropertyLabels {

	private static final Map<String, Map<String, String>> labels = new HashMap<>();
	private static final Map<String, Map<String, Integer>> ordinals = new HashMap<>();

	static {
		putLabels();
	}

	static String get(String parentType, String property) {
		if (!labels.containsKey(parentType))
			return property;
		Map<String, String> typeLabels = labels.get(parentType);
		if (typeLabels.containsKey(property))
			return typeLabels.get(property);
		return property;
	}

	static int getOrdinal(String parentType, String property) {
		if (!ordinals.containsKey(parentType))
			return 0;
		Map<String, Integer> typeOrdinals = ordinals.get(parentType);
		if (typeOrdinals.containsKey(property))
			return typeOrdinals.get(property);
		return 0;
	}

	private static void putLabels() {
		putCategoryLabels();
		putLocationLabels();
		putCurrencyLabels();
		putActorLabels();
		putSourceLabels();
		putUnitGroupLabels();
		putUnitLabels();
		putFlowPropertyLabels();
		putSocialIndicatorLabels();
		putFlowLabels();
		putFlowPropertyFactorsLabels();
		putProcessLabels();
		putProcessDocumentationLabels();
		putExchangeLabels();
		putUncertaintyLabels();
		putAllocationFactorLabels();
		putParameterLabels();
		putSocialAspectLabels();
		putImpactMethodLabels();
		putImpactCategoryLabels();
		putImpactFactorLabels();
		putNwSetLabels();
		putNwFactorLabels();
		putProductSystemLabels();
		putParameterRedefLabels();
		putProjectLabels();
		putProjectVariantLabels();
		putDQSystemLabels();
		putDQIndicatorLabels();
		putDQScoreLabels();
	}

	private static void putBasicLabels(Class<?> clazz) {
		put(clazz, "name", M.Name);
		put(clazz, "description", M.Description);
		if (CategorizedEntity.class.isAssignableFrom(clazz))
			put(clazz, "category", M.Category);
	}

	private static void putCategoryLabels() {
		Class<?> clazz = Category.class;
		put(clazz, "modelType", M.ModelType);
		put(clazz, "name", M.Name);
		put(clazz, "category", M.Category);
	}

	private static void putLocationLabels() {
		Class<?> clazz = Location.class;
		putBasicLabels(clazz);
		put(clazz, "code", M.Code);
		put(clazz, "longitude", M.Longitude);
		put(clazz, "latitude", M.Latitude);
		put(clazz, "geometry", M.Geometry);
	}

	private static void putCurrencyLabels() {
		Class<?> clazz = Currency.class;
		putBasicLabels(clazz);
		put(clazz, "code", M.Code);
		put(clazz, "conversionFactor", M.ConversionFactor);
		put(clazz, "referenceCurrency", M.ReferenceCurrency);
	}

	private static void putActorLabels() {
		Class<?> clazz = Actor.class;
		putBasicLabels(clazz);
		put(clazz, "address", M.Address);
		put(clazz, "city", M.City);
		put(clazz, "country", M.Country);
		put(clazz, "email", M.Email);
		put(clazz, "telefax", M.Telefax);
		put(clazz, "telephone", M.Telephone);
		put(clazz, "website", M.Website);
		put(clazz, "zipCode", M.ZipCode);
	}

	private static void putSourceLabels() {
		Class<?> clazz = Source.class;
		putBasicLabels(clazz);
		put(clazz, "doi", M.Doi);
		put(clazz, "textReference", M.TextReference);<commit_msg>Renamed property label 'doi' to 'url'<commit_after>package org.openlca.app.cloud.ui.compare;

import java.util.HashMap;
import java.util.Map;

import org.openlca.app.M;
import org.openlca.core.model.Actor;
import org.openlca.core.model.AllocationFactor;
import org.openlca.core.model.CategorizedEntity;
import org.openlca.core.model.Category;
import org.openlca.core.model.Currency;
import org.openlca.core.model.DQIndicator;
import org.openlca.core.model.DQScore;
import org.openlca.core.model.DQSystem;
import org.openlca.core.model.Exchange;
import org.openlca.core.model.Flow;
import org.openlca.core.model.FlowProperty;
import org.openlca.core.model.FlowPropertyFactor;
import org.openlca.core.model.ImpactCategory;
import org.openlca.core.model.ImpactFactor;
import org.openlca.core.model.ImpactMethod;
import org.openlca.core.model.Location;
import org.openlca.core.model.NwFactor;
import org.openlca.core.model.NwSet;
import org.openlca.core.model.Parameter;
import org.openlca.core.model.ParameterRedef;
import org.openlca.core.model.Process;
import org.openlca.core.model.ProcessDocumentation;
import org.openlca.core.model.ProductSystem;
import org.openlca.core.model.Project;
import org.openlca.core.model.ProjectVariant;
import org.openlca.core.model.SocialAspect;
import org.openlca.core.model.SocialIndicator;
import org.openlca.core.model.Source;
import org.openlca.core.model.Uncertainty;
import org.openlca.core.model.Unit;
import org.openlca.core.model.UnitGroup;

class PropertyLabels {

	private static final Map<String, Map<String, String>> labels = new HashMap<>();
	private static final Map<String, Map<String, Integer>> ordinals = new HashMap<>();

	static {
		putLabels();
	}

	static String get(String parentType, String property) {
		if (!labels.containsKey(parentType))
			return property;
		Map<String, String> typeLabels = labels.get(parentType);
		if (typeLabels.containsKey(property))
			return typeLabels.get(property);
		return property;
	}

	static int getOrdinal(String parentType, String property) {
		if (!ordinals.containsKey(parentType))
			return 0;
		Map<String, Integer> typeOrdinals = ordinals.get(parentType);
		if (typeOrdinals.containsKey(property))
			return typeOrdinals.get(property);
		return 0;
	}

	private static void putLabels() {
		putCategoryLabels();
		putLocationLabels();
		putCurrencyLabels();
		putActorLabels();
		putSourceLabels();
		putUnitGroupLabels();
		putUnitLabels();
		putFlowPropertyLabels();
		putSocialIndicatorLabels();
		putFlowLabels();
		putFlowPropertyFactorsLabels();
		putProcessLabels();
		putProcessDocumentationLabels();
		putExchangeLabels();
		putUncertaintyLabels();
		putAllocationFactorLabels();
		putParameterLabels();
		putSocialAspectLabels();
		putImpactMethodLabels();
		putImpactCategoryLabels();
		putImpactFactorLabels();
		putNwSetLabels();
		putNwFactorLabels();
		putProductSystemLabels();
		putParameterRedefLabels();
		putProjectLabels();
		putProjectVariantLabels();
		putDQSystemLabels();
		putDQIndicatorLabels();
		putDQScoreLabels();
	}

	private static void putBasicLabels(Class<?> clazz) {
		put(clazz, "name", M.Name);
		put(clazz, "description", M.Description);
		if (CategorizedEntity.class.isAssignableFrom(clazz))
			put(clazz, "category", M.Category);
	}

	private static void putCategoryLabels() {
		Class<?> clazz = Category.class;
		put(clazz, "modelType", M.ModelType);
		put(clazz, "name", M.Name);
		put(clazz, "category", M.Category);
	}

	private static void putLocationLabels() {
		Class<?> clazz = Location.class;
		putBasicLabels(clazz);
		put(clazz, "code", M.Code);
		put(clazz, "longitude", M.Longitude);
		put(clazz, "latitude", M.Latitude);
		put(clazz, "geometry", M.Geometry);
	}

	private static void putCurrencyLabels() {
		Class<?> clazz = Currency.class;
		putBasicLabels(clazz);
		put(clazz, "code", M.Code);
		put(clazz, "conversionFactor", M.ConversionFactor);
		put(clazz, "referenceCurrency", M.ReferenceCurrency);
	}

	private static void putActorLabels() {
		Class<?> clazz = Actor.class;
		putBasicLabels(clazz);
		put(clazz, "address", M.Address);
		put(clazz, "city", M.City);
		put(clazz, "country", M.Country);
		put(clazz, "email", M.Email);
		put(clazz, "telefax", M.Telefax);
		put(clazz, "telephone", M.Telephone);
		put(clazz, "website", M.Website);
		put(clazz, "zipCode", M.ZipCode);
	}

	private static void putSourceLabels() {
		Class<?> clazz = Source.class;
		putBasicLabels(clazz);
		put(clazz, "url", M.URL);
		put(clazz, "textReference", M.TextReference);
{'fraction_non_alphanumeric': 0.1370896184560781, 'fraction_numerical': 0.00044365572315882877, 'mean_word_length': 5.649705014749262, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '7391564', 'n_tokens_mistral': 3243, 'n_tokens_neox': 3045, 'n_words': 566}