<commit_before>package nl.gogognome.textsearch.string;

/**
 * Case insensitive implementation of {@link StringSearch}.
 * Based on code from http://stackoverflow.com/questions/1126227/indexof-case-sensitive
 */
class CaseInsensitiveStringSearch implements StringSearch {

    public int indexOf(final String data, final String searchText) {
        int i = 0;
        if (data != null && searchText != null) {
            if (searchText.isEmpty()) {
                return 0;
            }
            int serchStrLength = searchText.length();
            char[] searchCharLc = new char[serchStrLength];
            char[] searchCharUc = new char[serchStrLength];
            searchText.toUpperCase().getChars(0, serchStrLength, searchCharUc, 0);
            searchText.toLowerCase().getChars(0, serchStrLength, searchCharLc, 0);
            int j = 0;
            for (int checkStrLength = data.length(); i < checkStrLength; i++) {
                char charAt = data.charAt(i);
                if (charAt == searchCharLc[j] || charAt == searchCharUc[j]) {
                    if (++j == serchStrLength) {
                        return i - j + 1;
                    }
                } else { // faster than: else if (j != 0) {
                    i = i - j;
                    j = 0;
                }
            }
        }
        return -1;
    }
}<commit_msg>Fixed typo in variable name.<commit_after>package nl.gogognome.textsearch.string;

/**
 * Case insensitive implementation of {@link StringSearch}.
 * Based on code from http://stackoverflow.com/questions/1126227/indexof-case-sensitive
 */
class CaseInsensitiveStringSearch implements StringSearch {

    public int indexOf(final String data, final String searchText) {
        int i = 0;
        if (data != null && searchText != null) {
            if (searchText.isEmpty()) {
                return 0;
            }
            int searchStringLength = searchText.length();
            char[] searchCharLc = new char[searchStringLength];
            char[] searchCharUc = new char[searchStringLength];
            searchText.toUpperCase().getChars(0, searchStringLength, searchCharUc, 0);
            searchText.toLowerCase().getChars(0, searchStringLength, searchCharLc, 0);
            int j = 0;
            for (int checkStrLength = data.length(); i < checkStrLength; i++) {
                char charAt = data.charAt(i);
                if (charAt == searchCharLc[j] || charAt == searchCharUc[j]) {
                    if (++j == searchStringLength) {
                        return i - j + 1;
                    }
                } else { // faster than: else if (j != 0) {
                    i = i - j;
                    j = 0;
                }
            }
        }
        return -1;
    }
}
{'fraction_non_alphanumeric': 0.11055095426719481, 'fraction_numerical': 0.012963629816348578, 'mean_word_length': 1.691860465116279, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7592687', 'n_tokens_mistral': 796, 'n_tokens_neox': 744, 'n_words': 194}