privacore-open-source-searc.../generate_query_stop_words.sh
2017-12-22 15:48:03 +01:00

19 lines
306 B
Bash
Executable File

#!/bin/bash
if [ $# -ne 3 ]; then
echo "`basename $0`: usage: <langcode> <inputfile> <outputfile>" >&2
exit 99
fi
echo "static const char *s_query_stop_words_$1[] = {" >$3
cat $2 |
tr -d ' ,' |
cut -d/ -f1 |
egrep -v '^$' |
awk '{print " \"" $1 "\","}' |
cat - >>$3
echo " NULL" >>$3
echo "};" >>$3