cmusphinx / g2p-seq2seq

G2P with Tensorflow
Other
670 stars 194 forks source link

No need to two-pass loops #6

Closed nshmyrev closed 8 years ago

nshmyrev commented 8 years ago

Here you can do with a single pass, and there is not need for list

  lst = []
  for line in inp_dictionary:
    lst.append(line.strip().split())

  graphemes, phonemes = [], []
  for line in lst:
    if len(line)>1:
      graphemes.append(list(line[0]))
      phonemes.append(line[1:])