Merge pull request #38 from stonebig/patch-3
python 3 compatibility fix
This commit is contained in:
Коммит
90d2520cc9
|
@ -5,7 +5,7 @@ import string
|
|||
import os
|
||||
|
||||
def usage():
|
||||
print 'Convert_label_to_cntk.py -in [fea_list file] [label_list_file] delay_number'
|
||||
print ('Convert_label_to_cntk.py -in [fea_list file] [label_list_file] delay_number')
|
||||
|
||||
def createDir(d):
|
||||
if not os.path.isdir(d):
|
||||
|
@ -22,12 +22,12 @@ else:
|
|||
delay = int(sys.argv[4])
|
||||
lablines = [x.rstrip() for x in fr]
|
||||
fr.close()
|
||||
print "#!MLF!#"
|
||||
print ("#!MLF!#")
|
||||
frnum=0
|
||||
for line in lines:
|
||||
linenew = line.split('.')
|
||||
tmp = linenew[0].split('/')
|
||||
print "\""+tmp[-1]+"\""
|
||||
print ("\""+tmp[-1]+"\"")
|
||||
fr = open (lablines[frnum], 'r')
|
||||
labs = [x.rstrip() for x in fr]
|
||||
fr.close()
|
||||
|
@ -37,8 +37,8 @@ else:
|
|||
k = i-delay
|
||||
if i-delay < 0:
|
||||
k = 0
|
||||
print i, j, labs[k], labs[k]
|
||||
print (i, j, labs[k], labs[k])
|
||||
i = i+1
|
||||
print "."
|
||||
print (".")
|
||||
frnum = frnum + 1
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче