<commit_before>package org.pfaa.chemica.model;

public class IndustrialMaterialUtils {

	public static Condition getCanonicalCondition(IndustrialMaterial material, State state) {
		Integer temp = getCanonicalTemperature(material, state);
		if (temp == null) {
			return null;
		}
		return new Condition(temp, Constants.STANDARD_PRESSURE);
	}

	private static Integer getCanonicalTemperature(IndustrialMaterial material, State state) {
		switch(state) {
		case SOLID:
			if (material instanceof Fusible) {
				Fusion fusion = ((Fusible)material).getFusion();
				if (fusion != null) {
					return Math.min(fusion.getTemperature() - 1, Constants.STANDARD_TEMPERATURE);
				}
			}
			if (material instanceof Vaporizable) {
				Vaporization vaporization = ((Vaporizable)material).getVaporization();
				if (vaporization != null) {
					return Math.min(vaporization.getTemperature() - 1, Constants.STANDARD_TEMPERATURE);
				}
			}
			break;
		case LIQUID:
			if (material instanceof Fusible) {
				Fusion fusion = ((Fusible)material).getFusion();
				if (fusion != null) {
					return Math.max(fusion.getTemperature(), Constants.STANDARD_TEMPERATURE);
				} else {
					return null;
				}
			}
			break;
		case GAS:
			if (material instanceof Vaporizable) {
				Vaporization vaporization = ((Vaporizable)material).getVaporization();
				if (vaporization != null) {
					return Math.max(vaporization.getTemperature(), Constants.STANDARD_TEMPERATURE);
				} else {
					return null;
				}
			}
			break;
		default:
		}
		return Constants.STANDARD_TEMPERATURE;
	}

}<commit_msg>support liquid condition for room temp gases<commit_after>package org.pfaa.chemica.model;

public class IndustrialMaterialUtils {

	public static Condition getCanonicalCondition(IndustrialMaterial material, State state) {
		Integer temp = getCanonicalTemperature(material, state);
		if (temp == null) {
			return null;
		}
		return new Condition(temp, Constants.STANDARD_PRESSURE);
	}

	private static Integer getCanonicalTemperature(IndustrialMaterial material, State state) {
		switch(state) {
		case SOLID:
			if (material instanceof Fusible) {
				Fusion fusion = ((Fusible)material).getFusion();
				if (fusion != null) {
					return Math.min(fusion.getTemperature() - 1, Constants.STANDARD_TEMPERATURE);
				}
			}
			if (material instanceof Vaporizable) {
				Vaporization vaporization = ((Vaporizable)material).getVaporization();
				if (vaporization != null) {
					return Math.min(vaporization.getTemperature() - 1, Constants.STANDARD_TEMPERATURE);
				}
			}
			break;
		case LIQUID:
			if (material instanceof Fusible) {
				Fusion fusion = ((Fusible)material).getFusion();
				int lowerBound = Constants.STANDARD_TEMPERATURE;
				if (material instanceof Vaporizable) {
					Vaporization vaporization = ((Vaporizable) material).getVaporization();
					if (vaporization != null) {
						lowerBound = Math.min(lowerBound, vaporization.getTemperature() - 1);
					}
				}
				if (fusion != null) {
					return Math.max(fusion.getTemperature(), lowerBound);
				} else {
					return null;
				}
			}
			break;
		case GAS:
			if (material instanceof Vaporizable) {
				Vaporization vaporization = ((Vaporizable)material).getVaporization();
				if (vaporization != null) {
					return Math.max(vaporization.getTemperature(), Constants.STANDARD_TEMPERATURE);
				} else {
					return null;
				}
			}
			break;
		default:
		}
		return Constants.STANDARD_TEMPERATURE;
	}

}
{'fraction_non_alphanumeric': 0.1070185614849188, 'fraction_numerical': 0.0014501160092807424, 'mean_word_length': 3.837307152875175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2653138', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1056, 'n_words': 234}