sylRead: Read a .syl file For example: sylFile='tangPoem.hanyu.syl'; output=sylRead(sylFile)
0001 function output=sylRead(sylFile) 0002 % sylRead: Read a .syl file 0003 % 0004 % For example: 0005 % sylFile='tangPoem.hanyu.syl'; 0006 % output=sylRead(sylFile) 0007 0008 % Roger Jang, 20071128 0009 0010 contents=textread(sylFile, '%s', 'delimiter', '\n', 'whitespace', ''); 0011 for i=1:length(contents) 0012 line=contents{i}; 0013 items=split(line, 9); 0014 output(i).sentenceSyl=strrep(items{1}, '-', ' '); 0015 output(i).textIndex=eval(items{2}); 0016 end