Newer
Older
dir=`dirname $0`/../../../
export LD_LIBRARY_PATH=$dir/libs:$dir/libs/fst:$dir/libs/atlas:$PWD/src
export PATH=$dir/bin:$PATH
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
WORDSYMB_I="--isymbols=""$prefix""_dico_word.txt"
WORDSYMB_O="--osymbols=""$prefix""_dico_word.txt"
rm -f "$prefix".fst
nbsect=1
while [ "$nbsect" != 80 ]
do
if [ -e "$prefix""_section""$nbsect"".txt" ]
then
rm -f "$prefix""_section""$nbsect".fst
if [ `cat "$prefix""_section""$nbsect"".txt" | wc -l` != 0 ]
then
cat "$prefix""_section""$nbsect"".txt" | fstcompile $WORDSYMB_I > "$prefix""_section""$nbsect"".fst"
fi
if [ -e "$prefix""_section""$nbsect".fst ]
then
if [ -e "$prefix".fst ]
then
fstconcat "$prefix".fst "$prefix""_section""$nbsect".fst > "$prefix".fst2
mv "$prefix".fst2 "$prefix".fst
else
cp "$prefix""_section""$nbsect".fst "$prefix".fst
fi
fi
if [ -e "$prefix""_section""$nbsect""_text.txt" ] && [ -e "$prefix""_section""$nbsect".fst ]
then
fstcompile --acceptor $WORDSYMB_I $WORDSYMB_O "$prefix""_section""$nbsect""_text.txt" > "$prefix""_section""$nbsect""_text.fst"
# check
nbli=`fstcompose "$prefix""_section""$nbsect""_text.fst" "$prefix""_section""$nbsect".fst | fstprint | wc -l`
echo "- Check section""$nbsect"": ""$nbli"
fi
fi
nbsect=$(($nbsect+1))
done
# compile tail
fstcompile $WORDSYMB_I $WORDSYMB_O "$prefix""_clean_tail.txt" > "$prefix""_clean_tail.fst"