mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-05 09:12:51 -06:00
27 lines
647 B
Bash
Executable File
27 lines
647 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
if [ $# -lt 1 ]; then
|
|
echo "Must specify trees file"
|
|
exit 1
|
|
fi
|
|
TREES=$1
|
|
ABSNAME="${1%.*}"
|
|
TREEBANK="$ABSNAME.treebank"
|
|
SCRIPT="tmp.gfs"
|
|
|
|
# echo "read_file -file=$TREES -lines -tree | linearize -treebank | write_file -file=$TREEBANK" | gf --run $ABSNAME*.gf
|
|
|
|
echo "Writing $SCRIPT"
|
|
: > $SCRIPT
|
|
while read tree; do
|
|
echo "linearize -treebank -bind $tree | write_file -file=$TREEBANK -append" >> "$SCRIPT"
|
|
echo "put_string \"\" | write_file -file=$TREEBANK -append" >> "$SCRIPT"
|
|
done < $TREES
|
|
|
|
echo "Writing $TREEBANK"
|
|
: > $TREEBANK
|
|
gf --run $ABSNAME*.gf < "$SCRIPT" | awk NF
|
|
|
|
echo "Removing $SCRIPT"
|
|
rm "$SCRIPT"
|