lia_genere_phrase_mbrola 1.14 KB
#!/bin/csh
# Genere un fichier '.ola' par phrases a partir
# d'un fichier texte quelconque
#

if ( $#argv == 0 ) then
 echo 'Syntaxe : lia_genere_phrase_mbrola <fichier texte> [-reacc]'
 exit
endif

if ( "$1" == "-reacc" ) then
 if ( $#argv == 1 ) then
  echo 'Syntaxe : lia_genere_phrase_mbrola <fichier texte> [-reacc]'
  exit
 endif
 set FILE_TXT = $2
 set OPT_REACC = $1
else
 set FILE_TXT = $1
 if ( $#argv > 1 ) then
  if ( "$2" == "-reacc" ) then
   set OPT_REACC = $2
  else
   echo 'Error: '$2' is an unknown option ....'
   echo 'The only option accepted here is: -reacc'
   exit
  endif
 else
  set OPT_REACC = ""
 endif
endif

if ( ! -e $FILE_TXT ) then
 echo 'Error: the file '$FILE_TXT' does not exist ....'
 exit
endif


echo 'file='$FILE_TXT
$LIA_PHON_REP/script/lia_nett < $FILE_TXT | $LIA_PHON_REP/script/lia_taggreac $OPT_REACC >! $FILE_TXT.ecg
$LIA_PHON_REP/bin/lia_split_sentence $FILE_TXT.ecg $FILE_TXT
set n = 1
echo '  processing:'
while ( -e $FILE_TXT.$n )
 echo '    - sentence #'$n
 $LIA_PHON_REP/script/lia_phon < $FILE_TXT.$n | $LIA_PHON_REP/bin/lia_add_proso >! $FILE_TXT.$n.ola
 rm $FILE_TXT.$n
 @ n += 1
end
echo 'done'
rm $FILE_TXT.ecg