Blame view

egs/gale_mandarin/s5/local/gale_segment.py 446 Bytes
8dcb6dfcb   Yannick Estève   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  #!/usr/bin/env python
  #coding:utf-8
  #!/usr/bin/env python
  from __future__ import print_function
  import sys
  from mmseg import seg_txt
  for line in sys.stdin:
    blks = str.split(line)
    out_line = ""
    for i in range(0, len(blks)):
      if blks[i] == "[VOCALIZED-NOISE]" or blks[i] == "[NOISE]" or blks[i] == "[LAUGHTER]":
        out_line += " " + blks[i]
        continue
      for j in seg_txt(blks[i]):
        out_line += " " + j
    print(out_line)