<commit_before>package com.github.antag99.textract.extract;

import java.io.File;

public final class Steam {
	private Steam() {
	}

	public static File findTerrariaDirectory() {
		// Check the windows registry for steam installation path
		if (System.getProperty("os.name").toLowerCase().contains("windows")) {
			try {
				String steamPath = WinRegistry.readString(WinRegistry.HKEY_CURRENT_USER,
						"Software\\Valve\\Steam", "SteamPath");
				File steamDirectory = new File(steamPath);
				if (isTerrariaDirectory(steamDirectory)) {
					return steamDirectory;
				}
			} catch (Throwable ignored) {
			}
		}

		// Else prompt the user
		return null;
	}

	public static boolean isTerrariaDirectory(File terrariaDirectory) {
		if (!terrariaDirectory.isDirectory()) {
			return false;
		}

		File terrariaExe = new File(terrariaDirectory, "Terraria.exe");
		File contentDirectory = new File(terrariaDirectory, "Content");

		return terrariaExe.exists() && contentDirectory.exists();
	}
}<commit_msg>Used terraria registry keys instead of steams<commit_after>package com.github.antag99.textract.extract;

import java.io.File;

public final class Steam {
	private Steam() {
	}

	public static File findTerrariaDirectory() {
		// Check the windows registry for steam installation path
		if (System.getProperty("os.name").toLowerCase().contains("windows")) {
			try {
				String terrariaPath = WinRegistry.readString(WinRegistry.HKEY_LOCAL_MACHINE,
						"SOFTWARE\\Re-Logic\\Terraria", "Install_Path");
				File terrariaDirectory = new File(terrariaPath);
				if (isTerrariaDirectory(terrariaDirectory)) {
					return terrariaDirectory;
				}
			} catch (Throwable ignored) {
			}
		}

		// Else prompt the user
		return null;
	}

	public static boolean isTerrariaDirectory(File terrariaDirectory) {
		if (!terrariaDirectory.isDirectory()) {
			return false;
		}

		File terrariaExe = new File(terrariaDirectory, "Terraria.exe");
		File contentDirectory = new File(terrariaDirectory, "Content");

		return terrariaExe.exists() && contentDirectory.exists();
	}
}
{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.0019408054342552159, 'mean_word_length': 4.341968911917099, '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': '3399960', 'n_tokens_mistral': 711, 'n_tokens_neox': 620, 'n_words': 144}