<commit_before>package com.sourcegraph.javagraph;

import org.apache.commons.lang3.SystemUtils;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;

public class PathUtil {

    public static final Path CWD = SystemUtils.getUserDir().toPath().toAbsolutePath().normalize();

    public static String normalize(String path) {
        if (SystemUtils.IS_OS_WINDOWS) {
            return path.replace('\\', '/');
        } else {
            return path;
        }
    }

    public static String relativizeCwd(String path) {
        return normalize(CWD.relativize(Paths.get(path).toAbsolutePath()).normalize().toString());
    }

    public static Path concat(Path parent, Path child) {
        if (child.isAbsolute()) {
            return child;
        } else {
            return parent.resolve(child);
        }
    }

    public static File concat(File parent, File child) {<commit_msg>Android support<commit_after>package com.sourcegraph.javagraph;

import org.apache.commons.lang3.SystemUtils;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;

public class PathUtil {

    public static final Path CWD = SystemUtils.getUserDir().toPath().toAbsolutePath().normalize();

    public static String normalize(String path) {
        if (SystemUtils.IS_OS_WINDOWS) {
            return path.replace('\\', '/');
        } else {
            return path;
        }
    }

    public static String relativizeCwd(String path) {
        Path p = Paths.get(path).toAbsolutePath();
        if (p.startsWith(CWD)) {
            return normalize(CWD.relativize(p).normalize().toString());
        } else {
            // for example, Android projects may refer to a directory on other drive
            return normalize(p.normalize().toString());
        }
    }

    public static Path concat(Path parent, Path child) {
        if (child.isAbsolute()) {
            return child;
        } else {
            return parent.resolve(child);
        }
    }

    public static File concat(File parent, File child) {
{'fraction_non_alphanumeric': 0.11435523114355231, 'fraction_numerical': 0.0009732360097323601, 'mean_word_length': 2.467116357504216, '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': '3829633', 'n_tokens_mistral': 586, 'n_tokens_neox': 571, 'n_words': 139}