<commit_before>#!/bin/sh

# Check that java is on the path

hash java 2>/dev/null || { echo >&2 "I require JDK but it's not installed.  Aborting."; exit 1; }
hash mvn 2>/dev/null || { echo >&2 "I require Maven but it's not installed.  Aborting."; exit 1; }

# Run all the samples being documented

mkdir target 2>/dev/null
mkdir target/out 2>/dev/null

# FREEMARKER_CMD="target/appassembler/bin/freemarker-cli"
FREEMARKER_CMD="java -jar target/freemarker-cli-2.0.0-BETA-4-SNAPSHOT-jar-with-dependencies.jar"

#############################################################################
# Info
#############################################################################

echo "templates/info.ftl"
$FREEMARKER_CMD -t templates/info.ftl README.md > target/out/info.txt || { echo >&2 "Test failed.  Aborting."; exit 1; }

#############################################################################
# Demo
#############################################################################

echo "templates/demo.ftl"
$FREEMARKER_CMD -t templates/demo.ftl README.md > target/out/demo.txt || { echo >&2 "Test failed.  Aborting."; exit 1; }

#############################################################################
# CSV
#############################################################################

echo "templates/csv/html/transform.ftl"
$FREEMARKER_CMD -t templates/csv/html/transform.ftl site/sample/csv/contract.csv > target/out/contract.html || { echo >&2 "Test failed.  Aborting."; exit 1; }

echo "templates/csv/md/transform.ftl"
$FREEMARKER_CMD -t templates/csv/md/transform.ftl site/sample/csv/contract.csv > target/out/contract.md || { echo >&2 "Test failed.  Aborting."; exit 1; }

echo "templates/csv/shell/curl.ftl"
$FREEMARKER_CMD -t ./templates/csv/shell/curl.ftl site/sample/csv/user.csv > target/out/curl.sh || { echo >&2 "Test failed.  Aborting."; exit 1; }
<commit_msg>Simplify end-to-end testing<commit_after>#!/bin/sh

# Check that java is on the path

hash java 2>/dev/null || { echo >&2 "I require JDK but it's not installed.  Aborting."; exit 1; }
hash mvn 2>/dev/null || { echo >&2 "I require Maven but it's not installed.  Aborting."; exit 1; }

# Run all the samples being documented

mkdir target 2>/dev/null
mkdir target/out 2>/dev/null

FREEMARKER_CMD="target/appassembler/bin/freemarker-cli"
# FREEMARKER_CMD="java -jar target/freemarker-cli-2.0.0-BETA-4-SNAPSHOT-jar-with-dependencies.jar"

#############################################################################
# Info
#############################################################################

echo "templates/info.ftl"
$FREEMARKER_CMD -t templates/info.ftl README.md > target/out/info.txt || { echo >&2 "Test failed.  Aborting."; exit 1; }

#############################################################################
# Demo
#############################################################################

echo "templates/demo.ftl"
$FREEMARKER_CMD -t templates/demo.ftl README.md > target/out/demo.txt || { echo >&2 "Test failed.  Aborting."; exit 1; }

#############################################################################
# CSV
#############################################################################

echo "templates/csv/html/transform.ftl"
$FREEMARKER_CMD -t templates/csv/html/transform.ftl site/sample/csv/contract.csv > target/out/contract.html || { echo >&2 "Test failed.  Aborting."; exit 1; }

echo "templates/csv/md/transform.ftl"
$FREEMARKER_CMD -t templates/csv/md/transform.ftl site/sample/csv/contract.csv > target/out/contract.md || { echo >&2 "Test failed.  Aborting."; exit 1; }

echo "templates/csv/shell/curl.ftl"
$FREEMARKER_CMD -t ./templates/csv/shell/curl.ftl site/sample/csv/user.csv > target/out/curl.sh || { echo >&2 "Test failed.  Aborting."; exit 1; }

{'fraction_non_alphanumeric': 0.36257928118393234, 'fraction_numerical': 0.011627906976744186, 'mean_word_length': 5.361344537815126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, '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': '1594841', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1136, 'n_words': 256}