~ubuntu-branches/ubuntu/precise/dbacl/precise

« back to all changes in this revision

Viewing changes to src/tests/model-sym3.shin

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2005-05-07 12:59:53 UTC
  • Revision ID: james.westby@ubuntu.com-20050507125953-xzy2bwkb2qamglwm
Tags: upstream-1.9
ImportĀ upstreamĀ versionĀ 1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# maxent model symmetry check (-w 2) 2-grams with identical 
 
3
# length must have identical reference weights (but lambda weights will differ).
 
4
PATH=/bin:/usr/bin
 
5
DBACL=$TESTBIN/dbacl
 
6
 
 
7
prerequisite_command() {
 
8
    type $2 2>&1 > /dev/null
 
9
    if [ 0 -ne $? ]; then
 
10
        echo "$1: $2 not found, test will be skipped"
 
11
        exit 77
 
12
    fi
 
13
}
 
14
 
 
15
prerequisite_command $0 grep
 
16
prerequisite_command $0 tr
 
17
prerequisite_command $0 sort
 
18
prerequisite_command $0 wc
 
19
 
 
20
DBACL_PATH="`pwd`/`basename $0 .sh`_`date +"%Y%m%dT%H%M%S"`"
 
21
export DBACL_PATH
 
22
 
 
23
mkdir "$DBACL_PATH"
 
24
 
 
25
echo "The quick brown fox jumped over the lazy dog" \
 
26
    | $DBACL -l dummy -L uniform -d -q 2 \
 
27
    | grep -v '^#' \
 
28
    | awk '{print $2}' \
 
29
    | sort -u \
 
30
    | wc -l \
 
31
    > $DBACL_PATH/dummy.count
 
32
 
 
33
L=`cat $DBACL_PATH/dummy.count`
 
34
 
 
35
RESULT=`test x"$L" = x8`
 
36
 
 
37
rm -rf "$DBACL_PATH"
 
38
 
 
39
exit $RESULT
 
 
b'\\ No newline at end of file'