<commit_before>TARGET_DIRECTORY=$1"./"

SOURCE_DIRECTORY=`echo $0 | sed 's/\/[^\/]*$//g'`
SOURCES=`ls ${SOURCE_DIRECTORY} | grep -e "\.cpp$" -e "\.c$"`


for SOURCE in ${SOURCES};
do
    SOURCE_WITHOUT_EXTENSION=`echo "${SOURCE}" | sed -e 's/\.cpp//g' -e 's/\.c//g'`
    TARGET_WITH_PATH="${TARGET_DIRECTORY}/lib${SOURCE_WITHOUT_EXTENSION}.so"
    SOURCE_WITH_PATH=${SOURCE_DIRECTORY}/${SOURCE}
    echo "gcc -shared -fPIC ${SOURCE_WITH_PATH} -o ${TARGET_WITH_PATH}"
    g++ -shared -fPIC ${SOURCE_WITH_PATH} -o ${TARGET_WITH_PATH}
done
<commit_msg>refinement of the filter build script<commit_after>#! /bin/bash

SCRIPT_DIRECTORY=`echo $0 | sed 's/\/[^\/]*$//g'`
SOURCES=`ls ${SCRIPT_DIRECTORY} | grep -e "\.cpp$" -e "\.c$"`

TARGET=$1
#compile only one file if a target has been specified
if [ "$TARGET" != "" ]; then
    SOURCES=${TARGET}
fi

TARGET_DIRECTORY=$2
if [ "$TARGET_DIRECTORY" == "" ]; then
    TARGET_DIRECTORY="."
fi


for SOURCE in ${SOURCES};
do
    EXTENSION=`echo "$SOURCE" | sed 's/.*\.cpp/cpp/g' | sed 's/.*\.c/c/g'`
    SOURCE_WITHOUT_EXTENSION=`echo "${SOURCE}" | sed -e 's/\.cpp//g' -e 's/\.c//g'`
    TARGET_WITH_PATH="${TARGET_DIRECTORY}/lib${SOURCE_WITHOUT_EXTENSION}.so"
    SOURCE_WITH_PATH=${SCRIPT_DIRECTORY}/${SOURCE}

    if [ "$EXTENSION" == "cpp" ]; then
        echo "g++ -shared -fPIC ${SOURCE_WITH_PATH} -o ${TARGET_WITH_PATH}"
        g++ -shared -fPIC ${SOURCE_WITH_PATH} -o ${TARGET_WITH_PATH}
    elif [ "$EXTENSION" == "c" ]; then
        echo "gcc -shared -fPIC ${SOURCE_WITH_PATH} -o ${TARGET_WITH_PATH}"
        gcc -shared -fPIC ${SOURCE_WITH_PATH} -o ${TARGET_WITH_PATH}
    else
        echo "unrecognized extenstion $EXTENSION $SOURCE"
    fi
done

{'fraction_non_alphanumeric': 0.1983519717480871, 'fraction_numerical': 0.002942907592701589, 'mean_word_length': 3.6575342465753424, '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': '2717592', 'n_tokens_mistral': 694, 'n_tokens_neox': 647, 'n_words': 142}