Debian Codegraph @

tools/lou_maketable.d/wrap_patgen.sh

raw symbols SCIP
1 # liblouis Braille Translation and Back-Translation Library
2 #
3 # Copyright (C) 2017 Bert Frees
4 #
5 # This file is part of liblouis.
6 #
7 # liblouis is free software: you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as published
9 # by the Free Software Foundation, either version 2.1 of the License, or
10 # (at your option) any later version.
11 #
12 # liblouis is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with liblouis. If not, see <http://www.gnu.org/licenses/>.
19 #
20
21 set -e
22 DICTIONARY_FILE=${1}
23 PATTERN_FILE=${2}
24 PATOUT_FILE=${3}
25 TRANSLATE_FILE=${4}
26 LEFT_HYPHEN_MIN=${5}
27 LEFT_HYPHEN_MAX=${6}
28 HYPH_LEVEL=${7}
29 PAT_START=${8}
30 PAT_FINISH=${9}
31 GOOD_WEIGHT=${10}
32 BAD_WEIGHT=${11}
33 THRESHOLD=${12}
34 FIFO=tmp
35 rm -f $FIFO
36 mkfifo $FIFO
37 patgen $DICTIONARY_FILE $PATTERN_FILE $PATOUT_FILE $TRANSLATE_FILE <$FIFO &
38 echo $LEFT_HYPHEN_MIN $LEFT_HYPHEN_MAX >$FIFO
39 echo $HYPH_LEVEL $HYPH_LEVEL >$FIFO
40 echo $PAT_START $PAT_FINISH >$FIFO
41 echo $GOOD_WEIGHT $BAD_WEIGHT $THRESHOLD >$FIFO
42 echo y >$FIFO
43 wait $!
44 ret=$?
45 rm -f $FIFO
46 if [ $ret == 0 ]; then
47 touch $PATOUT_FILE pattmp.$HYPH_LEVEL
48 else
49 rm -f $PATOUT_FILE pattmp.$HYPH_LEVEL
50 fi
51 exit $ret