File: testvoc-eu-en

package info (click to toggle)
apertium-eu-en 0.3.1~r56205-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 17,704 kB
  • sloc: xml: 2,491; makefile: 91; sh: 61
file content (75 lines) | stat: -rwxr-xr-x 3,272 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
PREFIX=apertium-eu-en
LANG1=eu
LANG2=en
FILTERTAG="<prn><enc>"

# FASE 1
echo "=======================";
echo "Comprovaci superficial";
echo "=======================";
echo -n "Calculant expansi inicial...";
if [ -e $PREFIX.$1.metadix ];
then xsltproc buscaPar.xsl $PREFIX.$1.metadix | uniq > tmp1gen.xsl 	 
     xsltproc tmp1gen.xsl $PREFIX.$1.metadix >$PREFIX.$1.dixtmp1 
     rm tmp1gen.xsl
     lt-expand $PREFIX.$1.dixtmp1 | awk 'BEGIN{FS=":"}{if($2!="<") printf("^.<sent>$ ^%s$\n",$NF)}' |apertium-pretransfer | grep -v "REGEXP" > comp-$1-$2.expand
     rm $PREFIX.$1.dixtmp1
else lt-expand $PREFIX.$1.dix | awk 'BEGIN{FS=":"}{if($2!="<") printf("^.<sent>$ ^%s$\n",$NF)}' |apertium-pretransfer | grep -v "REGEXP" > comp-$1-$2.expand
fi
echo " fet.";
echo -n "Calculant expansi filtrada...";
grep -v "$FILTERTAG" comp-$1-$2.expand >comp-$1-$2.filtered
echo " fet.";
echo -n "Executant el traductor..."
apertium-transfer $PREFIX.$1-$2.t1x $1-$2.t1x.bin $1-$2.autobil.bin < comp-$1-$2.filtered | \
apertium-interchunk $PREFIX.$1-$2.t2x $1-$2.t2x.bin | \
apertium-postchunk $PREFIX.$1-$2.t3x $1-$2.t3x.bin | \
lt-proc -d $1-$2.autogen.bin > comp-$1-$2.trans
echo " fet.";
echo -n "Detectant errades i guardant-les en errors-$1-$2.superficial..."
paste comp-$1-$2.filtered comp-$1-$2.trans > comprovacio-$1-$2
egrep "(@|/|. #)" comprovacio-$1-$2 > errors-$1-$2.superficial
echo " fet."
echo "==========================" >> errors-$1-$2.superficial
echo "ALTRES ERRADES DE BILINGE" >> errors-$1-$2.superficial
echo "==========================" >> errors-$1-$2.superficial
echo -n "Expandint diccionari bilinge... "
if [ $1-$2 = $LANG1-$LANG2 ]
then lt-expand $PREFIX.$LANG1-$LANG2.dix | awk 'BEGIN{FS=":"}{if($2!="<") printf("^.<sent>$ ^%s$\n",$1)}' | grep -v "REGEXP" > $$.expand
else lt-expand $PREFIX.$LANG1-$LANG2.dix | awk 'BEGIN{FS=":"}{if($2!="<") printf("^.<sent>$ ^%s$\n",$NF)}' | grep -v "REGEXP" > $$.expand
fi
echo " fet."
echo -n "Compilant diccionari convertit... "
if [ $1-$2 = $LANG1-$LANG2 ]
then lt-comp lr $PREFIX.$LANG1-$LANG2.dix $$.bin >/dev/null
else lt-comp rl $PREFIX.$LANG1-$LANG2.dix $$.bin >/dev/null
fi
echo " fet."
echo -n "Detectant errades i guardant-les en errors-$1-$2.superficial..."
awk 'BEGIN{FS=":";}{if($2 == ">") print "^" $1 "$"; else if($2=="<"); else print "^" $1 "$";}' <$$.expand|lt-proc -d $$.bin |grep "/" >>errors-$1-$2.superficial
echo " fet."a
rm $$.bin
#rm $$.expand
echo "";
echo "Comprovaci superficial finalitzada. Mireu en 'errors-$1-$2.superficial'"

echo ""
echo "===================="
echo "Comprovaci completa"
echo "===================="

# FASE 2
echo "Continuant comprovaci completa, ^C per a cancelar"
echo -n "Calculant expansi filtrada..."
grep "$FILTERTAG" comp-$1-$2.expand >comp-$1-$2.filtered
echo " fet."
echo -n "Executant el traductor..."
apertium-transfer $PREFIX.$1-$2.t1x $1-$2.t1x.bin $1-$2.autobil.bin < comp-$1-$2.filtered | \
apertium-interchunk $PREFIX.$1-$2.t2x $1-$2.t2x.bin | \
apertium-postchunk $PREFIX.$1-$2.t3x $1-$2.t3x.bin | \
lt-proc -d $1-$2.autogen.bin > comp-$1-$2.trans
echo " fet."
echo -n "Detectant errades i guardant-les en errors-$1-$2"
paste comp-$1-$2.filtered comp-$1-$2.trans > comprovacio-$1-$2
egrep "(@|/|. #)" comprovacio-$1-$2 > errors-$1-$2
echo " fet."