<commit_before>#!/bin/sh
DIR=$1

NAMES="$(find ${DIR} -name '[a-z\-]*[0-9]*.*.txt' -exec basename {} \; | grep --only-matching '^[a-z\-]*' | sort -u)"

for NAME in $NAMES
do
    OUT_DIR="${DIR}${NAME}"
	mkdir -p $OUT_DIR
	find ${DIR} -name "${NAME}[0-9]*.*.txt" -exec mv {} $OUT_DIR \;
done<commit_msg>Update sort to generate a log of files<commit_after>#!/bin/sh
DIR=$1
log="${DIR}paperstats.log"

NAMES="$(find ${DIR} -name '[a-z\-]*[0-9]*.*.txt' -maxdepth 1 -exec basename {} \; | grep --only-matching '^[a-z\-]*' | sort -u)"

for NAME in $NAMES
do
    OUT_DIR="${DIR}${NAME}"
	mkdir -p $OUT_DIR
	find ${DIR} -name "${NAME}[0-9]*.*.txt" -exec mv {} $OUT_DIR \;
	count="$(find ${OUT_DIR} -name '*.txt' -maxdepth 1 | wc -l)"
	echo "${NAME}\t${count}" >> $log
done
{'fraction_non_alphanumeric': 0.2787958115183246, 'fraction_numerical': 0.015706806282722512, 'mean_word_length': 3.526627218934911, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1652979', 'n_tokens_mistral': 336, 'n_tokens_neox': 318, 'n_words': 80}