Skip to content

Commit

Permalink
Change print statement to print function
Browse files Browse the repository at this point in the history
  • Loading branch information
shuttle1987 committed Oct 5, 2019
1 parent 5374de9 commit 9c296e6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion kaldi_decoding_scripts/utils/filt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

# Apache 2.0
from __future__ import print_function

import sys

Expand All @@ -11,4 +12,4 @@

with open(sys.argv[2]) as textfile:
for line in textfile:
print " ".join(map(lambda word: word if word in vocab else '<UNK>', line.strip().split()))
print(" ".join(map(lambda word: word if word in vocab else '<UNK>', line.strip().split())))
11 changes: 6 additions & 5 deletions kaldi_decoding_scripts/utils/nnet/gen_hamm_mat.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# ./gen_hamm_mat.py
# script generates diagonal matrix with hamming window values
from __future__ import print_function

from math import *
import sys
Expand All @@ -42,16 +43,16 @@

dim_mat=(2*splice+1)*dim
timeContext=2*splice+1
print '['
print('[')
for row in range(dim_mat):
for col in range(dim_mat):
if col!=row:
print '0',
print('0', end= ' ')
else:
i=int(row/dim)
print str(0.54 - 0.46*cos((M_2PI * i) / (timeContext-1))),
print
print(str(0.54 - 0.46*cos((M_2PI * i) / (timeContext-1))), end=' ')
print()

print ']'
print(']')


9 changes: 5 additions & 4 deletions kaldi_decoding_scripts/utils/nnet/gen_splice.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# ./gen_splice.py
# generates <splice> Component
from __future__ import print_function

from math import *
import sys
Expand All @@ -40,12 +41,12 @@

dim_out=(2*splice+1)*dim_in

print '<splice>', dim_out, dim_in
print '[',
print('<splice>', dim_out, dim_in)
print('[', end=' ')

splice_vec = range(-splice*splice_step, splice*splice_step+1, splice_step)
for idx in range(len(splice_vec)):
print splice_vec[idx],
print(splice_vec[idx], end=' ')

print ']'
print(']')

0 comments on commit 9c296e6

Please sign in to comment.