<commit_before>#!/bin/bash
function slide() {
    local -r TPUT=$(type -p tput)
    [ -x "$TPUT" ] || exit 1
    local -r IFS=''
    local -r MESSAGE=${1:-<Enter> Next slide | <ctrl+c> Quit}
    local -ri COLS=$($TPUT cols)
    local -ri ROWS=$($TPUT lines)
    local -i CENTER=0
    local -i LINENUM=0

    trap "$TPUT clear" 0
    $TPUT clear

    while read LINE; do
        [ "$LINE" == '!!center' ] && CENTER=1 && continue
        [ "$LINE" == '!!nocenter' ] && CENTER=0 && continue
        [ "$LINE" == '!!pause' ] && read -s < /dev/tty && continue
        [ "$LINE" == '!!sep' ] && printf -vLINE "%${COLS}s" '' && LINE=${LINE// /-}
        [ $CENTER -eq 1 ] && $TPUT cup $LINENUM $((($COLS-${#LINE})/2))
        printf "%s\n" "$LINE"
        let LINENUM++
    done
    $TPUT cup $ROWS $((($COLS-1)-${#MESSAGE})) && printf "$MESSAGE"
    read -s < /dev/tty
}<commit_msg>Fixed a minor bug when a line is longer than the terminal. Added code to move cursor out of the slide during pauses.<commit_after>#!/bin/bash
function slide() {
    local -r TPUT=$(type -p tput)
    [ -x "$TPUT" ] || exit 1
    local -r IFS=''
    local -r MESSAGE=${1:-<Enter> Next slide | <ctrl+c> Quit}
    local -ri COLS=$($TPUT cols)
    local -ri ROWS=$($TPUT lines)
    local -i CENTER=0
    local -i LINENUM=0

    trap "$TPUT clear" 0
    $TPUT clear

    while read LINE; do
        [ "$LINE" == '!!center' ] && CENTER=1 && continue
        [ "$LINE" == '!!nocenter' ] && CENTER=0 && continue
        [ "$LINE" == '!!pause' ] && read -s < /dev/tty && continue
        [ "$LINE" == '!!sep' ] && printf -vLINE "%${COLS}s" '' && LINE=${LINE// /-}
        [ $CENTER -eq 1 ] && $TPUT cup $LINENUM $((($COLS-${#LINE})/2)) || $TPUT cup $LINENUM 0
        printf "%s\n" "$LINE"
        $TPUT cup $ROWS $COLS && let LINENUM++
        [ ${#LINE} -gt $COLS ] && let LINENUM++
    done
    $TPUT cup $ROWS $((($COLS-1)-${#MESSAGE})) && printf "$MESSAGE"
    read -s < /dev/tty
}
{'fraction_non_alphanumeric': 0.21875, 'fraction_numerical': 0.010758196721311475, 'mean_word_length': 2.367241379310345, 'pattern_counts': {'":': 0, '<': 11, '<?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': '690518', 'n_tokens_mistral': 748, 'n_tokens_neox': 733, 'n_words': 211}