<commit_before>package com.kiefer.gradle;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.regex.Pattern;
import java.util.stream.Stream;

public class Program {
    public static boolean onPath(String program) {
        return Stream.of(System.getenv("PATH").split(Pattern.quote(File.pathSeparator)))
                .map(Paths::get)
                .anyMatch(path -> Files.exists(path.resolve(program)));
    }

    private Program () {}
}<commit_msg>try and make the path checker more windows friendly<commit_after>package com.kiefer.gradle;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.regex.Pattern;
import java.util.stream.Stream;

public class Program {
    public static boolean onPath(String program) {

        String[] paths = System.getenv("PATH").split(Pattern.quote(File.pathSeparator));
        String pathExtEnv = System.getenv("PATHEXT");
        String[] extensions = pathExtEnv != null ? pathExtEnv.split(Pattern.quote(File.separator)) : new String[0];

        for (String path : paths) {
            if (new File(path, program).exists()) {
                return true;
            }

            for (String extension : extensions) {
                if (new File(path, program + "." + extension).exists()) {
                    return true;
                }
            }

        }
        return false;
    }

    private Program () {}
}
{'fraction_non_alphanumeric': 0.12354152367879204, 'fraction_numerical': 0.0006863417982155113, 'mean_word_length': 2.513253012048193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5442852', 'n_tokens_mistral': 418, 'n_tokens_neox': 401, 'n_words': 93}