mirror of
https://github.com/privacore/open-source-search-engine.git
synced 2025-02-02 03:38:43 -05:00
28 lines
666 B
Bash
Executable File
28 lines
666 B
Bash
Executable File
#!/bin/bash
|
|
|
|
bd=`dirname $0`
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "`basename $0`: usage: <sto-directory> <output-file>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ -f "$2" ]; then
|
|
rm $2 || exit
|
|
fi
|
|
|
|
|
|
echo "===Making signature"
|
|
$bd/sto_convert.py signature --output_file="$2" || exit
|
|
#is it the original STO files, or have they been split into lexical entries?
|
|
if [ -d $1/noun -a -d $1/verb ]; then
|
|
$bd/sto_convert.py convert --input_tree=$1 --output_file=$2 || exit
|
|
else
|
|
for input_file in $1/STO_LMF_morphology_{adj,noun,pronoun,rest,verb}*.xml; do
|
|
echo "===Processing $input_file"
|
|
$bd/sto_convert.py convert --input_file=$input_file --output_file=$2 || exit
|
|
done
|
|
echo "===Done"
|
|
fi
|
|
exit 0
|