myZagar / tool /break4all.sh
ye-nlp's picture
added tool/ folder
ff6f281
#!/bin/bash
# Define the base directory and the Python script
BASE_DIR="$HOME/exp/sylbreak4all/lang_detection/embedding"
SYLBREAK_SCRIPT="$BASE_DIR/sylbreak.py" # Replace with the correct path to sylbreak.py
INPUT_DIR="$BASE_DIR/eg_input"
# Loop through each .txt file in the eg_input directory
for file in "$INPUT_DIR"/*.txt; do
input_file="$file"
output_file="${file%.txt}.syl"
# Run the sylbreak.py script
python "$SYLBREAK_SCRIPT" --input "$input_file" --separator " " --output "$output_file"
# Remove the original file and rename the output file
rm "$input_file"
mv "$output_file" "$input_file"
echo "Processed: $input_file"
done
echo "Syllable breaking completed for all files."