<commit_before>package me.xdrop.jrand.data;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class AssetLoader {
    public List<String> loadAsset(String assetName) {
        ClassLoader classLoader = getClass().getClassLoader();
        File file = new File(classLoader.getResource(assetName).getFile());
        List<String> list = new ArrayList<>();
        reverse(list);
        try {
            BufferedReader reader = new BufferedReader(new FileReader(file));
            while(reader.ready()) {
                list.add(reader.readLine());
            }

        } catch (IOException e) {
           return new ArrayList<>();
        }
        return list;
    }

    public static void reverse(List<?> list) { rev(list); }
    private static <T> void rev(List<T> list) {
        List<T> tmp = new ArrayList<T>(list);
        for (int i = 0; i < list.size(); i++) {
            list.set(i, tmp.get(list.size() - i - 1));
        }
    }

}
<commit_msg>Update asset loader<commit_after>package me.xdrop.jrand.data;

import java.io.*;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class AssetLoader {
    public List<String> loadAsset(String assetName) {
        ClassLoader classLoader = getClass().getClassLoader();
        URL filename = classLoader.getResource(assetName);

        if (filename == null) return Collections.emptyList();

        File file = new File(filename.getFile());
        List<String> list = new ArrayList<>();
        try {
            BufferedReader reader = new BufferedReader(new FileReader(file));
            while(reader.ready()) {
                list.add(reader.readLine());
            }

        } catch (IOException e) {
           return new ArrayList<>();
        }
        return list;
    }

    public static void reverse(List<?> list) { rev(list); }

    private static <T> void rev(List<T> list) {
        List<T> tmp = new ArrayList<T>(list);
        for (int i = 0; i < list.size(); i++) {
            list.set(i, tmp.get(list.size() - i - 1));
        }
    }

}

{'fraction_non_alphanumeric': 0.13589015151515152, 'fraction_numerical': 0.001893939393939394, 'mean_word_length': 2.3015625, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, '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': '2761804', 'n_tokens_mistral': 615, 'n_tokens_neox': 603, 'n_words': 153}