0001 function mlfWrite(mlf, mlfFile)
0002
0003
0004
0005
0006
0007 word=mlf.word;
0008 fid=fopen(mlfFile, 'w');
0009 fprintf(fid, '#!MLF!#\n');
0010 fprintf(fid, '"This file is generated by mlfWrite.m"#%f\n', mlf.score);
0011 for i=1:length(word)
0012 for j=1:length(word(i).phone)
0013 if j==1
0014 fprintf(fid, '%d\t%d\t%s#%f\t%f\t%s#%f\n', ...
0015 word(i).phone(j).time(1), word(i).phone(j).time(2), word(i).phone(j).name, word(i).phone(j).score, word(i).phone(j).logProb, word(i).name, word(i).score);
0016 else
0017 fprintf(fid, '%d\t%d\t%s#%f\t%f\n', ...
0018 word(i).phone(j).time(1), word(i).phone(j).time(2), word(i).phone(j).name, word(i).phone(j).score, word(i).phone(j).logProb);
0019 end
0020 end
0021 end
0022 fprintf(fid, '.\n');
0023 fclose(fid);