diff --git a/asr/models/simple-example/automate/simple-example_section1.fst b/asr/models/simple-example/automate/simple-example_section1.fst index 32673adcfb28b250bf1ba2ad1c98707922ab701a..e5c4a706642ce99afc3b62a9ca227874fa3f14b4 100644 Binary files a/asr/models/simple-example/automate/simple-example_section1.fst and b/asr/models/simple-example/automate/simple-example_section1.fst differ diff --git a/asr/models/simple-example/automate/simple-example_section2.fst b/asr/models/simple-example/automate/simple-example_section2.fst index a18c933e1fcb950472d67483cbe1696416e0643f..32fe174f2ad2b3b2369078f5f50581256f7e6c89 100644 Binary files a/asr/models/simple-example/automate/simple-example_section2.fst and b/asr/models/simple-example/automate/simple-example_section2.fst differ diff --git a/asr/tools/slu/src/compile_automate.sh b/asr/tools/slu/src/compile_automate.sh index 12a477737088a4ab3705f34588e4619b5de0cfa6..5b9658fdf28377c419849b0d4d0e4dd2528d1da0 100755 --- a/asr/tools/slu/src/compile_automate.sh +++ b/asr/tools/slu/src/compile_automate.sh @@ -2,12 +2,6 @@ prefix=$1 -dir=`dirname $0`/../../../ -export LD_LIBRARY_PATH=$dir/libs:$dir/libs/fst:$dir/libs/atlas:$PWD/src -export PATH=$dir/bin:$PATH - -set -e -u -o pipefail - WORDSYMB_I="--isymbols=""$prefix""_dico_word.txt" WORDSYMB_O="--osymbols=""$prefix""_dico_word.txt" @@ -15,8 +9,10 @@ WORDSYMB_O="--osymbols=""$prefix""_dico_word.txt" fstcompile $WORDSYMB_I $WORDSYMB_O "$prefix""_clean_tail.txt" > "$prefix""_clean_tail.fst" # compile glouton fstcompile $WORDSYMB_I "$prefix""_glouton.txt" > "$prefix""_glouton.fst" - +# compile section 0 cat "$prefix""_section0.txt" | fstcompile $WORDSYMB_I | fstunion - "$prefix""_glouton.fst" | fstclosure > "$prefix""_section0.fst" +# compilte exit and change section +cat "$prefix""_section0.txt" | fstcompile $WORDSYMB_I > "$prefix""_section0.basic.fst" nbsect=1 while [ "$nbsect" != 80 ] @@ -24,19 +20,23 @@ do if [ -e "$prefix""_section""$nbsect"".txt" ] then rm -f "$prefix""_section""$nbsect".fst + if [ `cat "$prefix""_section""$nbsect""_exit.txt"| wc -l` == 0 ] + then + echo "Error: no $prefix""_section""$nbsect""_exit.txt file" + exit + fi + cat "$prefix""_section""$nbsect""_exit.txt" | fstcompile $WORDSYMB_I > "$prefix""_section""$nbsect"".exit.fst" + fstunion "$prefix""_section""$nbsect"".exit.fst" "$prefix""_section0.basic.fst" > "$prefix""_section""$nbsect"".exit.basic.fst" if [ `cat "$prefix""_section""$nbsect"".txt" | wc -l` != 0 ] then - cat "$prefix""_section""$nbsect"".txt" | fstcompile $WORDSYMB_I > "$prefix""_section""$nbsect"".fst" - cat "$prefix""_section0.txt" | fstcompile $WORDSYMB_I > "$prefix""_section""$nbsect"".fst.tmp" - cat "$prefix""_section""$nbsect""_exit.txt" | fstcompile $WORDSYMB_I > "$prefix""_section""$nbsect"".fst.tmp"2 - fstunion "$prefix""_section""$nbsect"".fst.tmp" "$prefix""_section""$nbsect"".fst.tmp2" > "$prefix""_section""$nbsect"".fst.tmp4" - fstconcat "$prefix""_section""$nbsect"".fst" "$prefix""_section""$nbsect"".fst.tmp4" > "$prefix""_section""$nbsect"".fst.tmp6" - mv "$prefix""_section""$nbsect"".fst.tmp6" "$prefix""_section""$nbsect"".fst" - rm -f "$prefix""_section""$nbsect"".fst.tmp" "$prefix""_section""$nbsect"".fst.tmp2" "$prefix""_section""$nbsect"".fst.tmp4" + cat "$prefix""_section""$nbsect"".txt" | fstcompile $WORDSYMB_I > "$prefix""_section""$nbsect"".fst2" + fstconcat "$prefix""_section""$nbsect"".fst2" "$prefix""_section""$nbsect"".exit.basic.fst" > "$prefix""_section""$nbsect"".fst4" + fstunion "$prefix""_section""$nbsect"".fst4" "$prefix""_section""$nbsect"".exit.basic.fst" > "$prefix""_section""$nbsect"".fst" + else + cp "$prefix""_section""$nbsect"".exit.basic.fst" "$prefix""_section""$nbsect"".fst" fi + rm -f "$prefix""_section""$nbsect"".exit.fst" -f "$prefix""_section""$nbsect"".exit.basic.fst" -f "$prefix""_section""$nbsect"".fst2" -f "$prefix""_section""$nbsect"".fst4" fi - nbsect=$(($nbsect+1)) done - diff --git a/main.py b/main.py index ce64ed7affc2f1eaccda2898c8873169620dbef2..de8151d96f1e57445ae88acf8186c24c696a765b 100644 --- a/main.py +++ b/main.py @@ -57,7 +57,7 @@ class ScriptedASR(Gtk.Window): # slu self.fake_asr = Gtk.Entry() self.fake_asr.connect('key-press-event', self.simulate_asr) - vbox.pack_start(self.fake_asr, False, True, 5) + #vbox.pack_start(self.fake_asr, False, True, 5) slu_prefix = config_dict['slu_prefix'] slu_actions = config_dict['slu_actions']