<commit_before>#! /usr/bin/env bash

SEED=1000
if [ "$1" != "" ]; then
    SEED="$1"
fi

ITERATIONS=1
if [ "$2" != "" ]; then
    ITERATIONS="$2"
fi

TIMEFORMAT=""
if [ "$3" != "" ]; then
    TIMEFORMAT="$3"
fi

# Function from SO answer by <NAME>
# http://stackoverflow.com/a/2990533/461813
echoerr() {
    echo -ne "$@" 1>&2;
}

exec_dir() {
    SCRIPT="exec.sh"

    if [ "" != "$3" ]; then
        SCRIPT="$3"
    fi
    echo " "
    echo "$1"
    cd "$2"
    if [[ -x "setup.sh" ]]; then
        ./setup.sh
    fi
    echoerr "\"$2\", \"$1\", $SEED, "
    for ((n=0;n<$ITERATIONS;n++))
    do
     echo "Iterating"
     ./$SCRIPT "$SEED" "$TIMEFORMAT"
    done
    if [[ -x "teardown.sh" ]]; then
        ./teardown.sh
    fi

    cd ..
}

echo " "
echo "Treffynnon benchmarker"
echo "^^^^^^^^^^^^^^^^^^^^^^"
echo " "
echo "################################"
echo "# Command line benching        #"
echo "################################"<commit_msg>Move heading into iterations<commit_after>#! /usr/bin/env bash

SEED=1000
if [ "$1" != "" ]; then
    SEED="$1"
fi

ITERATIONS=1
if [ "$2" != "" ]; then
    ITERATIONS="$2"
fi

TIMEFORMAT=""
if [ "$3" != "" ]; then
    TIMEFORMAT="$3"
fi

# Function from SO answer by <NAME>
# http://stackoverflow.com/a/2990533/461813
echoerr() {
    echo -ne "$@" 1>&2;
}

exec_dir() {
    SCRIPT="exec.sh"

    if [ "" != "$3" ]; then
        SCRIPT="$3"
    fi
    echo " "
    echo "$1"
    cd "$2"
    if [[ -x "setup.sh" ]]; then
        ./setup.sh
    fi
    
    for ((n=0;n<$ITERATIONS;n++))
    do
     echo "Iterating"
     echoerr "\"$2\", \"$1\", $SEED, "
     ./$SCRIPT "$SEED" "$TIMEFORMAT"
    done
    if [[ -x "teardown.sh" ]]; then
        ./teardown.sh
    fi

    cd ..
}

echo " "
echo "Treffynnon benchmarker"
echo "^^^^^^^^^^^^^^^^^^^^^^"
echo " "
echo "################################"
echo "# Command line benching        #"
echo "################################"
{'fraction_non_alphanumeric': 0.28408501814411613, 'fraction_numerical': 0.03421461897356143, 'mean_word_length': 2.4464285714285716, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1898325', 'n_tokens_mistral': 779, 'n_tokens_neox': 723, 'n_words': 167}