File size: 744 Bytes
437e44a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #!/bin/bash
# Generate EuroVoc dictionary
python get_eurovoc_dict.py
# Create output directory if it doesn't exist
mkdir -p outs_id/
# Process .jsonl.gz files in outs_id/
for input_file in outs/*.jsonl.gz; do
filename=$(basename "$input_file" .gz)
temp_file="outs_id_correct/${filename}.tmp"
output_file="outs_id_correct/${filename}.gz"
echo "Processing $filename..."
gunzip -c "$input_file" | python add_id.py /dev/stdin "$temp_file"
if [ -s "$temp_file" ]; then
gzip "$temp_file" -c > "$output_file"
rm -f "$temp_file"
echo "✓ Saved to $output_file"
else
echo "✗ Error: temp file is empty"
rm -f "$temp_file"
fi
done
echo "All files processed and compressed!" |