<commit_before>package lux.index.analysis;

import java.io.Reader;

import lux.index.IndexConfiguration;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.LowerCaseFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardTokenizer;

public final class DefaultAnalyzer extends Analyzer {

    // TODO wrap an existing Analyzer
    
    @Override
    public TokenStream tokenStream(String fieldName, Reader reader) {
        return new LowerCaseFilter(IndexConfiguration.LUCENE_VERSION, new StandardTokenizer(IndexConfiguration.LUCENE_VERSION, reader));
    }

}

/*
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 */<commit_msg>Added ascii folding (diacritic insensitivity)<commit_after>package lux.index.analysis;

import java.io.Reader;

import lux.index.IndexConfiguration;

import org.apache.lucene.analysis.ASCIIFoldingFilter;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.LowerCaseFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardTokenizer;

public final class DefaultAnalyzer extends Analyzer {

    @Override
    public TokenStream tokenStream(String fieldName, Reader reader) {
        return new LowerCaseFilter(IndexConfiguration.LUCENE_VERSION, 
                new ASCIIFoldingFilter(
                        new StandardTokenizer(IndexConfiguration.LUCENE_VERSION, reader)));
    }

}

/*
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 */
{'fraction_non_alphanumeric': 0.08365226899945326, 'fraction_numerical': 0.004373974849644614, 'mean_word_length': 4.0974930362116995, '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': '3829641', 'n_tokens_mistral': 542, 'n_tokens_neox': 505, 'n_words': 147}