<commit_before>#!/bin/bash
set -o errexit -o nounset -o history -o histexpand


no_problems_found=1
function SendEmail {
    if [[ $no_problems_found -eq 0 ]]; then
        send_email --recipients="$email_address" --subject="$0 passed on $(hostname)" \
                   --message-body="The new keyword_normalizations.map file was successfully generated."
        exit 0
    else
        send_email --priority=high --recipients="$email_address" --subject="$0 failed on $(hostname)"  \
                   --message-body="$(printf '%q' "$(echo -e "Check /usr/local/var/log/tuefind/generate_keyword_normalizations.log for details.\n\n"" \
                                     "$(tail -20 /usr/local/var/log/tuefind/generate_keyword_normalizations.log)" \
                                     "'\n')")"
        exit 1
    fi
}
trap SendEmail EXIT


function Usage() {
    echo "Usage: $0 email_address"
    exit 1
}


# Argument processing
if [[ $# != 1 ]]; then
    Usage
fi
email_address=$1


/usr/local/bin/generate_keyword_normalizations ptah.ub.uni-tuebingen.de:8080 /tmp/new_keyword_normalization.map
mv /tmp/new_keyword_normalization.map /usr/local/var/lib/tuelib/keyword_normalization.map
no_problems_found=0<commit_msg>Fixed debugging code.<commit_after>#!/bin/bash
set -o errexit -o nounset -o history -o histexpand


no_problems_found=1
function SendEmail {
    if [[ $no_problems_found -eq 0 ]]; then
        send_email --recipients="$email_address" --subject="$0 passed on $(hostname)" \
                   --message-body="The new keyword_normalizations.map file was successfully generated."
        exit 0
    else
        send_email --priority=high --recipients="$email_address" --subject="$0 failed on $(hostname)"  \
                   --message-body="$(printf '%q' "$(echo -e "Check /usr/local/var/log/tuefind/generate_keyword_normalizations.log for details.\n\n"" \
                                     "$(tail -20 /usr/local/var/log/tuefind/generate_keyword_normalizations.log)" \
                                     "'\n')")"
        exit 1
    fi
}
trap SendEmail EXIT


function Usage() {
    echo "Usage: $0 email_address"
    exit 1
}


# Argument processing
if [[ $# != 1 ]]; then
    Usage
fi
email_address=$1


/usr/local/bin/generate_keyword_normalizations localhost:8080 /tmp/new_keyword_normalization.map
mv /tmp/new_keyword_normalization.map /usr/local/var/lib/tuelib/keyword_normalization.map
no_problems_found=0
{'fraction_non_alphanumeric': 0.1273024969300041, 'fraction_numerical': 0.01391731477691363, 'mean_word_length': 2.56268221574344, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '510357', 'n_tokens_mistral': 799, 'n_tokens_neox': 744, 'n_words': 165}