<commit_before>#!/bin/sh
set -e

# Check that a pdf is passed as input.
pdf="$1"
! test -f "$pdf" && echo 'Specify a pdf file to be converted to svg.' && exit 1

# Select the directory.
if [ "$2" = '' ] && echo "$2" | grep -v -e '.pdf$' > /dev/null; then
  d=$(basename "$pdf" .pdf)
elif [ "$2" = '' ] ; then
  d=$"$pdf"2svg
else
  d="$2"
fi

# Check that it's available
test -e "$d" &&
  echo "The directory ${d} already exists; remove it or specify a different output directory." &&
  exit 1

(
  cd $d
  ln -s 
)
echo inkscape -zl "$pdf"<commit_msg>stuff<commit_after>#!/bin/sh
set -e

# Check that a pdf is passed as input.
pdf="$1"
! test -f "$pdf" && echo 'Specify a pdf file to be converted to svg.' && exit 1

# Select the directory.
if [ "$2" = '' ] ; then
  d=$"$pdf"2svg
else
  d="$2"
fi

# Check that it's available
test -e "$d" &&
  echo "The directory ${d} already exists; remove it or specify a different output directory." &&
  exit 1

# Create the directory
mkdir -p "$d"
ln -s "$d/original.pdf" "$pdf"
(
  set -e
  cd "$d"
  pdftk original.pdf burst output .%d.pdf
  for page in .[0-9]*.pdf; do
    number=$(basename $page .pdf)
    inkscape -zl $number.svg $number.pdf
  done
)
{'fraction_non_alphanumeric': 0.17391304347826086, 'fraction_numerical': 0.013377926421404682, 'mean_word_length': 2.99, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2161977', 'n_tokens_mistral': 463, 'n_tokens_neox': 453, 'n_words': 172}