Home > asr > mlfWrite.m

mlfWrite

PURPOSE ^

mlfRead: Write an MLF file

SYNOPSIS ^

function mlfWrite(mlf, mlfFile)

DESCRIPTION ^

 mlfRead: Write an MLF file
    Usage: mlfWrite(word, mlfFile)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mlfWrite(mlf, mlfFile)
0002 % mlfRead: Write an MLF file
0003 %    Usage: mlfWrite(word, mlfFile)
0004 
0005 %    Roger Jang, 20060323
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);

Generated on Tue 01-Jun-2010 09:50:19 by m2html © 2003