File: testcorpus_en-eo.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 (32 lines) | stat: -rwxr-xr-x 1,101 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
#!/bin/bash

TMP=/tmp/en-eo
CRP=corpa/en.crp.txt
mkdir -p testcache
NOVA=testcache/corpus_en-eo_nova_traduko.txt
ORIGINA=testcache/corpus_en-eo_origina_traduko.txt

if [ ! -e $CRP ]
then
	echo Elpakas $CRP
	bunzip2 -c corpa/enwiki.crp.txt.bz2 > $CRP
fi

#make -s -j 3 && cat $CRP | apertium -d . en-eo > $NOVA || exit
#make -s -j 3 && cat $CRP | apertium -d . en-eo-bytecode > $NOVA || exit
cat $CRP | apertium -d . en-eo-bytecode-cg > $NOVA || exit
echo
grep '#' $NOVA && echo -e "^ Estis mankoj en la cellingva dix, montrata supre ^\n"
grep '@' $NOVA && echo -e "^ Estis mankoj en la dulingva dix, montrata supre ^\n"

if [ -e $ORIGINA ]
then
	diff -w $ORIGINA $NOVA | grep -r '[<>]' > $TMP-crpdiff.txt && for i in `cut -c3-8 $TMP-crpdiff.txt | sort -un`; do echo  --- $i ---; grep -r "^ *$i\." $CRP; grep -r "^. *$i\." $TMP-crpdiff.txt; done > testcorpus_en-eo.txt
	echo "Estis `cut -c3-8 $TMP-crpdiff.txt | sort -un | wc -l` diferenco(j) - rigardu en: testcorpus_en-eo.txt"
	echo
fi

echo "Se vi volas uzi la nunan version por kompari venontajn versiojn, voku nun:"
echo "mv $NOVA $ORIGINA"
echo