Blame view

egs/callhome_egyptian/s5/local/split_alt_punc.py 439 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
  #!/usr/bin/env python
  
  lexicon = open("data/local/tmp/lexicon.1")
  lexicon_ext = open("data/local/tmp/lexicon.2", "w")
  
  for line in lexicon:
      line = line.strip()
      if "//" not in line:
          lexicon_ext.write(line + "
  ")
          continue
      lineComp = line.split("\t")
      prons = lineComp[1].split("//")
      for item in prons:
          lexicon_ext.write(lineComp[0] + "\t" + item + "
  ")
  
  lexicon.close()
  lexicon_ext.close()