<commit_before>rm -rf ".build/" &&
mkdir ".build" && 
cp -R "src/lib/" ".build/" &&
flex -o".build/Lexer.cpp" "src/Lexer.l" && 
g++ -std=gnu++11 -o ".build/Program" ".build/Lexer.cpp"<commit_msg>Designed more complex build script<commit_after>#!/bin/bash
# Tupin build script

#################################################
 
BUILD_PATH=".build"
SOURCE_PATH="src"
LIB_PATH="$SOURCE_PATH/lib"
TEST_PATH="$SOURCE_PATH/test"
PROGRAM_FILE="$BUILD_PATH/Program.exe"

#################################################
 
function compile
{
    if [ -d "$BUILD_PATH" ]; then
        echo "Removing old build path..."
        rm -rf "$BUILD_PATH/"
    fi

    echo "Creating build path..."
    mkdir "$BUILD_PATH/"

    echo "Copying libraries..."
    cp -R "$LIB_PATH/" "$BUILD_PATH/"

    echo "Compiling lex file..."
    flex -o"$BUILD_PATH/Lexer.cpp" "$SOURCE_PATH/Lexer.l"

    echo "Compiling C++ file..."
    g++ -std=gnu++11 -o "$PROGRAM_FILE" "$BUILD_PATH/Lexer.cpp"
}

function run
{   
    compile

    echo "Starting program..."
    "./$PROGRAM_FILE"
}

function test 
{
    compile

    echo "Running tests..."
    g++ -std=gnu++11 -o ".build/Test.exe" "$TEST_PATH/Test.cpp"
    "./$BUILD_PATH/Test.exe"
}

function help
{
    echo "Tupin builder options:"
    echo "  -c | compile  Just compile."
    echo "  -h | help     Shows this message."
    echo "  -r | run      Opens the program after compiling."
    echo "  -t | test     Runs tests after compiling."
}

#################################################
    
if [ "$1" == "" ]; then
    compile
    exit
fi

while [ "$1" != "" ]; do
    case $1 in         
        -h | --help | help )    help
                                exit
                                ;;
        -c | compile )          compile
                                exit
                                ;;
        -t | test )             test
                                exit
                                ;;                                
        -r | run )              run
                                exit
                                ;;
        * )                     help
                                exit 1
    esac
    shift
done
{'fraction_non_alphanumeric': 0.19416590701914313, 'fraction_numerical': 0.004557885141294439, 'mean_word_length': 1.4470457079152732, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6824058', 'n_tokens_mistral': 677, 'n_tokens_neox': 625, 'n_words': 159}