def get_analysis():
    analyzers = {}
    filters = {}

    # The keys are locales to look up to decide the analyzer's name.
    # The values are the language name to set for Snowball.
    snowball_langs = {
        'eu': 'Basque',
        'ca': 'Catalan',
        'da': 'Danish',
        'nl': 'Dutch',
        'en-US': 'English',
        'fi': 'Finnish',
        'fr': 'French',
        'de': 'German',
        'hu': 'Hungarian',
        'it': 'Italian',
        'no': 'Norwegian',
        'pt-BR': 'Portuguese',
        'ro': 'Romanian',
        'ru': 'Russian',
        'es': 'Spanish',
        'sv': 'Swedish',
        'tr': 'Turkish',
    }

    for locale, language in snowball_langs.items():
        analyzer_name = es_analyzer_for_locale(locale, synonyms=False)
        analyzers[analyzer_name] = {
            'type': 'snowball',
            'language': language,
        }

        # The snowball analyzer is actually just a shortcut that does
        # a particular set of tokenizers and analyzers. According to
        # the docs, the below is the same as that, plus synonym handling.

        if locale in config.ES_SYNONYM_LOCALES:
            analyzer_name = es_analyzer_for_locale(locale, synonyms=True)
            analyzers[analyzer_name] = {
                'type': 'custom',
                'tokenizer': 'standard',
                'filter': [
                    'standard',
                    'lowercase',
                    'synonyms-' + locale,
                    'stop',
                    'snowball-' + locale,
                ],
            }

    for locale in config.ES_SYNONYM_LOCALES:
        filter_name, filter_body = es_get_synonym_filter(locale)
        filters[filter_name] = filter_body
        filters['snowball-' + locale] = {
            'type': 'snowball',
            'language': snowball_langs[locale],
        }

    # Done!
    return {
        'analyzer': analyzers,
        'filter': filters,
    }
Generate all our custom analyzers, tokenizers, and filters
dataset/ETHPy150Open mozilla/kitsune/kitsune/search/es_utils.py/get_analysis