<commit_before>#!/bin/sh

# Uses some careful sed-ing to trace a term through all of the term stages
# (frame, termgen, reify, Z3 reify).

STARLING="./bin/Debug/starling.exe"

if [ $# != 2 ];
then
	echo "usage: $0 FILE TERM"
	exit 1
fi

# The sed pattern to use to filter.
# Ugly, but does the job.
#
# Theory: select everything between $2: and the next numeric heading.
# Then, delete the numeric headings.
PATTERN="/^$2:/,/^[0-9][0-9]*:/ {/^[0-9][0-9]*:/d; p}"

echo "Framer:"
mono $STARLING -hF $1 | sed -n "$PATTERN"
echo "TermGen:"
mono $STARLING -hT $1 | sed -n "$PATTERN"
echo "Reify:"
mono $STARLING -hr $1 | sed -n "$PATTERN"
echo "Z3:"
mono $STARLING -hR $1 | sed -n "$PATTERN"<commit_msg>Make trace.sh more portable.<commit_after>#!/bin/sh

# Uses some careful sed-ing to trace a term through all of the term stages
# (frame, termgen, reify, Z3 reify).

STARLING="./bin/Debug/starling.exe"
SED=${SED:-"sed"}

if [ $# != 2 ];
then
	echo "usage: $0 FILE TERM"
	exit 1
fi

# The sed pattern to use to filter.
# Ugly, but does the job.
#
# Theory: select everything between $2: and the next numeric heading.
# Then, delete the numeric headings.
SELECT_PATTERN="/^$2:/,/^[0-9][0-9]*:/p"
DELETE_PATTERN="/^[0-9][0-9]*:/d"

echo "Framer:"
mono $STARLING -hF $1 | $SED -n "$SELECT_PATTERN" | $SED "$DELETE_PATTERN"
echo "TermGen:"
mono $STARLING -hT $1 | $SED -n "$SELECT_PATTERN" | $SED "$DELETE_PATTERN"
echo "Reify:"
mono $STARLING -hr $1 | $SED -n "$SELECT_PATTERN" | $SED "$DELETE_PATTERN"
echo "Z3:"
mono $STARLING -hR $1 | $SED -n "$SELECT_PATTERN" | $SED "$DELETE_PATTERN"
{'fraction_non_alphanumeric': 0.1819330385344283, 'fraction_numerical': 0.024005053695514846, 'mean_word_length': 3.9655172413793105, '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': '2688226', 'n_tokens_mistral': 681, 'n_tokens_neox': 647, 'n_words': 206}