<commit_before>##
##  Runs the cli script $PROG
##

if [ ! $PROG ] ; then { echo 'Missing $PROG environment variable. You should not call runcli.sh directly' ; exit 1; } fi

JAVA=$(which java)

command -v $JAVA >/dev/null 2>&1 || { echo $PROG ' requires java in the $PATH!'; exit 1; }

VERSION=$($JAVA -version 2>&1 | grep ' version' | awk '{ print substr($3, 2, length($3)-2); }')
JAVA_MINOR=$(echo $VERSION | tr "." " " | cut -d " " -f2)

if [ "$JAVA_MINOR" -lt "7" ]; then
  echo "$PROG requires a Java version of at least 7 to function."
  echo "Please install a JRE 1.7 or greater."
  exit 1
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

WTESTJAR=$DIR/../cli/$PROG/target/$PROG*-with-*.jar

if [ -e $WTESTJAR ]; then
    $JAVA $JAVA_OPTS -jar $WTESTJAR "$@"
else
    echo "Couldn't find $WTESTJAR "
    echo -n "perhaps the project has not been built, "
    echo "try building the project with mvn install."
fi<commit_msg>Minor cleanups on runcli.sh<commit_after>##
##  Runs the cli script $PROG
##

if [ ! $PROG ] ; then
    echo 'Missing $PROG environment variable. You should not call runcli.sh directly.'
    exit 1
fi

if [ ! $JAVA ] ; then
    JAVA=$(which java)
fi

command -v $JAVA >/dev/null 2>&1 || { echo $PROG ' requires $JAVA enviornment variable or java in the system path!'; exit 1; }

VERSION=$($JAVA -version 2>&1 | grep ' version' | awk '{ print substr($3, 2, length($3)-2); }')
JAVA_MINOR=$(echo $VERSION | tr "." " " | cut -d " " -f2)

if [ "$JAVA_MINOR" -lt "7" ]; then
  echo "$PROG requires a Java version of at least 7 to function."
  echo "Please install a JRE 1.7 or greater."
  exit 1
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

WTESTJAR=$DIR/cli/$PROG/target/$PROG*-with-*.jar

if [ -e $WTESTJAR ]; then
    $JAVA $JAVA_OPTS -jar $WTESTJAR "$@"
else
    echo "Couldn't find $WTESTJAR "
    echo -n "Perhaps the project has not been built, "
    echo "try building the project with mvn install."
fi
{'fraction_non_alphanumeric': 0.16946564885496182, 'fraction_numerical': 0.017302798982188294, 'mean_word_length': 3.31140350877193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5470791', 'n_tokens_mistral': 773, 'n_tokens_neox': 720, 'n_words': 251}