Blame view

egs/wsj/s5/local/dict/reverse_dict.pl 372 Bytes
8dcb6dfcb   Yannick Estève   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  #!/usr/bin/env perl
  
  # Used in conjunction with get_rules.pl
  # example input line: XANTHE  Z AE1 N DH
  # example output line: EHTNAX DH N AE1 Z
  
  while(<>){ 
    @A = split(" ", $_);
    $word = shift @A;
    $word = join("", reverse(split("", $word))); # Reverse letters of word.
    @A = reverse(@A); # Reverse phones in pron.
    unshift @A, $word;
    print join(" ", @A) . "
  ";
  }