File: repeat-functionality.sh

package info (click to toggle)
hfst 3.16.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,532 kB
  • sloc: cpp: 101,875; sh: 6,717; python: 5,225; yacc: 4,985; lex: 2,900; makefile: 2,017; xml: 6
file content (53 lines) | stat: -rwxr-xr-x 1,455 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
TOOLDIR=../../tools/src
TOOL=
COMPARE_TOOL=
FORMAT_TOOL=

if [ "$1" = '--python' ]; then
    TOOL="python3 ./hfst-repeat.py"
    COMPARE_TOOL="python3 ./hfst-compare.py"
    FORMAT_TOOL="python3 ./hfst-format.py"
else
    TOOL=$TOOLDIR/hfst-repeat
    COMPARE_TOOL=$TOOLDIR/hfst-compare
    FORMAT_TOOL=$TOOLDIR/hfst-format
    for tool in $TOOL $COMPARE_TOOL $FORMAT_TOOL; do
	if ! test -x $tool; then
	    exit 77;
	fi
    done
fi

for i in "" .sfst .ofst .foma; do
    if ((test -z "$i") || $FORMAT_TOOL --list-formats | grep $i > /dev/null); then
        if test -f cat$i -a -f 2to4cats$i -a -f 0to3cats$i \
            -a -f 4cats$i -a -f 4toINFcats$i ; then
            if ! $TOOL -f 2 -t 4 cat$i > test ; then
                exit 1
            fi
            if ! $COMPARE_TOOL -s test 2to4cats$i  ; then
                exit 1
            fi
            if ! $TOOL -t 3 cat$i > test ; then
                exit 1
            fi
            if ! $COMPARE_TOOL -s test 0to3cats$i  ; then
                exit 1
            fi
            if ! $TOOL -f 4 -t 4 cat$i > test ; then
                exit 1
            fi
            if ! $COMPARE_TOOL -s test 4cats$i  ; then
                exit 1
            fi
            if ! $TOOL -f 4 cat$i > test ; then
                exit 1
            fi
            if ! $COMPARE_TOOL -s test 4toINFcats$i  ; then
                exit 1
            fi
            rm test;
        fi
    fi
done