File: other-tests.sh

package info (click to toggle)
apertium-eo-en 1.0.0~r63833-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 28,044 kB
  • sloc: xml: 32,398; python: 364; sh: 318; makefile: 131
file content (47 lines) | stat: -rwxr-xr-x 1,922 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

if [ "$1" == "" ]; then
echo "Checking outstanding tests..."
LIST=`
wget -O - -q http://wiki.apertium.org/wiki/English_and_Esperanto/Outstanding_tests | grep -E '((<li>.*→)|<h2>)' | sed 's/<.*li>//g' | sed -r 's/[ \t]+/_/g'
`;
else
echo "Checking ALL tests..."
LIST=`
wget -O - -q http://wiki.apertium.org/wiki/English_and_Esperanto/Outstanding_tests | grep -E '((<li>.*→)|<h2>)' | sed 's/<.*li>//g' | sed -r 's/[ \t]+/_/g'
wget -O - -q http://wiki.apertium.org/wiki/English_and_Esperanto/Proposed_future_tests | grep -E '((<li>.*→)|<h2>)' | sed 's/<.*li>//g' | sed -r 's/[ \t]+/_/g'
wget -O - -q http://wiki.apertium.org/wiki/English_and_Esperanto/Rejected_tests | grep -E '((<li>.*→)|<h2>)' | sed 's/<.*li>//g' | sed -r 's/[ \t]+/_/g'
wget -O - -q http://wiki.apertium.org/wiki/English_and_Esperanto/Regression_tests | grep -E '((<li>.*→)|<h2>)' | sed 's/<.*li>//g' | sed -r 's/[ \t]+/_/g'
`;
fi


#LIST=`wget -O - -q http://wiki.apertium.org/wiki/English_and_Esperanto/Outstanding_tests | grep -E '((<li>.*→)|<h2>)' | sed 's/<.*li>//g' | sed 's/ /_/g'`;

cp *.mode modes/

for LINE in $LIST; do
	dir=`echo $LINE | cut -f2 -d'(' | cut -f1 -d')'`;

	if [ $dir = "en" ]; then
		mode="en-eo";
	elif [ $dir = "eo" ]; then
		mode="eo-en";
	else 
		echo ==`echo $LINE | sed 's/^.*_<span_class="mw-headline">//g' | sed 's/<\/span>.*//g' | sed 's/_/ /g'`==
		continue;
	fi

#	echo $LINE;
	SL=`echo $LINE | cut -f2 -d')' | sed 's/<i>//g' | sed 's/<\/i>//g' | cut -f2 -d'*' | sed 's/→/@/g' | cut -f1 -d'@' | sed 's/(note:/@/g' | sed 's/_/ /g'`;
	TL=`echo $LINE | sed 's/(\w\w)//g' | sed 's/<i>//g' | cut -f2 -d'*' | sed 's/<\/i>_→/@/g' | cut -f2 -d'@' | sed 's/_/ /g'`;

	TR=`echo $SL | apertium -d . $mode`;

	if [[ `echo $TR | tr '[A-Z]' '[a-z]'` != `echo $TL | tr '[A-Z]' '[a-z]'` ]]; then 
		echo -e $mode"\t "$SL"\n\t-$TL\n\t+ "$TR"\n";
	else
		echo -e $mode"\t "$SL"\nWORKS!\t $TL\n";
	fi

done