Blame view

egs/yomdle_zh/v1/local/prepare_dict.sh 647 Bytes
8dcb6dfcb   Yannick Estève   first commit
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
  #!/usr/bin/env bash
  
  # Copyright      2017  Hossein Hadian
  #                2017  Chun Chieh Chang
  #                2017  Ashish Arora
  
  # This script prepares the dictionary.
  
  set -e
  dir=data/local/dict
  data_dir=data
  
  . ./utils/parse_options.sh || exit 1;
  
  base_dir=$(echo "$DIRECTORY" | cut -d "/" -f2)
  
  mkdir -p $dir
  
  local/prepare_lexicon.py --data-dir $data_dir $dir
  
  cut -d' ' -f2- $dir/lexicon.txt | sed 's/SIL//g' | tr ' ' '
  ' | sort -u | sed '/^$/d' >$dir/nonsilence_phones.txt || exit 1;
  
  echo '<sil> SIL' >> $dir/lexicon.txt
  
  echo SIL > $dir/silence_phones.txt
  
  echo SIL >$dir/optional_silence.txt
  
  echo -n "" >$dir/extra_questions.txt