File: testvoc-apertium2-utf

package info (click to toggle)
apertium-spa-ita 0.2.0~r78826-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,204 kB
  • sloc: xml: 469; makefile: 119; sh: 24
file content (82 lines) | stat: -rwxr-xr-x 3,922 bytes parent folder | download | duplicates (2)
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
76
77
78
79
80
81
82
PREFIX=apertium-es-it
LANG1=es
LANG2=it
FILTERTAG="<prn><enc>"

# FASE PRELIMINAR
#echo "==================================";
#echo "Calculant nombre de lemes i regles";
#echo "==================================";
#echo -n "El nombre de lemes de '$1' és de: ";
#lt-expand $PREFIX.$1.dix | awk 'BEGIN{FS=":"}{if($2!="<") printf("%s$\n",$NF)}'| awk 'BEGIN{FS=">"}{print $1}'|uniq |wc -l 
#echo -n "El nombre de lemes de '$2' és de: ";
#lt-expand $PREFIX.$2.dix | awk 'BEGIN{FS=":"}{if($2!="<") printf("%s$\n",$NF)}'| awk 'BEGIN{FS=">"}{print $1}'|uniq |wc -l  
#echo -n "El nombre de correspondències al bilingüe es de: ";
#grep "</e>" $PREFIX.$LANG1-$LANG2.dix | wc -l
#echo -n "El nombre de regles de '$1' a '$2' és de: ";
#grep "</rule>" $PREFIX.$1-$2.t?x | wc -l
#echo -n "El nombre de regles de '$2' a '$1' és de: ";
#grep "</rule>" $PREFIX.$2-$1.t?x | wc -l
# FASE 1
echo "=======================";
echo "Comprovació superficial";
echo "=======================";
echo -n "Calculant expansió inicial...";
lt-expand $PREFIX.$1.dix | awk 'BEGIN{FS=":"}{if($2!="<") printf("^.<sent>$ ^%s$\n",$NF)}' |apertium-pretransfer | grep -v "REGEXP" > comp-$1-$2.expand
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 BILINGÜE" >> errors-$1-$2.superficial
echo "==========================" >> errors-$1-$2.superficial
echo -n "Expandint diccionari bilingüe... "
if [ $1-$2 = $LANG1-$LANG2 ]
then lt-expand $PREFIX.$LANG1-$LANG2.dix | awk 'BEGIN{FS=":"}{if($2!="<") printf("^.<sent>$ ^%s$\n",$(NF-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 "Dels verbs vull només els infinitius"
egrep -v "(<vb|<np>)" errors-$1-$2.superficial > errors-$1-$2.superficial-convb
egrep "(<vblex>/|<inf>)" errors-$1-$2.superficial >> errors-$1-$2.superficial-convb

echo "Comprovació superficial finalitzada. Mireu en 'errors-$1-$2.superficial-convb'"



# 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."